python牛蛙游戲設計和線性回歸分析_第1頁
python牛蛙游戲設計和線性回歸分析_第2頁
python牛蛙游戲設計和線性回歸分析_第3頁
python牛蛙游戲設計和線性回歸分析_第4頁
python牛蛙游戲設計和線性回歸分析_第5頁
已閱讀5頁,還剩10頁未讀, 繼續(xù)免費閱讀

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領

文檔簡介

1、Wonderful frog game1Anan An Sep.2016simple introduction :A racquet, represented as a short line segment, can be moved to and fro across the bottom of the window by key presses or by mouse dragging.Frogs would move in the window with a random speed and direction.Each frog bounces off the top, left an

2、d right edges of the window, and off the racquet at the bottom. A frog misses the racquet at the bottom is lost.The frogs bounce each other when they collide.2game introduction :The player scores a point every time when frogs hit the top of the windows .All frogs lost off the bottom of the window, t

3、he game is end.34FrogImagerectlefttopspeedStatus_init_ ()move ()ReflectorImagerectlefttopspeedstatus_init_ ()move ()MainFrameplay() animateplayerspygame.sprite.SpriteScoreMoniterpointsscore_textClass Hierarchymyplayer.py5v base class: pygame.sprite.Sprite: simple base class for visible game objects.

4、v Methods: animate (): animation function ,Collision Detection,build panel, frog and scoring in screen. play (): game startv Class Frog: Define frog classvariables: image:the image of a frog.rect:the rectangle size of a frog imageleft: the left coordinate of a frog rectangle top:the top coordinate o

5、f a frog rectangle speed:the moving speed and direction of a frogstatus:the moving status of a frog methods: _init_():initial a frog move():move a frogv Class Reflector: Define Reflector classvariables: image:the image of a reflector.rect:the rectangle size of a reflector imageleft: the left coordin

6、ate of a reflector rectangle top:the top coordinate of a reflector rectangle speed:the moving speed and direction of a reflectorstatus:the moving status of a reflector methods: _init_():initial a reflector move():move a reflectorTest case for Frog classTechnical: start the game, frogs are created an

7、d moved automatically Code coverage: play, ball, animate8MethodsDescriptionInput Expected outputActual output_init_()Check if the frog shows correctly when initial the game imageFile & location &SpeedThe frog appears in the settled location of screenThe frog appears in the settled location o

8、f screen move()Move a frogA frog can move with random direction and speedA frog can move with random direction and speedTest case for Reflector classTechnical: start the game, racquet created and moved by mouse dragging or key presses.Code coverage: play, ball, animate9MethodsDescriptionInput Expect

9、ed outputActual output_init_()Check if the reflector shows correctly when initial the game imageFile & location &SpeedThe reflectorappears at the bottom of screenThe reflectorappears at the bottom of screen move()Move a reflectorA reflectorcan move with fixed speedA reflectorcan movewith fixed speed10Linear regression by PythonEntry No.Square FeetPrice11506450220074503250845043009450535011450640015450760018450PREDICTING HOUSE PRICESWe have the following dataset and core codes:Withlinearregression,weknowthatwehavetofindalinearitywithinthedatasowecanget

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
  • 4. 未經權益所有人同意不得將文件中的內容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網僅提供信息存儲空間,僅對用戶上傳內容的表現方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
  • 6. 下載文件中如有侵權或不適當內容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論