|
Author
|
Topic: ASCII Problems!
|
OhMyGoddessSixx
Geek Apprentice
Member # 3858
Rate Member
|
posted April 20, 2005 11:33
So, here I sit, stuck on this God forsaken code. I cannot for the life of me figure this problem out.
Here is the problem that's giving me, uh, problems.
What message do the following ASCII codes create?
77 111 115 116 108 121 72 97 114 109 108 101 115 115
There has to be an easier way to learn this crap! Any help would be appreciated very much. Thanks in advance.
OMG6
-------------------- "You may be a lover, but you ain't no dancer!"
Posts: 42 | From: The 7th Level Of Hell aka East Wenatchee, WA | Registered: Apr 2005
| IP: Logged
|
|
Zargof McBain
Mini Geek
Member # 3856
Member Rated:
|
posted April 20, 2005 11:53
Well it spells out "MostlyHarmless", whoever wrote it was slacking a bit, they could have at least put a 32 in there. ![[Smile]](smile.gif)
-------------------- Smile. It makes people wonder what you're thinking
Posts: 75 | From: A dark place | Registered: Apr 2005
| IP: Logged
|
|
drunkennewfiemidget
BlabberMouth, a Blabber Odyssey
Member # 2814
Member Rated:
|
posted April 20, 2005 11:55
code:
@array = qw(77 111 115 116 108 121 72 97 114 109 108 101 115 115); print chr($_) foreach @array; print "\n";
Result: MostlyHarmless
Alternatively, you can put a in front of, and a ; after every number, and view the file in a web browser...
ie:
MostlyHarmless
When viewed in a browser gets you:
MostlyHarmless (View source on this, you'll notice the word 'MostlyHarmless isn't there at all..)
This also assumes a latin alphabet charset, but should be mostly safe, since they're all 7 bit ascii.
Posts: 4893 | From: Kitchener, ON, Canada | Registered: Jun 2004
| IP: Logged
|
|
Unclear_Physicist
Geek-in-Training
Member # 3784
Member Rated:
|
posted April 20, 2005 11:56
Hmmm, I do not know the exact solution to your problem and could be completely barking up the wrong tree but this was the first thing which sprung to mind.
If you are wanting to decipher the message, find an ASCII alphabet online (usually found in binary), convert to base 10 and then you'll have the number.
Now, as ASCII is made up of one byte of numbers (i.e. 8 bits, consisting of zeroes or ones), the following counting system is needed
i.e.
for a number, 10010011, can be broken down into the following
128 = 1 64 = 0 32 = 0 16 = 1 8 = 0 4 = 0 2 = 1 1 = 1
which is the same as
(1 x 128) + (0 x 64) + (0 x 32) + (1 x 16) + (0 x 8) + (0 x 4) + (1 x 2) + (1 x 1)
which is equal to
128+16+2+1 = 147.
------------------------------------------------
Now to speed this up, doing the reverse is faster,
1) It is possible to do the reverse of what is stated above by hand as well, but for speed, use a calculator (the one in Windows in scientific mode will suffice)
2) make sure it is in decimal
3) type in number of intrigue (e.g. 77)
4) click binary and number should be converted into binary (for 77, it is 01001101)
5) Compare with ASCII chart from the web (can easily be googled) and obtain letter
--------------------------------------------------
Hope this is of some use and that I haven't mis-interpreted the question
-------------------- Le geek est chic
Posts: 36 | From: Guildford, Surrey | Registered: Apr 2005
| IP: Logged
|
|
drunkennewfiemidget
BlabberMouth, a Blabber Odyssey
Member # 2814
Member Rated:
|
posted April 20, 2005 12:01
quote: Originally posted by Unclear_Physicist: If you are wanting to decipher the message, find an ASCII alphabet online (usually found in binary), convert to base 10 and then you'll have the number.
... I've never seen an ascii chart in binary in my life. Every single one I've seen is normal decimal. At WORST in hex.
Either way, nothing a little (insert language here) can't fix.
Posts: 4893 | From: Kitchener, ON, Canada | Registered: Jun 2004
| IP: Logged
|
|
dragonman97
 SuperFan!
