• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to start a slot machine project  RSS feed

 
Leon Haas
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, my name is Leon and im currently learning programming in school. Im not the best at it and i could need some help of you guys if you are willing to help.
We need to create a game with the GUI and my partner and i decided that we wanted to create a slot mashine. As i said we just know the basics and just recently learned exceptions and how to use them.

I dont want a complete code since we have to do a code review when we are finished, i just some advice on how to start this project and how to turn my ideas into something useful which i can use in my program.



Have a nice day guys.
 
Campbell Ritchie
Marshal
Posts: 56546
172
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch

I have some suggestions:-
  • 1: Turn your computer off. Write down on paper, without using any computer‑specific words, what you want the game or machine to do.
  • 2: Don't write any GUI code until you have the game working at the command line. The game shou‍ld work without a GUI.
  • Is this the sort of machine you are trying to emulate?
     
    Tim Nachreiner
    Ranch Hand
    Posts: 61
    1
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    I made a tic-tac-toe gui years ago.  Try googling "tic tac toe java".  That should get you started.
     
    Leon Haas
    Greenhorn
    Posts: 2
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Campbell Ritchie wrote:Welcome to the Ranch
    . . . Is this the sort of machine you are trying to emulate?




    Thanks for the advice. Yes this is the mashine i am trying to emulate.

     
    fred rosenberger
    lowercase baba
    Bartender
    Posts: 12563
    49
    Chrome Java Linux
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    The hardest thing to learn is to separate responsibilities. it's better to have a bunch of methods that each do one small thing, than one monolithic method that does <everything>.

    remember to reuse code.  For example, you don't need three methods to generate the values on the three wheels...you need one method, and then you call it three times.  So you may have a method "getSpinResult", and it calls "getSingleWheelResult" three times.

    Compile and test your code about 100x more often than you think you should.

    Spend 90% of your time THINKING, and only 10% of your time TYPING.  I'd probably spend a day or two thinking about what my program needs to do, and how i'd break it all down, before I wrote a single line of code.
     
    Consider Paul's rocket mass heater.
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!