Horsey Numbers

Post your Gambas programming questions here.
Post Reply
User avatar
Cedron
Posts: 156
Joined: Thursday 21st February 2019 5:02pm
Location: The Mitten State
Contact:

Horsey Numbers

Post by Cedron »

So, quite a while ago, I was hanging out with my buddy Chucky B. We were tossing a disc outside a music festival and decided to sit down for a break.

After a while, he was staring off into space, moving his fingers up and down. I asked, "Hey, whatcha doin'?" He said he was counting residuals. I said "Huh?" And we continued sitting there for a while until some horses doing some kind of strange dance in the next field caught his attention.

"What do you think they are doing?" he asked me. I told him I was pretty sure they were talking about us. He said "Huh?"

I asked him, "Don't you know about horsey numbers?" He said "No." Well, I explained that I hadn't figured it out completely, it was a tough code to break, but it goes something like this:

If a horse stands on all fours, it means nothing or zero. Zero is an answer, nothing is not, but I don't think they make that distinction. "Okay" he said.

Now, if a horse raises his front right hoof, that means "it" or "one". If he raises his left front hoof it means "a couple" or "two". If he raises both front hoofs it means "a few" or "three".

"Go on", Chucky said.

If he raises is right rear hoof, immediately before, or during raising his front hoofs, it means "add four" to what my front hoofs are saying. And if he wants to emphasize it more, he'll raise is rear left hoof first, which means "add eight". If he raises both rear hoofs, he is probably mad at something, cuz that means "add twelve".

Now Chucky was a bright kid, and he quickly said they can count from 0 to fifteen with a single gesture. Yep, I replied, and you can do the same with just the fingers of one hand. Or we can write them down:

One would be:
O *
O o

Two would be:
* O
O O

And so on. We can save space and make them numbers if we use a zero instead of an "O" for hoof down, and a one instead of an "*" for hoof up. Placing them on a single line, rear hoof first, it becomes like this:

0000 0
0001 1
0010 2
0011 3
0100 4
0101 5
0110 6
0111 7
1000 8
1001 9
1010 10
1011 11
1100 12
1101 13
1110 14
1111 15

He said, let's make the 10 through 15, A through F so they each only take one space. I objected saying I am already using the letters trying to figure out the rest of the code. "What do you mean?" he asked me.

I said, "Well the horses team up to tell their stories, and that is where it gets complicated and I only have it partially figured out." He asked me to keep explaining.

When the first horse says "a few" or "three", the second horse gives a number.

0011 0000 = "0"
0011 0001 = "1"
..
0011 1001 = "9"

Now, we can make things numerical if we multiply the first horse's number by sixteen and add it to the second horse's number. So we get

48 = "0"
49 = "1"

and so on.

I said, when they want to use nouns, the first horse signals a four, and he second horse give the word. I haven't been able to figure out what the words are in horsey language so that's where I use A,B,C, etc.

0100 0001 = "A"
0100 0010 = "B"
0100 0011 = "C"

"No clue?" he asked. "No clue." I replied, but verbs are different, so I used lower case for those. When a verb is used, the first horse say "six", aka 0110, right rear hoof up and left front one at the same time. You have to watch the first horse to know what the second horse is saying. I used lower case letters to list the verbs, but I still don't have a clue what they mean to the horses.

0110 0001 = "a"
0110 0010 = "b"
0110 0011 = "c"

He said "That's really interesting, have you ever asked them?"

"No, they can bite.", I replied.

He said, "When you have a clue, let me know." and went back to wiggling his fingers. Pretty soon he took of his shoes and socks and started wiggling his toes too. I let him be for a while, and then said "If you are curious again just askie and I'll tell you what I've figured out."

This is why Gambas, like BASICs before it, use "&H" to denote horsey numbers. C, being cryptic like it likes to be, uses "0x". Zero to say a number is coming, and the little "x" to represent the horse lifting its hoofs. And now you know.

Ced
.... and carry a big stick!
User avatar
Cedron
Posts: 156
Joined: Thursday 21st February 2019 5:02pm
Location: The Mitten State
Contact:

Re: Horsey Numbers

Post by Cedron »

So, a while after this happened, another buddy of mine named Frankie came over for a visit. We were chatting a bit and Frankie told me Chucky had explained horsey numbers to him. That's not how the gray mares at my place do it he told me.

"Please explain", I said.

He tells me that they have a different counting order that goes like this:

0 = 0 --> Front Hoofs down
1 = 1 --> Right Hoof up

That's the same so far, but here is where they change it up:

2 = 11 --> Both front hoofs up

Makes sense so far, and then

3 = 10 --> Left foot up

So, I asked him why they did it like that. He said he thinks it's because they only want to move one hoof at a time when counting. Sure enough, thats how it works:

0 = 00
1 = 01
2 = 11
3 = 10

And they can cycle around to the beginning, only moving one hoof for each step. Remarkable.

"Yeah", he said, "They are lazy like that. But it goes further. In order to keep the 'only one hoof moves rule', they reverse the order when they raise their right rear hoof. So it goes like this:"

0 = 000
1 = 001
2 = 011
3 = 010
4 = 110
5 = 111
6 = 101
7 = 100

It is really pretty clever I told him. Hmmmmmm, Laziness must be the father of invention.

Finally when they include their left rear hoof, they also get sixteen combinations, but they are ordered differently.

0 = 0000
1 = 0001
2 = 0011
3 = 0010
4 = 0110
5 = 0111
6 = 0101
7 = 0100
8 = 1100
9 = 1101
10 = 1111
11 = 1110
12 = 1010
13 = 1011
14 = 1001
15 = 1000

Of course, Chucky still wants to call the last six A through F and I stubbornly refuse. Now when the second mare comes into play, the first mare has to reverse her order if the second mares right front hoof is raised. This complicates things a bit, but now both mares can count from 0 to 255 moving only one hoof at a time between them.

"This is quite remarkable", I said, "There must be some practical purpose this could be used for."

Then I said, "Thanks Frankie, I'm going to think about this for a while. There has to be a way to translate horsey numbers to gray mare numbers."

So let's see.

Code: Select all

     Gray  Horsey
 0 = 0000  0000
 1 = 0001  0001
 2 = 0011  0010
 3 = 0010  0011
 4 = 0110  0100
 5 = 0111  0101
 6 = 0101  0110
 7 = 0100  0111
 8 = 1100  1000
 9 = 1101  1001
10 = 1111  1010
11 = 1110  1011
12 = 1010  1100
13 = 1011  1101
14 = 1001  1110
15 = 1000  1111
Can you figure it out?

No fair cheating by looking up "Gray mare codes"

Ced
.... and carry a big stick!
Post Reply