more graphics and objects
play

More Graphics and Objects Rose-Hulman Institute of Technology - PowerPoint PPT Presentation

More Graphics and Objects Rose-Hulman Institute of Technology Computer Science and Software Engineering Check out 06-MoreGraphicsAndObjects from SVN. Get help if youre stuck. No quiz today. Questions Outline Random numbers


  1. More Graphics and Objects Rose-Hulman Institute of Technology Computer Science and Software Engineering Check out 06-MoreGraphicsAndObjects from SVN. Get help if you’re stuck. No quiz today.

  2. Questions

  3. Outline • Random numbers • Coordinate systems • Text input in GUI • Pair programming time

  4. Random Numbers in Python • from random import random • random() – random number between 0.0 and 1.0

  5. Coordinate Systems • Important use of graphics: represent data visually • Example: a bar chart – We really want (0,0) to be near the lower-left corner (0, 0) x y Desired coordinates Default coordinates (0, 0) x y

  6. Coordinates in zellegraphics • GraphWin has method to set coordinates – win.setCoords(x1, y1, y x2, y2) – Sets coordinates so (0, 0) x ( x1,y1 ) is the lower-left corner and ( x2,y2 ) is the upper-right

  7. Example: Learning Edge Momentum • Idea: – Success in subsequent weeks of a course depends on success in prior weeks – Amount of “momentum” depends on how interrelated the ideas are – Ideas in learning to program seem to be highly interrelated Robins, A. Learning edge momentum: A new account of outcomes in CS1. Computer Science Education, 20(1), 37-71, 2010.

  8. Text Input with zellegraphics • Use an Entry object • Constructor: – Entry(centerPoint, width) • Methods: – Usual graphics ones – Plus setText(str) and getText()

  9. +2 extra-credit in-class quiz points if you sign up and attend -5 in-class quiz points if you sign up and don’t attend without informing me before noon on Sunday Sunday, 3:30-5:30, Olin 257 Software Sunday Sign-up

  10. Pair Programming for HW6 • Tic Tac Toe – Just graphics, no AI or checking for wins (yet) – Coordinate system and getMouse() • Decorate – Loops, random numbers, using objects Show your sketches to Malhon or me before starting (much) programming.

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend