最初的问题
我目前正在教我弟弟编程。他完全是个初学者,但很聪明。(他真的很想学)。我注意到我们的一些会议陷入了一些小细节,我觉得我不是很有条理。(但这篇文章的答案有很大帮助。)
我怎样才能更好地有效地教他?是否有一个逻辑顺序,我可以用一个概念一个概念地运行?是否有什么复杂的问题我应该在以后再讨论?
我们正在使用的语言是Python,但任何语言的建议都是受欢迎的。
如何提供帮助
如果你有好的答案,请在你的答案中添加以下内容:
初级练习和项目想法
初学者教学资源
屏幕视频/博客文章/免费电子书
印刷适合初学者的书籍
请用链接描述资源,以便我可以看一看。我想让每个人都知道,我确实在使用其中的一些想法。你提交的内容将在这篇文章中汇总。
初学者在线教学资源:
A Gentle Introduction to Programming Using Python
How to Think Like a Computer Scientist
Alice: a 3d program for beginners
Scratch (A system to develop programming skills)
How To Design Programs
Structure and Interpretation of Computer Programs
Learn To Program
Robert Read's How To Be a Programmer
Microsoft XNA
Spawning the Next Generation of Hackers
COMP1917 Higher Computing lectures by Richard Buckland (requires iTunes)
Dive into Python
Python Wikibook
Project Euler - sample problems (mostly mathematical)
pygame - an easy python library for creating games
Invent Your Own Computer Games With Python
Foundations of Programming for a next step beyond basics.
Squeak by Example
Snake Wrangling For Kids (It's not just for kids!)
推荐印刷书籍的教学初学者
加速c++
Python编程绝对初学者
Charles Petzold编写的代码
Python编程:计算机科学介绍第二版
Python包VPython—3D Programming for Ordinary Mortal(视频教程)。
代码示例:
from visual import *
floor = box (pos=(0,0,0), length=4, height=0.5, width=4, color=color.blue)
ball = sphere (pos=(0,4,0), radius=1, color=color.red)
ball.velocity = vector(0,-1,0)
dt = 0.01
while 1:
rate (100)
ball.pos = ball.pos + ball.velocity*dt
if ball.y < ball.radius:
ball.velocity.y = -ball.velocity.y
else:
ball.velocity.y = ball.velocity.y - 9.8*dt
VPython弹跳球http://vpython.org/bounce.gif
从Python中的Turtle图形开始。
我会使用Python标准自带的海龟图形。它是可视化的,简单的,你可以使用这个环境来引入许多编程概念,比如迭代和过程调用,然后再深入语法。考虑下面的python交互会话:
>>> from turtle import *
>>> setup()
>>> title("turtle test")
>>> clear()
>>>
>>> #DRAW A SQUARE
>>> down() #pen down
>>> forward(50) #move forward 50 units
>>> right(90) #turn right 90 degrees
>>> forward(50)
>>> right(90)
>>> forward(50)
>>> right(90)
>>> forward(50)
>>>
>>> #INTRODUCE ITERATION TO SIMPLIFY SQUARE CODE
>>> clear()
>>> for i in range(4):
forward(50)
right(90)
>>>
>>> #INTRODUCE PROCEDURES
>>> def square(length):
down()
for i in range(4):
forward(length)
right(90)
>>>
>>> #HAVE STUDENTS PREDICT WHAT THIS WILL DRAW
>>> for i in range(50):
up()
left(90)
forward(25)
square(i)
>>>
>>> #NOW HAVE THE STUDENTS WRITE CODE TO DRAW
>>> #A SQUARE 'TUNNEL' (I.E. CONCENTRIC SQUARES
>>> #GETTING SMALLER AND SMALLER).
>>>
>>> #AFTER THAT, MAKE THE TUNNEL ROTATE BY HAVING
>>> #EACH SUCCESSIVE SQUARE TILTED
在尝试完成最后两个任务时,他们会有很多失败的尝试,但这些失败在视觉上很有趣,他们会很快学会,因为他们试图弄清楚为什么没有画出他们期望的样子。