?

Log in

No account? Create an account
color cycle (slow)

Kistaro Windrider, Reptillian Situation Assessor

Unfortunately, I Really Am That Nerdy

Previous Entry Share Next Entry
Geekage
color cycle (slow)
kistaro
I am pathetically addicted to computer programming. I got stuck on my Computer Science 241 assignment, so I decided to go back to CS 102. I finished the assignment- make a talking calculator- but I wanted to do more programming.

This is why my homework assignment now has cheat codes programmed into it.


  • 1
Cheat codes in a talking calculator?

What do they do, make some of the numbers invincible to division by 0?

Actually, they already are. This is being done in Java using doubles, so a divide by zero results in the special-property value equal to Double.POSITIVE_INFINITY or Double.NEGATIVE_INFINITY. (And trying to subtract infinities reults in Double.NaN (Not a Number).)

No, what happens with the codes:

1. Click "=".
2. Press 'x' on your keyboard.
3.  +-----------------------------------------+
    | Why is this in a calculator anyway? _ X |
    +-----------------------------------------+
    |                                         |
    |       SeKrIt Ch3et CoD3 SKr33n!         |
    |      U R So 1337!!!!11!1!!!!!one        |
    |                                         |
    |   +---------------------------------+   |
    |   |_                                |   |
    |   +---------------------------------+   |
    |             +------+  +---------+       |
    |             |  OK  |  |  CANCEL |       |
    |             +------+  +---------+       |
    +-----------------------------------------+


After that, you can type a variety of things at the prompt. 31337 or 1337 results in the calculator shouting "YOU SO LEET!". Typing "scream" results in the calculator attempting to play every sound file it has at the same time, with comical results. "malfunction" is similar, except it loops them all at the same time. "muzak" starts the Jeopardy music playing in the background, and that's it for now, but I'm working on more...

Heeeee! Is this online somewhere where I could show people I know? It sounds amusing!

Not yet, although I could post it after the lab finishes. As it's a current assignment, it's against academic integrity policy to post the code or executable (in Java's case, bytecode) in a public place until the assignment's done. I can brag about it, I just can't put it where you can see its guts.

In a week, though, if I remember...

  • 1