Computer Science Canada Rock Paper Scissors Lizard Spock |
Author: | slender0123 [ Mon Sep 16, 2013 6:29 pm ] | ||
Post subject: | Rock Paper Scissors Lizard Spock | ||
This is my second game i ever made.. I made it to prove I could make a rock paper scissors game thats 1 player after only have 2 weeks to work with turing. It was fun to make. I will probibly add a score button and such to it, maybe a longest streak button too.
|
Author: | Nathan4102 [ Mon Sep 16, 2013 7:22 pm ] |
Post subject: | RE:Rock Paper Scissors Lizard Spock |
In my last post, I for some reason thought we were talking about a Tic-Tac-Toe AI. :p Nice job though, it works perfectly. The next step is to: A) Pretty the game up. Make the GUI look nice, add a title, some colors, maybe some animations, its up to you! B) Shorten your code, and try to make it more efficient. This isn't THAT important when working with small games like this, but when you get to larger programs, its going to be one of your biggest concerns. Try to always make an effort to get your code both as short and efficient as possible. |
Author: | Raknarg [ Mon Sep 16, 2013 7:37 pm ] |
Post subject: | RE:Rock Paper Scissors Lizard Spock |
FOr this game, there is an algorithm you can use to shorten it I can't remember how I did it though, it has to do with if you order all the options in a circle, it should be able to beat any item two elements awayfrom it. Can't remember how I implemented it |
Author: | slender0123 [ Mon Sep 16, 2013 7:47 pm ] |
Post subject: | RE:Rock Paper Scissors Lizard Spock |
@Nathan OOh! Tic tac toe sounds like a good idea... hmm... That would be a bit difficult for me lol. I think i might try it though. And tic tac toe is pretty different then rock paper scissors lol. @Raknarg For now, I think i should get used to certain statements, which is why i've had a tendency of repeating almost the same thing over and over again. I will practice on shortening up my code once I get more familier with different statements and such. |
Author: | Raknarg [ Mon Sep 16, 2013 8:02 pm ] | ||
Post subject: | RE:Rock Paper Scissors Lizard Spock | ||
Here we go. This works if you order them in rock, paper, scissors, spock, lizard. Or any other list, where 2n positions away is a win for it, where 0 < n < number of elements / 2. You could write a RPS game with 101 elements if you want. If you use this formula, it makes certain your code is nice and short.
|
Author: | slender0123 [ Tue Sep 17, 2013 8:47 am ] |
Post subject: | RE:Rock Paper Scissors Lizard Spock |
Lol, I gotta learn how to do that. its like magic. lol. I managed to fix my ball bounce game by the way. Its updated on the oen topic I think. Yours is more or less watching someone else do it though. Its not likely a 1 player game, more like a computer vs a computers XD lol |
Author: | Nathan4102 [ Tue Sep 17, 2013 9:55 am ] |
Post subject: | RE:Rock Paper Scissors Lizard Spock |
That program was just whipped together to show his algorithm. It won't be hard to make it work 1P or 2P. |