Starting Programming Challenges

Put your programming skills to the test in these challenges.

Starting Programming Challenges

Post by sam_2108 on Tue Feb 08, 2011 11:31 pm
([msg=53299]see Starting Programming Challenges[/msg])

Hi,

This may sound dumb but i want to know how do you start the programming challenges. I have already completed challenge 1 successfully but the way i did it was copy the input string to my C program and den run the program. This method of copy paste usually takes a lot of time. I see that later programs have very small time and i can't copy paste everything in that time so there must be some other way in which you guys get the input to your programs. Can you please tell me how are you getting the input to your programs?
sam_2108
New User
New User
 
Posts: 4
Joined: Tue Feb 08, 2011 11:27 pm
Blog: View Blog (0)


Re: Starting Programming Challenges

Post by fashizzlepop on Tue Feb 08, 2011 11:40 pm
([msg=53300]see Re: Starting Programming Challenges[/msg])

Using the program to open the site, retrieve problem, solve, then submit.
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: Starting Programming Challenges

Post by sam_2108 on Tue Feb 08, 2011 11:45 pm
([msg=53301]see Re: Starting Programming Challenges[/msg])

Do u mean sockets? Please clarify
sam_2108
New User
New User
 
Posts: 4
Joined: Tue Feb 08, 2011 11:27 pm
Blog: View Blog (0)


Re: Starting Programming Challenges

Post by fashizzlepop on Wed Feb 09, 2011 12:36 am
([msg=53304]see Re: Starting Programming Challenges[/msg])

If you are using C, you should be able to just request the site through a function, not sockets necessarily. I'm not that great with C, in PHP, for example, I'd use cURL. Or in Perl, CookieJar and an HTTP request module.
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: Starting Programming Challenges

Post by sam_2108 on Wed Feb 09, 2011 1:05 am
([msg=53305]see Re: Starting Programming Challenges[/msg])

Thanks a lot for the info. I found a lib called libcurl which will assist me in the same. Off to understanding it :)

-- Thu Feb 10, 2011 2:07 am --

OK, i read cURL, even tried using it a couple of times but everytime the page fetched for challenge says - "You need to be logged on to use this". Am i doing something wrong. A push in right direction will be helpful. :(
sam_2108
New User
New User
 
Posts: 4
Joined: Tue Feb 08, 2011 11:27 pm
Blog: View Blog (0)


Re: Starting Programming Challenges

Post by Defience on Thu Feb 10, 2011 10:31 am
([msg=53353]see Re: Starting Programming Challenges[/msg])

Sounds like you need to handle your cookies.
User avatar
Defience
Addict
Addict
 
Posts: 1281
Joined: Thu Jun 12, 2008 3:16 pm
Blog: View Blog (0)


Re: Starting Programming Challenges

Post by fashizzlepop on Thu Feb 10, 2011 11:42 am
([msg=53354]see Re: Starting Programming Challenges[/msg])

Yes, HTS needs to know who you are in order to get the challenge, as well as submit it. Look up "cookiejar" and you will probably find something useful.
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: Starting Programming Challenges

Post by unterbuchse on Thu Feb 10, 2011 3:26 pm
([msg=53356]see Re: Starting Programming Challenges[/msg])

I wouldn't think that far. I mean you could do it that way but heres how i solved the time problem:

Just use the Clipboard. I mean set an event to the clipboard and then you only have to copy the input.
When copied to the Clipboard, your program solves the problem and writes it back to the clipboard. then you only have to press paste into the solution window and press enter to submit.
unterbuchse
New User
New User
 
Posts: 5
Joined: Thu Jan 27, 2011 10:07 pm
Blog: View Blog (0)


Re: Starting Programming Challenges

Post by Defience on Thu Feb 10, 2011 5:05 pm
([msg=53362]see Re: Starting Programming Challenges[/msg])

unterbuchse wrote:I wouldn't think that far. I mean you could do it that way but heres how i solved the time problem:

Just use the Clipboard. I mean set an event to the clipboard and then you only have to copy the input.
When copied to the Clipboard, your program solves the problem and writes it back to the clipboard. then you only have to press paste into the solution window and press enter to submit.


It's much easier and quicker to have your code do it for you, especially for challenges that only give you 3 seconds to complete. The goal isn't to just complete the challenges but to learn how to program.
User avatar
Defience
Addict
Addict
 
Posts: 1281
Joined: Thu Jun 12, 2008 3:16 pm
Blog: View Blog (0)


Re: Starting Programming Challenges

Post by unterbuchse on Thu Feb 10, 2011 5:48 pm
([msg=53364]see Re: Starting Programming Challenges[/msg])

I think its fast enough if you just press copy and have the solution in clipboard.
and of course its good to learn programming but its also important that you see different sides of a problem and choose the one that is good in performance and easy to use.
unterbuchse
New User
New User
 
Posts: 5
Joined: Thu Jan 27, 2011 10:07 pm
Blog: View Blog (0)


Next

Return to Programming

Who is online

Users browsing this forum: No registered users and 0 guests