During play, whenever it comes time to call "Snap!" the builtin function "random" is used to determine who calls first: if the expression
rand()/99%2 {in C or C++}
random div 99 mod 2 {in Pascal; see note below}
yields 0, Jane calls first; otherwise John calls first. Whenever Jane calls first, print "Snap! for Jane: " followed by Jane's face-up pile, from top to bottom. Whenever John calls first, print "Snap! for John: " followed by John's face-up pile. If the game ends, print "John wins." or "Jane wins.", whichever is appropriate. If the game does not end when each player has turned over 1000 cards, print "Keeps going and going ..."