Member # 780
Member Rated:
|
posted April 20, 2005 12:38
quote: Originally posted by drunkennewfiemidget: quote: Originally posted by Unclear_Physicist: If you are wanting to decipher the message, find an ASCII alphabet online (usually found in binary), convert to base 10 and then you'll have the number.
... I've never seen an ascii chart in binary in my life. Every single one I've seen is normal decimal. At WORST in hex.
Either way, nothing a little (insert language here) can't fix.
I don't believe I've seen one in binary either, but definitely in hex & base 10. Hex is a much easier way to deal with ASCII, IMHO - makes it *very* easy to go to binary. The other day I was trying to recall off the top of my head what the base 10 for a letter was, and had to do the hex -> base 10 conversion in my head. I mean, really, A-Z=0x41-0x5A, and a-z is just A-Z plus 0x20. And naturally, you've got it exactly right about the easy way to change stuff.
Unclear Physicist - wow...that was...interesting...I have *no idea* why you brought binary into the equation, since it has /nothing/ to do with any normal interpretation of ASCII (most people/algoritms work in either: ASCII, base 10, or hex). It's educational, but well...unclear.
Of course, to be a little more pedantically correct, I'd point out that binary is all powers of 2 (otherwise your example looks like magic numbers), and so when reading from right to left, it's [0|1]*2^n, where n is the 0-based index from the rightmost position. Ergo, to use your example: (1 * 2^7) + (0 * 2^6) + (0 * 2^5) + (1 * 2^4) + (0 * 2^3) + (0 x 2^2) + (1 * 2^1) + (1 * 2^0)
P.S. A friend of mine once showed me this site: http://www.lookuptables.com/. I've got a deadtree copy of that in my briefcase, at the ready for whene're I'm bored, and want to find an obscure character that I have yet to memorize.
-------------------- There are three things you can be sure of in life: Death, taxes, and reading about fake illnesses online...
Posts: 9049 | From: Westchester County, New York | Registered: May 2001
| IP: Logged
|
|
OhMyGoddessSixx
Geek Apprentice
Member # 3858
Rate Member
|
posted April 20, 2005 12:55
Thank you for all the help. There is a table in my textbook where the ASCII is set up in rows and columns, but it's even more confusing to me. Blehh. I looked on Unicode, and even that wasn't much help either.
The problem I "spoke" of is part of my Java programming baloney. I wanted to put make a new Java app and see if it would run after compiling it, but I couldn't figure out how to do it.
Java+Forced Insomnia=Insanity!
Posts: 42 | From: The 7th Level Of Hell aka East Wenatchee, WA | Registered: Apr 2005
| IP: Logged
|
|
-ct-
BlabberMouth, the Next Generation
Member # 209
|
posted April 20, 2005 13:13
quote: Originally posted by Zargof McBain: Well it spells out "MostlyHarmless", whoever wrote it was slacking a bit, they could have at least put a 32 in there.
you mean 42
-------------------- Things are always darkest... just before you pull your head out of your butt, void where prohibited, keep away from flame, surcharge(s) may apply.
www.harddriveHELL.com and demoniclemon.com
Posts: 1906 | From: nowhere, man | Registered: Jan 2000
| IP: Logged
|
|
Zargof McBain
Mini Geek
Member # 3856
Member Rated:
|
posted April 20, 2005 13:26
quote: Originally posted by -ct-: quote: Originally posted by Zargof McBain: Well it spells out "MostlyHarmless", whoever wrote it was slacking a bit, they could have at least put a 32 in there.
you mean 42
No 32, that's ASCII for space, I'm not sure where a '*' would fit....
... P.S. I got it, I'm just feeling facetious. ![[Wink]](wink.gif)
-------------------- Smile. It makes people wonder what you're thinking
Posts: 75 | From: A dark place | Registered: Apr 2005
| IP: Logged
|
|
dragonman97
 SuperFan!
Member # 780
Member Rated:
|
posted April 20, 2005 13:31
quote: Originally posted by -ct-: quote: Originally posted by Zargof McBain: Well it spells out "MostlyHarmless", whoever wrote it was slacking a bit, they could have at least put a 32 in there.
you mean 42
No, a 32==0x20==[Space]
-------------------- There are three things you can be sure of in life: Death, taxes, and reading about fake illnesses online...
Posts: 9049 | From: Westchester County, New York | Registered: May 2001
| IP: Logged
|
|
Koboldskind
Geek-in-Training
Member # 3849
Member Rated:
|
posted April 20, 2005 14:18
quote: Originally posted by -ct-: quote: Originally posted by Zargof McBain: Well it spells out "MostlyHarmless", whoever wrote it was slacking a bit, they could have at least put a 32 in there.
you mean 42
42 does not belong IN there, it is the solution. And now we finally know the most important question, even before the movie's out =)
-------------------- In the Beginning, there was nothing, which exploded ...
Posts: 36 | From: Germany | Registered: Apr 2005
| IP: Logged
|
|
Rhonwyyn
 Solid Gold SuperFan!
