Made a Simple Rock/Paper/Scissors game

Kit_sune
25 Nov 2012, 14:40
I was trying to teach myself how some things worked and I finally figured it out! I created this simple RPS game while doing so. I plan on releasing an updated version in the future with one or two extra games in there, like maybe craps, and such.

What RPS does:
Keeps track of the player choices, and wins and losses.
If the player favors a specific choice, the computer will begin to notice this and choose more often the choice that will win over it.

What I would like is for you all to look over it and help me learn ways to shorten the code / make it better.
The biggest roadblock I had to overcome was the "divide by 0" error. I wanted to create a rate where the probability the opponent would choose something would increase, but since everything starts off at 0, the game wouldn't let me. I didn't feel like writing a bunch of "IF" statements to get around this pitfall.
I also wondered if there was a way to create a visible command. It would be similar to a Verb, but would be visible at all times as an option you could click and it would just execute the command without having to type it in.

Thanks guys,
Kitsune

jaynabonne
26 Nov 2012, 23:35
I tried it out. It seems work nicely enough. The "select your game" part was a bit confusing at first, as it said to select your game but then it said to press a key to continue. I didn't know at first it would put up a menu afterwards. I thought I had missed something.

For the "visible command", where would you like it to show up? If you just want a link in the display area, you could have a turn script that throws up some hyperlinked text. And that text could execute whatever you want. It can be as simple as:

      msg (CommandLink("inv", "Show Inventory"))


This will display a hyperlink with text "Show Inventory", and when you click on it, it will input "inv", which will make that command execute.

Campbell
27 Nov 2012, 00:10
Kit_sune wrote:I was trying to teach myself how some things worked and I finally figured it out! I created this simple RPS game while doing so. I plan on releasing an updated version in the future with one or two extra games in there, like maybe craps, and such.
Hasn't someone made a craps game with Quest already?

(I'm sorry Alex, I couldn't resist it... :lol:)