Anonymous user
Rock-paper-scissors: Difference between revisions
m
→{{header|C}}: minor comment
m (→{{header|C}}: minor comment) |
|||
Line 201:
printf("\nYour choice [1-3]:\n"
" 1. Rock\n 2. Paper\n 3. Scissors\n> ");
/* scanf is a terrible way to do input. should use stty and keystrokes */
if (!scanf("%d", &user_action)) {
scanf("%1s", str);
Line 220 ⟶ 222:
printf("You chose %s; I chose %s. %s\n",
names[user_action], names[my_action], winner);
user_rec[user_action] ++;
}
}</lang>
=={{header|Java}}==
{{works with|Java|1.5+}}
|