Showing posts with label geek. Show all posts
Showing posts with label geek. Show all posts

Wednesday, December 28, 2005

Operators - The dice game for geeks

A friend of mine and me had some time to kill at a cabin trip some time ago. As we got tired of Yatzy we started inventing our own game. All we had was the Yatzy dice and a deck of cards, so that's what the game was based on.

The basics

What you need to play Operators is five dice and a deck of cards. The basics of the game are to flip a card, toss the five dice, and then find a way to calculate the value on the card from the numbers on the dice. Like, if your card shows a 7, and your dice shows 1, 6, 2, 5, and 1 then you can combine them like this:
6 + 5 - 2 - 1 - 1 = 7
All the dice must be used in the solution. In this solution there are two mathematical operators in use: + and -. If you wanted to use more operators you could find a more intricate solution:
6 / 2 + 5 - 1 * 1 = 7
This one uses four different operators.
The fun part starts when you introduce more operators to the game, especially binary operators. How about this solution?
6 SHL ((2 SHR 1) AND 1) - 5 = 7
The operators

The operators we first started to use were the normal mathematical operators, +, -, * and /. These should be familiar to all geeks. If they aren't to you then I'm afraid this game is not your cup of tea. A rule of the game is that only operations that give whole-numbered results are allowed. Operations resulting in fractions can not be used. I.e 2 / 5 is not valid.

After a while we started adding more advanced math operators. These are SQR (square), SQRT (square root), POW (power), and MOD (modulo). It was at this point we started losing players. Remember that the rule of whole numbers still apply, so SQRT(8) is not allowed.

At some point we started using also binary operators, which include AND, OR, XOR, SHL (shift left), SHR (shift right), ROL (rotate left), ROR (rotate right) and NOT. For the operators that rely on a given number of bits, namely NOT, ROL and ROR, the number of bits is set to 8. This means that NOT 1 = 254 and that 1 ROR 1 = 128. These operators can't be used on numbers larger than 255. - Now we were getting to play alone.

Tip: When using binary operators, you can visualize by counting on your fingers.

We also tried out some other operators that we decided to disallow in the game. They made it too easy. Most notable is string-concatenation (&) as in 1 & 2 = 12.

How to play

1. Puzzle

A simple way to play is to just try and find a solution. This is like a puzzle more than a game. Just toss the dice and to try and find a correct solution. Sometimes it's easy, other times it's impossible. This way of playing is good practice and a good brain-teaser.

2. Points

A more competitive game is to count points from the solutions. Play like the puzzle, but when the solution is found you calculate a score of points from it. There can be many ways to count points. One way can be to give a certain number of points just for finding a solution, and then add points related to the intricacy of it - like the number of operators used, or based on a "trickyness level" of the operators.

3. Timed

For the quick-headed of you an option is to decide a certain amount of time between tossing the dice and coming up with a solution. You get, say, 1 minute, and you come up with as many solutions as you can within that time. The solution with the highest number of points is used and the score is noted for each round. This can be either turn-based, or all players can work on the same dice simultainously. After a given number of rounds the geek with the highest total score is the winner.

Wednesday, May 25, 2005

Count to 31 on one hand

We are used to counting with our fingers. We have been doing this from we first learned to count. This is quite useful in many circumstances, but the number of fingers are quite limited - 10 fingers in total per person. What if you want to count beyond 10? Do you start using toes? Or another person's fingers?

I've heard that this number of fingers is actually the basis for the 10-digit number system we have been using for centuries. In our modern computer age we should really move to the much more capable binary system. When we count with our fingers, each finger is in one of two states: up or down. Down means the finger is not counted, and up means the finger is counted. If you extend the three first fingers it signifies the number three.

But what if we reconsider these states in a binary system, where down means binary zero, and up means binary one. Then we define that the right thumb is the least significant - being the rightmost finger when you turn your palm inwards. Now you can on one hand - 5 fingers = 5 bits - count all the way to 31! And if you add the other hand, the number doesn't just double, but the number of bits doubles. That means you now have 10 fingers = 10 bits, and you can count all to the way to 1023!

It takes just a little practice to recognize the pattern of fingers as the correct numbers. It's a bit unusual to see three fingers and then understand it as the number 7. But when you've used it a few times you learn most combinations by heart.

Now you can also put numbers to well known finger gestures. Like the the "giving the finger" gesture where the middle finger is extended can now be recognized as the number 4. Or the victory-V gesture with index and middle finger extended is the number 6. The common stop-gesture with all fingers extended is the number 31, and the satan-rock sign where the index and pinky fingers are extended is the gesture for the number 18. As a tip for satan-rockers, you should try another gesture: Left hand extends only thumb and middle finger, and right hand extends all but the thumb and middle finger. This is the gesture for the number 666!

This new counting gives a little different meaning to the term "No more than you can count on one hand". If you hear this you can politely ask if they mean about 5 or about 31.