代码复现-项目复现
云课五分钟-02第一个代码复现-终端甜甜圈C++-CSDN博客
不同的地图
加入班级和标识
这些案例都是来源网络,只是方便熟悉一下云课使用过程。
此部分学生掌握情况非常赞,几乎全员100分,但是实际而言危机重重。
大部分学生其实学习状态非常相似,很多都是被动完成任务而已。
课程如果有趣,一部分学生开始主动提前预习,并在课前就完成了。
惊喜的发现一部分学生开始主动思考啦^_^
这个转变最难。
适应未来社会需要主动去探索去尝试。
对于课程而言也是如此。
例如,复现一个Python版本的甜甜圈。
https://xalgord.in/python-project-make-spinning-donut-using-python/
案例复现
import pygame
import math
import colorsys
pygame.init()
white = (255, 255, 255)
black = (0, 0, 0)
hue = 0
WIDTH = 1920
HEIGHT = 1080
x_start, y_start = 0, 0
x_separator = 10
y_separator = 20
rows = HEIGHT // y_separator
columns = WIDTH // x_separator
screen_size = rows * columns
x_offset = columns / 2
y_offset = rows / 2
# rotating animation
A, B = 0, 0
spacing1 = 10
spacing2 = 2
chars = "101010101010" # luminance index
screen = pygame.display.set_mode((WIDTH, HEIGHT))
display_surface = pygame.display.set_mode((WIDTH, HEIGHT))
# display_surface = pygame.display.set_mode((0, 0), pygame.FULLSCREEN)
pygame.display.set_caption('Donut')
font = pygame.font.SysFont('Arial', 18, bold=True)
def hsv2rgb(h, s, v):
return tuple(round(i * 255) for i in colorsys.hsv_to_rgb(h, s, v))
def text_display(letter, x_start, y_start):
text = font.render(str(letter), True, hsv2rgb(hue, 1, 1))
display_surface.blit(text, (x_start, y_start))
run = True
while run:
screen.fill((black))
z = [0] * screen_size # Donut. Fills donut space
b = [' '] * screen_size # Background. Fills empty space
for j in range(0, 628, spacing1): # from 0 to 2pi
for i in range(0, 628, spacing2): # from 0 to 2pi
c = math.sin(i)
d = math.cos(j)
e = math.sin(A)
f = math.sin(j)
g = math.cos(A)
h = d + 2
D = 1.5 / (c * h * e + f * g + 5)
l = math.cos(i)
m = math.cos(B)
n = math.sin(B)
t = c * h * g - f * e
# 3D x coordinate after rotation
x = int(x_offset + 40 * D * (l * h * m - t * n))
# 3D y coordinate after rotation
y = int(y_offset + 20 * D * (l * h * n + t * m))
o = int(x + columns * y)
N = int(8 * ((f * e - c * d * g) * m - c * d *
e - f * g - l * d * n)) # luminance index
if rows > y and y > 0 and x > 0 and columns > x and D > z[o]:
z[o] = D
b[o] = chars[N if N > 0 else 0]
if y_start == rows * y_separator - y_separator:
y_start = 0
for i in range(len(b)):
A += 0.00001 # for faster rotation change to bigger value
B += 0.000002 # for faster rotation change to bigger value
if i == 0 or i % columns:
text_display(b[i], x_start, y_start)
x_start += x_separator
else:
y_start += y_separator
x_start = 0
text_display(b[i], x_start, y_start)
x_start += x_separator
pygame.display.update()
hue += 0.005
for event in pygame.event.get():
if event.type == pygame.QUIT:
run = False
if event.type == pygame.KEYDOWN:
if event.key == pygame.K_ESCAPE:
run = False
shiyanlou:~/ $ gedit donut.py [8:10:57]
(gedit:244): GVFS-RemoteVolumeMonitor-WARNING **: remote volume monitor with dbus name org.gtk.vfs.UDisks2VolumeMonitor is not supported
(gedit:244): Gtk-WARNING **: Calling Inhibit failed: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.gnome.SessionManager was not provided by any .service files
shiyanlou:~/ $ pip install --user pygame [8:11:17]
Looking in indexes: http://mirrors.cloud.aliyuncs.com/pypi/simple/
Collecting pygame
Downloading http://mirrors.cloud.aliyuncs.com/pypi/packages/71/ec/24512e03153a8acd3b9f920543e10497af7d8e271b9402ec6ebf60dbcde8/pygame-2.0.3-cp35-cp35m-manylinux_2_5_x86_64.manylinux1_x86_64.whl (13.3MB)
100% |████████████████████████████████| 13.3MB 78.4MB/s
Installing collected packages: pygame
Successfully installed pygame-2.0.3
You are using pip version 10.0.1, however version 20.3.4 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
shiyanlou:~/ $ python3 donut.py [8:11:34]
pygame 2.0.3 (SDL 2.0.16, Python 3.5.2)
Hello from the pygame community. https://www.pygame.org/contribute.html
shiyanlou:~/ $
您提供的内容主要描述了关于代码复现和项目复现的学习情况,以及学生在这过程中的学习态度和方式。以下是对您内容的理解和分析:
综上所述,您描述的内容展示了学生在代码复现和项目复现过程中的学习情况和态度变化。虽然大部分学生可能还处于被动学习的状态,但已经有部分学生开始表现出主动学习和思考的趋势,这是一个非常积极的信号。为了更好地培养学生的主动学习和思考能力,教师可以尝试让课程更加有趣和具有挑战性,同时提供更多的引导和激励。
第一阶段:基础知识讲解与演示
第二阶段:分组实践与指导
第三阶段:复现实践与问题解决
第四阶段:成果展示与总结
通过本次教学实践,学生不仅能够掌握代码复现和项目复现的基本技能,还能够培养主动学习和思考的能力,激发对编程的兴趣和热情。同时,通过团队协作和项目管理的实践,学生能够更好地适应未来社会的需求和挑战。展望未来,我们将继续探索更多有效的教学方法和手段,为学生提供更优质的教育资源和服务。