LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-20-2008, 02:47 PM   #1
snowman81
Member
 
Registered: Aug 2006
Location: Michigan
Distribution: Ubuntu
Posts: 282

Rep: Reputation: 30
Ascii between 925559 && 927901


Can anyone think of a word between the ascii decimal values of 92559 and 927901?
 
Old 01-20-2008, 02:56 PM   #2
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
What do you mean by a word. If you mean 2 bytes, than those numbers are outside the range that 16 bits can represent.
 
Old 01-21-2008, 01:38 PM   #3
snowman81
Member
 
Registered: Aug 2006
Location: Michigan
Distribution: Ubuntu
Posts: 282

Original Poster
Rep: Reputation: 30
It's like a puzzle. Like for instance, the decimal equivalent of "a" is 97, like in the Ascii table. But the the total of all the letters in the word added up have to be between those numbers.
 
Old 01-21-2008, 02:19 PM   #4
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Hmm, that would be a word with around 10000 letters ...
 
Old 01-21-2008, 03:04 PM   #5
Alien_Hominid
Senior Member
 
Registered: Oct 2005
Location: Lithuania
Distribution: Hybrid
Posts: 2,247

Rep: Reputation: 53
Quote:
Originally Posted by snowman81 View Post
Can anyone think of a word between the ascii decimal values of 92559 and 927901?
You're doing smth wrong.

Last edited by Alien_Hominid; 01-21-2008 at 03:05 PM.
 
Old 01-21-2008, 03:20 PM   #6
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
OK.... The sum of the ascii values for "abc" would be 303. Take 100 letters with an average value of 110 (n), and you get 11,000. Getting to 927,000 will take one heck of a word......

Please disambiguate what you mean by
Quote:
all the letters in the word added up
Also, the first number in the title is not the same as in the text.
 
Old 01-21-2008, 03:21 PM   #7
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Quote:
Originally Posted by snowman81 View Post
It's like a puzzle. Like for instance, the decimal equivalent of "a" is 97, like in the Ascii table. But the the total of all the letters in the word added up have to be between those numbers.
Do you mean concatenated rather than added up.
 
Old 01-21-2008, 04:02 PM   #8
snowman81
Member
 
Registered: Aug 2006
Location: Michigan
Distribution: Ubuntu
Posts: 282

Original Poster
Rep: Reputation: 30
Hmm, maybe, here is a program I got from someone else. It checks to see if a word meets those standards.

Code:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main()
{
char string[100];
int ascii_code;
int i;
int sum=0;
printf("Give string: ");
scanf("%s",&string);
for (i=0; i<strlen(string); i++)
{
sum+=(int)string[i] + (sum*i);
}

if (sum>925559 && sum<927901)
printf("VALID ID! - ");
else
printf("NOT VALID ID! - ");

printf("%d\n",sum);

return 0;

}
 
Old 01-21-2008, 04:21 PM   #9
rkelsen
Senior Member
 
Registered: Sep 2004
Distribution: slackware
Posts: 4,440
Blog Entries: 7

Rep: Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551
Quote:
Originally Posted by snowman81 View Post
It's like a puzzle.
Do I detect the subtle whiff of a HOMEWORK question?
 
Old 01-21-2008, 05:02 PM   #10
snowman81
Member
 
Registered: Aug 2006
Location: Michigan
Distribution: Ubuntu
Posts: 282

Original Poster
Rep: Reputation: 30
No, actually it's for a hacker challenge type website.
 
Old 01-21-2008, 05:04 PM   #11
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
So do I !
I have found 277 of these words, but I'm sure snowman81"s teacher expects better than brute force ...
 
Old 01-21-2008, 05:07 PM   #12
snowman81
Member
 
Registered: Aug 2006
Location: Michigan
Distribution: Ubuntu
Posts: 282

Original Poster
Rep: Reputation: 30
It's for the website www.hackthissite.org. Realistic mission 14.


So... anyway I can get one of those words?

Last edited by snowman81; 01-21-2008 at 05:16 PM.
 
Old 01-21-2008, 05:46 PM   #13
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
I like "niagara" (a cool CPU codename), otherwise "pancake" or "hotdogs" pass the test.
 
Old 01-21-2008, 05:51 PM   #14
snowman81
Member
 
Registered: Aug 2006
Location: Michigan
Distribution: Ubuntu
Posts: 282

Original Poster
Rep: Reputation: 30
Huh, maybe I just have bad luck picking words. Did you just choose random words?
 
Old 01-22-2008, 02:43 AM   #15
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
As I wrote, I used brute force. That means instead of trying to find a solution using some sort of logical approach, I slightly modified the C code for it to try every word from an English dictionary.

I quickly found 277 out of 109582 words were passing the test.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
zsnes && logitech dual action gamepad && dpad woes John5788 Linux - Games 5 10-29-2008 09:56 PM
AOL UK && BT Voyager 100 && Slackware 10.2 && RP-PPPoE pitt0071 Linux - Networking 3 01-17-2006 06:10 AM
Japanese canna won't work : Warning: &#12363;&#12394;&#28450;&#23383;&#22793;&am OrganicOrange84 Debian 3 06-30-2005 02:28 PM
Ph&#7909;c h&#7891;i d&#7919; li&#7879;u b&#7883; m&#7845;t???, c&#7913; pollsite General 1 06-27-2005 12:39 PM
in linux & c/c++: how do I convert an ascii string to utf8 & vice versa? davidh_uk Programming 2 02-06-2005 05:55 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:53 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration