Skip to content

RaisTMJ/twelve-ball-riddle

Repository files navigation

Gitpod ready-to-code

12 ball (Human in island) riddle that mention in brooklyn nine-nine

Watch the video Watch the video


Riddle

  1. There is 12 ball where 1 ball slightly different weight than others eleven.
  2. The differnce ball could be heavier or lighter than others.
  3. There is one scale to measure the ball.
  4. Best amount of scale use is 3 times only.

can you achieve that?? :)

coding instruction;

scaling will produce three result, right is lighter, right is heavier, or scale balance.

Rules

so it meant in each of the scale interval only can use three if()else if() else{} three time only, or one switch statement with three case. ball setup there is 12 identical ball there place in array as weight 1. one random ball weight between 0 to 2 replace randomly in ball setup array. if weight random ball equal to one the system will failed as 12 ball now identical

Checking. There is while loop checking the riddle.

how to run program

tsc riddle.ts
node riddle.js

About

classic 12 ball riddle

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published