NetLogo User Community Models
by Amelie Zeng (Submitted: 10/19/2006)
WHAT IS IT?
This is Craps, the dice game! (Without the gambling, of course.)
HOW IT WORKS
Well, in order to explain the behavior of this model, I will explain the basic rules of Craps as taught to me by my Structured Programming teacher.
In the game of Craps, you roll two dice.
If, on your first roll, you roll a seven or an eleven, you win...yay!
If, on your first roll, you roll a two, a three, or a twelve, you lose...
However, if, on your first roll, you roll neither a seven, a twelve, a two, a three, or a twelve, you do not lose...but you don't win either.
'Point' is then set to the value of the sum of the two dice.
In order to win (after your first roll), you must roll the dice until you get the value of 'point' (your first roll, if you didn't win or lose).
However, if you roll a seven after your first roll, you lose automatically.
Once you have won or lost, your next roll starts a new game.
HOW TO USE IT
This model is to be used purely for amusement, as I can forsee few other uses for this model (besides teaching the game of Craps). The 'Wins' and 'Losses' monitors show how many times you've won, and how many times you've lost. The 'Point' monitor shows the point. (See "HOW IT WORKS" for explanation)
The colors of the dice (and the little guy in the corner) can be changed using the color choosers. The choosers only list the numbers, however, so I have included a list of the colors and their corresponding numbers, just for the heck of it. (In truth, I can't remember which colors go to which, so I added it.)
THINGS TO NOTICE
Well...One thing to notice would be the "End Game" button. Clicking this button shows a messag based on your number of wins and losses, and shows what may become a signature piece in all of my programs, the cow icon. If you haven't seen, it, you should...unless you don't want to, of course.
THINGS TO TRY
I can't really think of anything *else* you can try.
EXTENDING THE MODEL
Hmmm...If you *really* wanted to extend the model, you could make the dice look like they're actually moving around. I made it so the dice look like they're rolling, but they just stay in one space. I was *going* to change it, really, but I got lazy.
There's a lot of if-elses stuck into this program...also, I created a lot of globals. But aside from that, there's not much that stands out from this procedure.
The only model I can think of that's related to this one is free-fall, a program I created some years ago...which can be found in the Community Models section of the Netlogo website.
CREDITS AND REFERENCES
People to Thank:
Mr. Fahrenbacher, my Structured Programming teacher, who taught us the game of Craps and how to use JCreator. (And this program, Mr. Fahrenbacher, proves that this program would be easier to write in Netlogo, so HA!)
Annie Lee, my friend, who wrote the cow thing.
Mr. Novak, for introducing Annie and I to Netlogo, allowing us to say, "This would be easier in Netlogo..." during Structured Programming.
(back to the NetLogo User Community Models)