- 博客(8)
- 收藏
- 关注
原创 ESP32 micropython 为整个系统添加自己的module
添加外部模块MODULE:(起名字为ming,随意取得) 1.ports/esp32下面新建.C文件 Ex:modming.c 程序如下 #include <stdio.h> #include <string.h> #include “py/obj.h” #include “py/runtime.h” //a.定义方法 STATIC mp_obj_t ming_shuchu(void) { int result; result = 10; return mp_obj_new_i
2020-07-21 14:54:56
1112
原创 An Introduction to Interactive Programming in Python 第七周作业
最后一个作业了 还记着当时大概做了一周才做完。 效果图: 图片一直上传失败,下次补图。 import simplegui import random import math # globals for user interface WIDTH = 800 HEIGHT = 600 score = 0 lives = 3 time = 0.5 class ImageInfo: def __init__(self, center, size, radius = 0, lifespan = None,
2020-07-18 22:07:37
144
原创 An Introduction to Interactive Programming in Python 第六周作业
第一次使用画布,还是比较新奇。 import simplegui import random # load card sprite - 949x392 - source: jfitz.com CARD_CENTEN=[53,70] CARD_SIZE =[106,140] card_images = simplegui.load_image("http://image.baidu.com/search/down?tn=download&word=download&ie=utf8&
2020-07-18 21:58:46
154
原创 An Introduction to Interactive Programming in Python 第六周作业
描述:颠倒相同的扑克牌就会常亮。 上代码,逻辑废点脑子 import simplegui import random numbers = [0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7] STATE = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] f=s=t=n=0 turn = click = 0 label = 0 def new_game(): global numbers,state,turns,click random.shuff
2020-07-18 21:57:20
115
原创 An Introduction to Interactive Programming in Python 第五周作业
这个当时做的时候花费了一些时间,。主要功能WS,箭头上下控制两侧板子移动,来弹走小球,每碰撞一次,小球速度会增加一倍。 import simplegui import random WIDTH = 600 HEIGHT = 400 BALL_RADIUS = 20 BALL_POS = [WIDTH/2 ,HEIGHT/2 ] PAD_WIDTH = 8 PAD_HEIGHT = 80 HALF_PAD_WIDTH = PAD_WIDTH / 2 HALF_PAD_HEIGHT = PAD_HEIGH
2020-07-18 21:55:08
159
原创 An Introduction to Interactive Programming in Python 第四周 计时器
计时器,简单的逻辑使用 # template for "Stopwatch: The Game" import simplegui # define global variables A = 0 B = 0 C = 0 D = 0 E = 0 F = 0 status = False # define helper function format that converts time # in tenths of seconds into formatted string A:BC.D #def form
2020-07-18 21:51:07
110
原创 An Introduction to Interactive Programming in Python 第二周
第二次作业 先上效果图。 import simplegui import random count = 7 def new_game(): global num global num_range print "new game.range is from 0 to 100" print "number of remaining guesses is 7" print "" num = random.randrange(0,100)
2020-07-18 21:44:20
193
原创 An Introduction to Interactive Programming in Python 第一周
即将新换电脑为了防止自己所做过的项目丢失,今天开始,就把一些做过的小东西上传到这里,以后也方便查看。 效果图: 第一次作业比较简单,上代码不多说。 # Rock-paper-scissors-lizard-Spock template # The key idea of this program is to equate the strings # "rock", "paper", "scissors", "lizard", "Spock" to numbers # as follows: # # 0
2020-07-18 21:39:14
189
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人