Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $X = $_POST['X'];
- $Y = rand(1, 3);
- $A = $X-$Y+3;
- $R = fmod($A, 3);
- if ($R == 0) {
- echo 'draw!';
- } elseif ($R == 1) {
- echo 'you won!';
- } elseif ($R == 2) {
- echo 'you lost!';
- } else {
- echo 'an error occurred!';
- }
- Table: Users
- UserID Username (I don't include email, password and salt here...)
- 1 Espen
- 2 Test
- Table: Games
- GameID Participant1 Participant2 Winner
- 1 1 2 1
- 1 1 2 2
- Table: Moves
- MoveID GameID UserID Move
- 1 1 1 2
- 2 1 2 1
- 3 2 1 3
- 4 2 2 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement