##language:zh ''' [[http://wiki.woodpecker.org.cn/moin/StartProgramming|开始编程之旅]] 翻译自Lee Harr的[[http://staff.easthighschool.net/lee/computers/book/Start_Programming.html|Start Programming]] 本文是使用[[http://www.nongnu.org/pygsear/|pygsear]]+[[http://pygame.org|pygame]]作为开发环境,以初级用户角度来分步分阶段学习[[http://www.python.org|PYTHON]]基本概念,并以小游戏开发项目为具体案例,介绍的十分详细。编写风格清新朴实,没有象一般教科书那样枯燥,极其适合初级用户来激发兴趣时使用。 ''' <<TableOfContents>> = StartProgramming-0-2 是什么What = '''指令'''Instructions If a computer were a boardgame, a program would be the instructions for the game. The program tells the computer how to start, what to do in certain particular situations, and when to stop. '''如果把计算机比作一个棋盘游戏,那么程序就是操控这个游戏的指令。程序通知计算机如何开始,在某种特定的环境下应该做什么,以及什么时候结束。''' {{attachment:penguin_boardgame.png}} It is not a perfect analogy, of course, but it will do fine to get us started. '''也许这并不是个完美的比喻,但是却能够很好的引导我们入门。''' One way a program is like a boardgame is that every player must take turns. '''有一点是相同的,在棋盘游戏中玩家必须发生改变。''' Sometimes, when a complex computer program is running, it can seem as if there is a whole world inside there, all moving and changing simultaneously, but it is only an illusion. '''有时,一个复杂的程序正在运行,它看起来像所有的东西都包含在里面,所有的移动和改变同时进行,但实际上这是个错觉。''' The computer can only process one instruction at a time. '''计算机在同一时间只能运行一条指令。''' However, it can process the instructions so fast that to us it seems smooth and almost alive. '''不管怎样,计算机运行指令是如此的快速以至于他们看起来好像是同时运行的一样。'''