Programming 1

Put your programming skills to the test in these challenges.

Re: Programming 1

Post by aNtiXXX on Sun Feb 20, 2011 9:17 pm
([msg=53947]see Re: Programming 1[/msg])

Tried this out in c#. I first stored the word list in an array, then made an input text file and stored that in an array as well. I used one method to replace the # with a "" and then trimmed each string by iterating through the input. My other method simply made each word a char array in alphabetical order and test against each string with the same length to see if chars matched. I copied the scrambled words into the input text file, then I ran the program to send output to a text file on my desktop and copied the result from it. Took about 17 second total. Hope this helps out without giving away too much. I also tried the ascii value approach someone mentioned in the thread earlier as well and had success with that as well.There certainly are better ways to do it as should there be something like "olop" it could be either "pool" or "loop" if they were both in a word list,as by my method the program would see ("loop"=="loop") as that is alphabetical ,but I guess I haven't figured it out yet.
aNtiXXX
New User
New User
 
Posts: 2
Joined: Sun Feb 20, 2011 8:59 pm
Blog: View Blog (0)


Re: Programming 1

Post by fashizzlepop on Sun Feb 20, 2011 10:30 pm
([msg=53952]see Re: Programming 1[/msg])

Since it's an anagram, oolp would be equal to loop and pool. Either one would be a correct answer. In this challenge, however, you will not have to worry about overlaps like that.
The glass is neither half-full nor half-empty; it's merely twice as big as it needs to be.
User avatar
fashizzlepop
Developer
Developer
 
Posts: 2303
Joined: Sat May 24, 2008 1:20 pm
Blog: View Blog (0)


Re: Programming 1

Post by aNtiXXX on Mon Feb 21, 2011 12:18 pm
([msg=53992]see Re: Programming 1[/msg])

Ahh true,thanks man. It's funny I didn't think of it because I started using some of my code from this to make an anagram solver for my phone hah. I guess I just forgot there's not always just one right answer. :D
aNtiXXX
New User
New User
 
Posts: 2
Joined: Sun Feb 20, 2011 8:59 pm
Blog: View Blog (0)


Re: Programming 1

Post by fashizzlepop on Tue Feb 22, 2011 4:23 am
([msg=54043]see Re: Programming 1[/msg])

In a way, it relates to insecure "hashes" or encryption. a = 2, b= 4, c = 6.

cababc -> 24 -> aabbcc, ababcc, etc. So: hash(aabbcc) == hash(ababcc)

Just thought that was worth bringing up.
The glass is neither half-full nor half-empty; it's merely twice as big as it needs to be.
User avatar
fashizzlepop
Developer
Developer
 
Posts: 2303
Joined: Sat May 24, 2008 1:20 pm
Blog: View Blog (0)


Re: Programming 1

Post by Sawny1337 on Sat Mar 12, 2011 7:07 am
([msg=54961]see Re: Programming 1[/msg])

yay! I did it! :)

I used PHP for this one.
regexp and preg_match can be a tip ;)

My program find the words on 0.001270055770874 seconds :D

But i needed to run it like 10 times before it give me all correct answers. I think i have some bug that give me wrong
word sometimes..
Sawny1337
New User
New User
 
Posts: 7
Joined: Sat May 08, 2010 2:56 am
Blog: View Blog (0)


Re: Programming 1

Post by ibdwnm on Wed Apr 06, 2011 1:37 pm
([msg=56030]see Re: Programming 1[/msg])

Always when I try to program something it becomes obscure shit and doesn't work (using Haskell)...
http://pastebin.com/zpJu3MaG
Wanted to put everything in lists (didn't do that in the code), compare the ordered ones; but the problem is finding the normal ones belonging to the ordered ones...
ibdwnm
New User
New User
 
Posts: 5
Joined: Wed Apr 06, 2011 1:22 pm
Blog: View Blog (0)


Re: Programming 1

Post by fattommy89 on Mon Apr 11, 2011 8:59 pm
([msg=56259]see Re: Programming 1[/msg])

Sawny1337 wrote:yay! I did it! :)

I used PHP for this one.
regexp and preg_match can be a tip ;)

My program find the words on 0.001270055770874 seconds :D

But i needed to run it like 10 times before it give me all correct answers. I think i have some bug that give me wrong
word sometimes..


There is no bug. Some of the words in there were strategically placed to necessitate more specific code. I have something else to add but I'm not sure if it's a spoiler, so for now I'll leave you with that.
fattommy89
New User
New User
 
Posts: 8
Joined: Wed Jan 26, 2011 8:19 pm
Blog: View Blog (0)


Re: Programming 1

Post by Bazukero on Thu Apr 14, 2011 9:02 pm
([msg=56351]see Re: Programming 1[/msg])

Hi, guys. I'm new to HTS.

This mission, at first I tried to program in c++, but I have some problems.
So I tried with python. Than it worked :D
Input :tarsti
elaskr
isropco
rreefe
esewlh
teganr
croces
inesyld
ecixom
llatfobs

Output: artist,lakers,scorpio,reefer,wheels,garnet,soccer,lindsey,mexico,softball

But I really want to learn C/C++ and I won't be satisfacted while I don't understand how to do it in C/C++. Could anyone that used C/C++ help me out?
Bazukero
New User
New User
 
Posts: 14
Joined: Thu Apr 14, 2011 8:56 pm
Blog: View Blog (0)


Re: Programming 1

Post by Ellie0815 on Wed Jul 06, 2011 11:18 am
([msg=59502]see Re: Programming 1[/msg])

Hi everyone

Im stuck at fetching the scrambled words from the page. If I try to get the scrambled words it returns the whole sourcecode (which is desired. Yes I know its not a good style but the easiest way for me) but it says "You have to be logged in [...]" So my next step would be to write something that logs me in first but I have no idea how to. The 'unscrambler' works (0.005 seconds for the whole script with 1 word. Yes again not good but it works) I just have a problem with fetching the scrambled words. Im using Ruby btw.

Thanks a lot for hints


EDIT EDIT EDIT

Main problem solved. New problem ahead.

My program now logs in, fetches the words, processes them and SHOULD put the final string to the submit form. The problem is that it actually sends the string to the form but there are problems with the quotes. I cant figure out how to NOT send the quotes that delimit the string to the form.
Last edited by Ellie0815 on Wed Jul 06, 2011 5:09 pm, edited 1 time in total.
Ellie0815
New User
New User
 
Posts: 2
Joined: Tue Jul 05, 2011 6:41 pm
Blog: View Blog (0)


Re: Programming 1

Post by mShred on Wed Jul 06, 2011 12:04 pm
([msg=59503]see Re: Programming 1[/msg])

Ellie0815 wrote:Hi everyone

Im stuck at fetching the scrambled words from the page. If I try to get the scrambled words it returns the whole sourcecode (which is desired. Yes I know its not a good style but the easiest way for me) but it says "You have to be logged in [...]" So my next step would be to write something that logs me in first but I have no idea how to. The 'unscrambler' works (0.005 seconds for the whole script with 1 word. Yes again not good but it works) I just have a problem with fetching the scrambled words. Im using Ruby btw.

Thanks a lot for hints

You could always copy and paste into the script? You don't necessarily need to fetch anything from the page. This mission is just to get your feet wet.
Image

For those about to rock.
User avatar
mShred
Administrator
Administrator
 
Posts: 1766
Joined: Tue Jun 22, 2010 4:22 pm
Blog: View Blog (2)


PreviousNext

Return to Programming

Who is online

Users browsing this forum: No registered users and 0 guests