Member # 2854
Member Rated:
|
posted April 20, 2005 15:05
Ehh, we still don't know the question. We only know the answer. Kinda like Jeopardy!:
Contestant: Life for $600, please, Alex.
Alex: The sum of two score and two.
Contestant: What is the answer to the question of the meaning of life?
-------------------- Change the way you SEE, not the way you LOOK!
Posts: 3831 | From: Lancaster, PA | Registered: Jul 2004
| IP: Logged
|
|
nerdwithnofriends
Uber Geek
Member # 3773
|
posted April 20, 2005 15:08
see www.asciitable.com
this should help: code:
#include <stdio.h> #define BUFFSIZE 32 int main(){ int code; do{ printf("ASCII: "); scanf("%d", &code); code > 32 ? printf("Character: %c\n", (char)code): printf("Character: NOTPRINTABLE\n"); } while (code > 0); return 0; }
hope that helps!
-------------------- "The Buddha, the Godhead, resides quite as comfortably in the circuits of a digital computer or the gears of a cycle transmission as he does at the top of a mountain or in the petals of a flower." - Robert M. Pirsig
Posts: 948 | Registered: Mar 2005
| IP: Logged
|
|
nerdwithnofriends
Uber Geek
Member # 3773
|
posted April 20, 2005 15:09
EDIT: wow, don't know why I put that BUFFSIZE macro in there...
-------------------- "The Buddha, the Godhead, resides quite as comfortably in the circuits of a digital computer or the gears of a cycle transmission as he does at the top of a mountain or in the petals of a flower." - Robert M. Pirsig
Posts: 948 | Registered: Mar 2005
| IP: Logged
|
|
csk
Member # 1941
Member Rated:
|
posted April 20, 2005 18:24
I may be showing my age here, but I still remember the hex EBCDIC numbers for characters much better than the ASCII ones.
-------------------- 6 weeks to go!
Posts: 4455 | From: Sydney, Australia | Registered: Jan 2003
| IP: Logged
|
|
-ct-
BlabberMouth, the Next Generation
Member # 209
|
posted April 20, 2005 21:47
only because for the rest of my life, after reading those books, anytime anyone puts those two words together - that's the 1st thing i think of
![[Happytears]](graemlins/happytears.gif)
-------------------- Things are always darkest... just before you pull your head out of your butt, void where prohibited, keep away from flame, surcharge(s) may apply.
www.harddriveHELL.com and demoniclemon.com
Posts: 1906 | From: nowhere, man | Registered: Jan 2000
| IP: Logged
|
|
quantumfluff
BlabberMouth, a Blabber Odyssey
Member # 450
Member Rated:
|
posted April 21, 2005 08:19
quote: Originally posted by drunkennewfiemidget: ...I've never seen an ascii chart in binary in my life. Every single one I've seen is normal decimal. At WORST in hex
Ah youth. All the best ASCII charts are in binary. At least for those of us who remember this era
Posts: 2863 | From: 5 to 15 meters above sea level | Registered: Jun 2000
| IP: Logged
|
|
drunkennewfiemidget
BlabberMouth, a Blabber Odyssey
Member # 2814
Member Rated:
|
posted April 21, 2005 08:21
quote: Originally posted by quantumfluff: quote: Originally posted by drunkennewfiemidget: ...I've never seen an ascii chart in binary in my life. Every single one I've seen is normal decimal. At WORST in hex
Ah youth. All the best ASCII charts are in binary. At least for those of us who remember this era
But you'll notice even they have the equivalent numbers in decimal on the left hand side.
Posts: 4893 | From: Kitchener, ON, Canada | Registered: Jun 2004
| IP: Logged
|
|
functors and the city
Maximum Newbie
Member # 3904
Rate Member
|
posted May 10, 2005 15:44
I remember, as a 10-yr-old, writing a GW-BASIC game that would show random words (not from a dictionary, things like AZFGAAAQTL) and ask you the sum of their ASCII values. It'd then give you $n \in \{ small numbers \}$ tries at guessing it, responding to wrong answers with "less than that" and "more than that".
I remember getting quite good at the game, too.
-------------------- --- tutto č burla nel mondo
Posts: 12 | From: Rio de Janeiro, RJ | Registered: May 2005
| IP: Logged
|
|
|