I am really lost--(dice program)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Qecbum
    New Member
    • Mar 2008
    • 3

    #1

    I am really lost--(dice program)

    ok I have to do the what is on this page http://www.rschooltoday.com/school15...dice_class.doc

    and i have no idea how to go about it. We use this graphics thing, here i will post it. I am suposed to do what that says, but i cat figure this one out. i will also post what i have as well. heres the graphics thing...

    here is what i have sofar... its not a lot i can tell you lol...


    from graphics import *

    win = GraphWin()
    win.setCoords(0 ,0,10,10)
    r = Rectangle(Point (0,0),Point(10, 10))
    r.draw(win)

    i am just really not grasping this one, i missed a few days so i have no idea where to go/what to do...


    *edit* sorry about that, i did not realize you could do that this should make it easyer to read now lol
    Attached Files
    Last edited by Qecbum; Mar 5 '08, 04:06 PM. Reason: to long lol
  • jlm699
    Contributor
    • Jul 2007
    • 314

    #2
    Ok, so what is it that you aren't getting?

    All it seems to be asking you to do is create a Class.

    The code you have above may be used to test your class. I do see one problem with what you're doing however... the rectangle you draw on your window should be smaller than the grid on teh window or else it will not appear very cleanly...

    Comment

    • Qecbum
      New Member
      • Mar 2008
      • 3

      #3
      Ok thanks i some what realized this as i was programing earlyer, i have since put in butons, and i am actualy done with the astetiscs, i just need to hardwire it as it were... i need to set my button to randomly chose what side of the die to use, i will post my updated code shortly...


      here i am uploading my "new" code, this is only the frame work for my butons, i have to still put it into the program and then build a random genration die outcome thing... i got the buttons but i dont konw how to set it up in to the program or how to ramdomly generate the outcome, that is where i need help. i mean i have done the main framework, i just need the shell to put it in, and the random generator.... thanks for any and all help lol
      Attached Files
      Last edited by Qecbum; Mar 5 '08, 06:52 PM. Reason: more detail

      Comment

      • jlm699
        Contributor
        • Jul 2007
        • 314

        #4
        Originally posted by Qecbum
        i just need the shell to put it in, and the random generator.... thanks for any and all help lol
        Not quite sure what you mean by 'the shell to put it in'...

        As far as random generator have you looked into the following?

        [CODE=python]
        >>> import random
        >>> random.randint( 1, 6)
        4
        [/CODE]

        Comment

        • Qecbum
          New Member
          • Mar 2008
          • 3

          #5
          Well think of it like a car, i got the engin and the frame work but i need the body... and the battery lol thanks for the random, but it dont know, if that is a corect random, it is using the graphics that i uploaded earlyer
          Last edited by Qecbum; Mar 8 '08, 07:22 PM. Reason: spelling....

          Comment

          Working...