first attempt. doesnt work.
WIP: about to rewrite this as it doesnt work
simpler attempt that works but has a race condition if one player is not waiting when the other notifies
this attempt with semaphores seems to work well but it uses a busy wait.
replaced busy wait with an if & a yield. This makes the program always terminate but we don't get consistent ordering
back to wait/notify strategy. Works now. I think I was not using synchronized correctly before
adding documentation