Applying multithreading

Jan 22, 2016 at 3:25pm
solved
Last edited on Jan 23, 2016 at 12:46pm
Jan 22, 2016 at 4:15pm
Two players taking turns doesn't involve multithreading.

Your game does one thing at a time:
1. initialize
2. while (not finished)
3.     get player 1's input
4.     process player 1's input
5.     if (not finished)
6.         get player 1's input
7.         process player 1's input
8. if (finished)
9.     end the game


Concurrency means doing more than one thing at the same time.
Jan 22, 2016 at 4:32pm
@kbw

I know. I'm asking for suggestions on how to make it a two-player game instead.
How do I begin, using threads.
Jan 22, 2016 at 4:53pm
I don't understand the question.

Do you want to learn threading or do you want write a two player game? As I said above, a two player game is a single threaded program.
Jan 22, 2016 at 4:55pm
He probably means a 2 player game in which both can play at the same time.
Jan 22, 2016 at 5:03pm
Are you sure your professor said multithreading and not multiplayer?

A multiplayer game is a game that can be played by more than one player.
Last edited on Jan 22, 2016 at 5:07pm
Topic archived. No new replies allowed.