User Control Panel
Advertisements

HELP US, HELP YOU!

Programming challenge

 
Post new topic   Reply to topic    Bot Depot Forum Index -> Programming Challenges and AI thoughts
View unanswered posts
Author Message
Mojave
Almost An Agent
Almost An Agent


Joined: 01 Nov 2003
Posts: 1434

Reputation: 66.4

PostPosted: Wed Mar 16, 2005 7:37 pm    Post subject: Reply with quote

Dazzy reminded me of a study I read about last year (don't know when the actual study was done though) about how we humans can understand words and sentences even when the letters in the words are randomly sorted. But as I remember the study, the first and last letter of each word need to be in their proper place.

Code:
did you konw taht it dosne't mtaetr waht oerdr you put yuor ltetres in? Aoccdrnig to rscheearch at an Elingsh uinervtisy, tath's bcuseae we do not raed ervey lteter by ilstef, but the wrod as a wlohe. Taht mneas you dno't hvae to wrory aobut tipnyg erorrs druing Intsnat Measgisng, jsut as lnog as all the lettres are tehre!


But if the letters are completely random, it makes reading it much harder. Anyway, the idea I am posting about is more of a challenge: write a Perl script that can convert any string of text (it should be somewhat long like the above) into a completely word-random string and into a first/last letter same word-random string. So basically, you would have functions like:

Code:
my $rand1 = &randomize1( 'birds have wings and feathers' );<br /># would return something like "brdis hvae wgins and feerahts'<br /><br />my $rand2 = &randomize2( 'birds have wings and feathers' );<br /># would return something like "srdib evha sniwg dan esfrahte'


Then the question is can you understand the second one as well as the first? Besides that, it's a fun programming challenge. Razz

EDIT: I realize for some of you this is a fairly easy challenge. If you do it, maybe you shouldn't post right away and let others have a chance.
Back to top
Cer
Upgraded Agent
Upgraded Agent


Joined: 03 Feb 2004
Posts: 3776
Location: Michigan
Reputation: 146.9
votes: 4

PostPosted: Wed Mar 16, 2005 7:49 pm    Post subject: Reply with quote

I gotcha:

Quote:
Kirsle: !screnglish birds have wings and feathers
CodyCKS: bdris hvae wgins and faretehs

Kirsle: !screnglish birds have wings and feathers<->left
CodyCKS: sidrb evah sgniw dna shaeterf


Command's usage:
!screnglish sentence<->left|right
(right is default if omitted)

edit code omitted, gonna give other people a chance first Wink

_________________
Current Site (2008) http://www.cuvou.com/
Back to top
Dazzy
Agent
Agent


Joined: 09 Jan 2004
Posts: 1731

Reputation: 72.3

PostPosted: Wed Mar 16, 2005 8:02 pm    Post subject: Reply with quote

Quote:
Daz says:
!mix this script proves that the first is easier to read
Evolution (Beta 0.9) says:
>>With the first and last kept normal :
tihs sciprt pvoers taht the fsrit is esaier to raed
>>With all jumbled:
tish isrptc rpsoev that the srfit si seriea to reda

Which is easier to read?



Smile not bad...
Back to top
Mojave
Almost An Agent
Almost An Agent


Joined: 01 Nov 2003
Posts: 1434

Reputation: 66.4

PostPosted: Wed Mar 16, 2005 8:05 pm    Post subject: Reply with quote

Cool, I knew some people would build it quickly. And it looks like making it a command or maybe a cgi can prove that you got it to work without having to post your code.
Back to top
mat007
Almost An Agent
Almost An Agent


Joined: 12 Jan 2004
Posts: 1375

Reputation: 15.8Reputation: 15.8
votes: 2

PostPosted: Wed Mar 16, 2005 8:28 pm    Post subject: Reply with quote

hehe

Quote:
[Matthew :: Jo0] - [My two new fans seem to be doing a good job  ] says:
!mix birds have wings and feathers
extraBOT :: [ Version 2.2b ] says:
bsird hvea gwnsi dan eftahres
Back to top
Cer
Upgraded Agent
Upgraded Agent


Joined: 03 Feb 2004
Posts: 3776
Location: Michigan
Reputation: 146.9
votes: 4

PostPosted: Wed Mar 16, 2005 8:31 pm    Post subject: Reply with quote

The REAL challenge now, is to get it so you can say "bdris hvae wgins and faretehs" to your bot, and have the bot know you what you really said. Wink
_________________
Current Site (2008) http://www.cuvou.com/
Back to top
Mojave
Almost An Agent
Almost An Agent


Joined: 01 Nov 2003
Posts: 1434

Reputation: 66.4

PostPosted: Wed Mar 16, 2005 8:32 pm    Post subject: Reply with quote

Mat007, you need to include the version that keeps the first and last letter of each word the same.
Back to top
Dazzy
Agent
Agent


Joined: 09 Jan 2004
Posts: 1731

Reputation: 72.3

PostPosted: Wed Mar 16, 2005 9:06 pm    Post subject: Reply with quote

QUOTE(Mojave @ Mar 16 2005, 08:32 PM)
Mat007, you need to include the version that keeps the first and last letter of each word the same.
[right][snapback]46963[/snapback][/right]



Yeah, thats the easiest bit... Wink
Back to top
Cer
Upgraded Agent
Upgraded Agent


Joined: 03 Feb 2004
Posts: 3776
Location: Michigan
Reputation: 146.9
votes: 4

PostPosted: Wed Mar 16, 2005 9:19 pm    Post subject: Reply with quote

QUOTE(Dazzy @ Mar 16 2005, 04:06 PM)
QUOTE(Mojave @ Mar 16 2005, 08:32 PM)
Mat007, you need to include the version that keeps the first and last letter of each word the same.
[right][snapback]46963[/snapback][/right]



Yeah, thats the easiest bit... Wink
[right][snapback]46964[/snapback][/right]


Yeah, just pop and shift them off before you scramble the letters around and then put it back together. Razz

_________________
Current Site (2008) http://www.cuvou.com/
Back to top
Dazzy
Agent
Agent


Joined: 09 Jan 2004
Posts: 1731

Reputation: 72.3

PostPosted: Wed Mar 16, 2005 9:22 pm    Post subject: Reply with quote

I didnt use any shifts Razz


On the bit where it keeps it constant i split, found the bits i wanted to stay the same then shuffeled the rest....
You're is probbally shorted....
Back to top
Mojave
Almost An Agent
Almost An Agent


Joined: 01 Nov 2003
Posts: 1434

Reputation: 66.4

PostPosted: Wed Mar 16, 2005 9:39 pm    Post subject: Reply with quote

This not posting code restriction has you guys talking about code and the methods you used which is really good for new programmers and to circulate ideas. Very Happy
Back to top
Dazzy
Agent
Agent


Joined: 09 Jan 2004
Posts: 1731

Reputation: 72.3

PostPosted: Wed Mar 16, 2005 9:45 pm    Post subject: Reply with quote

Yeah, its bought a buzz back to the forum Very Happy
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Bot Depot Forum Index -> Programming Challenges and AI thoughts All times are GMT
Page 1 of 1

 



Protected by phpBB Security phpBB-TweakS
phpBB Security Has Blocked 9 Exploit Attempts.
Antispam Captcha Mod by phpbb-security.com
Powered by phpBB © 2001, 2005 phpBB Group