A Logic Game

This is a good-one. I wrote the Pseudo-Code but I was curious to see if it would work so I write it on JavaScript. and I this one work, I enjoy doing this one.

Instructions:

10 friends are sitting in a circle around a table and decide to play a new game. In it, they count up through the numbers from 1 to 100. The first person says “1”, the second says “2” and so on… but with a few catches:

  • Whenever the number is divisible by 7, they switch directions. So person 6 will say “6”, person 7 will say “7”, then person 6 again will say “8”.
  • Whenever the number is divisible by 11, they skip the next person.

Your job is to pseudocode a program which will determine which player says the number 100. For this one, be as specific as possible to actually write out the logic of the procedure.

program-counter-game2


Copyright 2017. All rights reserved.

Posted November 9, 2016 by Edmundo in category "Daily