Discussion:
[Tutor] Help with writing a bean bag toss game in python
Grace Anne St Clair-Bates
2015-05-20 02:53:00 UTC
Permalink
Hello! I am trying to code a bean-bag toss game in python where the program
generates three random dots inside a turtle graphic. Each different hole
means a different score, but I don't know how to write the function to
calculate the total score with all three random points and display the
score on the score board. It is hard to explain, but if anyone has an idea
please let me know! thanks
_______________________________________________
Tutor maillist - ***@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
Alan Gauld
2015-05-20 09:25:55 UTC
Permalink
Post by Grace Anne St Clair-Bates
Hello! I am trying to code a bean-bag toss game in python where the program
generates three random dots inside a turtle graphic. Each different hole
means a different score, but I don't know how to write the function to
calculate the total score with all three random points and display the
score on the score board. It is hard to explain,
One of the things you learn in programming is that you can't write code
until you understand the concept. So before you worry about the code you
need to think more about what you are trying to do. Once you can
articulate the problem the solution will be easier to see.

And if you can't explain what you are trying to do there is little
chance of us guessing what it is.

As a start you could try sketching the user interface of your game.
Name the elements. Then describe the interaction between the user
and the game. (FWIW This technique is known as writing a use-case
in software engineering) Include all the alternative outcomes for
a given action.

HTH
--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos


_______________________________________________
Tutor maillist - ***@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
Laura Creighton
2015-05-20 09:18:48 UTC
Permalink
In a message of Tue, 19 May 2015 19:53:00 -0700, Grace Anne St Clair-Bates writ
Post by Grace Anne St Clair-Bates
Hello! I am trying to code a bean-bag toss game in python where the program
generates three random dots inside a turtle graphic. Each different hole
means a different score, but I don't know how to write the function to
calculate the total score with all three random points and display the
score on the score board. It is hard to explain, but if anyone has an idea
please let me know! thanks
Hello, and welcome.
I am a bit confused here. Are you trying to make an electronic version
of the game pictured here:
http://media.kohls.com.edgesuite.net/is/image/kohls/1070643?wid=500&hei=500&op_sharpen=1

So by 'turtle graphic' you mean a real picture of a turtle,

or are you using the python turtle module to make something else
called turtle graphics -- graphics made as if you were a turtle
crawling around the screen? https://docs.python.org/2/library/turtle.html

In either case, can you show us some code?

Thanks very much,
Laura Creighton


_______________________________________________
Tutor maillist - ***@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Continue reading on narkive:
Loading...