hacker.org Forum Index
RegisterSearchFAQMemberlistUsergroupsLog in
Teach me how to hack this puzzle
Goto page Previous  1, 2
 
Reply to topic    hacker.org Forum Index » Runaway Robot Puzzle View previous topic
View next topic
Teach me how to hack this puzzle
Author Message
CodeX



Joined: 17 Oct 2008
Posts: 350

Post Reply with quote
if looking at it as it is doesn't work anymore, try looking for underlying patterns which you can use to solve it
Sat Feb 13, 2010 5:47 pm View user's profile Send private message
laz0r



Joined: 04 Feb 2010
Posts: 290
Location: Within the depths of Unix

Post found the approach! Reply with quote
It's ok, I worked it out! Very Happy

I think that everyone who is above level 500 must have used the same approach.... and it didn't get noticlably slower either! (though simply writing those massive grids to the screen took a while!)

_________________
There is no spoon.
Mon Feb 15, 2010 10:00 am View user's profile Send private message
outboundglitch



Joined: 15 Apr 2010
Posts: 2
Location: registry editor

Post writing software Reply with quote
to me writing software is a pain, the programming language i use is BATCH, thats how bad i am at programming, i suck at it, Embarassed but i did make a batch file with login page, remote connection shutdown along with notepad, pop up maker, folder factory, it didn't take long. Razz but thats the best i can do, anyone have any tips for me on writing software, or choosing the most easiest one? plz and thank you.

_________________
i wish to learn more about computers, i'm not a noob at computer hacking but i wish to learn more. i know how to hack/crack/bypass but still i feal like i dont know enouph, i know some but wish to know all Smile
Thu Apr 15, 2010 5:11 am View user's profile Send private message Visit poster's website
Karian



Joined: 09 Jan 2008
Posts: 75

Post Reply with quote
If you want to do some more programming, the easiest way is just to pick a language and play around with it. Take something that suits you, and find a tutorial for it online. People can discuss for days which is the best language to take, but for learning how to program, it is more or less the same. Once you know how to program, it is not that hard anymore to learn a new language.
Thu Apr 15, 2010 1:37 pm View user's profile Send private message
outboundglitch



Joined: 15 Apr 2010
Posts: 2
Location: registry editor

Post Reply with quote
wow, thank you for the info. ill look around right now. Very Happy

_________________
i wish to learn more about computers, i'm not a noob at computer hacking but i wish to learn more. i know how to hack/crack/bypass but still i feal like i dont know enouph, i know some but wish to know all Smile
Fri Apr 16, 2010 3:21 am View user's profile Send private message Visit poster's website
Masti6



Joined: 15 May 2010
Posts: 55
Location: Finland, Nurmes

Post Reply with quote
gfoot wrote:
It's pretty easy in most modern languages. e.g. in Python 2:

Code:

import urllib
pagedata = urllib.urlopen("http://www.hacker.org").read().splitlines()


That should give you an array of lines.

In Python 3 it's been moved around a bit - I think you need:

Code:

import urllib.request
pagedata = urllib.request.urlopen("http://www.hacker.org").read().splitlines()


But I don't have Python 3 installed, so I can't check it for sure.

Once you've got the data you'll have to parse it to extract useful things like the board size and contents, then write the fun bit of your code that figures out a good route.

It's actually probably better to do the fun bit first, though, so you can make test boards locally without having to wait for web requests from time to time. All my hacker.org solvers support this, and cache any downloads locally as well so I can replay them later - it's good to have some smaller boards available when you're profiling an algorithm and want faster results.

Quote:

data = urllib.urlopen("http://www.hacker.org").read().splitlines()
AttributeError: 'module' object has no attribute 'urlopen'

and
Quote:
import urllib.request
ImportError: No module named request

Python Version 2.6.5
Why ain't it working :(
Could you try to post a working code for getting data, and to read it, to use it, ... etc.
It would be good if you sent a copy of the file you used for the "Dungeon Master" so I could see what kind of approach I should take. I do not feel like asking for straight answers, but as I have no idea, and the tutorials out there ain't telling me the working answer either, could you?
Megafile works just fine, or paste the Python code in Pastebin.com and send me a link.
P.S.
Pretty please?
Mon May 17, 2010 10:46 am View user's profile Send private message MSN Messenger
nighthalk



Joined: 31 Jul 2009
Posts: 41

Post Reply with quote
heres a C# implimentation its for crossflip but its easy to modify for any of them, i obviously edited out stuff to make sure you get practice. i only provided necisary parts for the web interaction. technically i also changed the username password to be seperate strings im not entirly sure if it lets you build a static string dynamicly but i wanted it obvious you were suposed to put something there.

Code:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
using System.IO;
namespace crossflipsolver
{
    class Program
    {
        static string username="yourusername"
        static string password="yourpassword"
        static string baseurl = "http://www.hacker.org/cross/?name="+username+"&      password="+password
        static void Main(string[] args)
        {
            HttpWebRequest myrequest = (HttpWebRequest)WebRequest.Create(baseurl);
            myrequest.Method = "GET";
            WebResponse myresponse = myrequest.GetResponse();
            StreamReader sr = new StreamReader(myresponse.GetResponseStream(), System.Text.Encoding.UTF8);
            string result = sr.ReadToEnd();
            puzzle = parseweb(result);
        }
        static string parseweb(string input) {
            //put your parsing code here,
        }
    }
}


i also have a c++ implimentation but it spans like 12 files because i downloaded a library to do it for me... you may find one that may work at

http://www.cplusplus.com/src/
Mon May 24, 2010 6:08 pm View user's profile Send private message
Wooshee



Joined: 27 Jul 2013
Posts: 2

Post how to become a hacker Reply with quote
MerickOWA wrote:
Learn how to write a program? pick your favorite language java,c,c++,c#,ruby,python,lisp and learn how to download webpages in that language, and parse out of the html the maze data.

After that, you have to figure out how you want to solve the problem. The simplest method (but the longest) is to just search through all possible answers until you find an answer that solves the problem. (try each instruction length, and each combination of down(s) and right(s) until your robot makes it to the edge).

However, I don't think you'll get to level 513 with that method. You can either work on ways of speeding up your searching techniques and/or simplifying the problem so there are fewer possibilities to search.


Hi what book should i Begin with in order i can become a hacker please?

Sun Jul 28, 2013 6:17 am View user's profile Send private message ICQ Number
Wooshee



Joined: 27 Jul 2013
Posts: 2

Post Re: how to become a hacker Reply with quote
Wooshee wrote:
MerickOWA wrote:
Learn how to write a program? pick your favorite language java,c,c++,c#,ruby,python,lisp and learn how to download webpages in that language, and parse out of the html the maze data.

After that, you have to figure out how you want to solve the problem. The simplest method (but the longest) is to just search through all possible answers until you find an answer that solves the problem. (try each instruction length, and each combination of down(s) and right(s) until your robot makes it to the edge).

However, I don't think you'll get to level 513 with that method. You can either work on ways of speeding up your searching techniques and/or simplifying the problem so there are fewer possibilities to search.


Hi what book should i Begin with in order i can become a hacker please?


thanks for u help and how i can get these programming languages?
Sun Jul 28, 2013 2:17 pm View user's profile Send private message ICQ Number
Lilchen



Joined: 20 Jul 2013
Posts: 1

Post Reply with quote
Quote:

thanks for u help and how i can get these programming languages?


Perhaps, i'm unfriendly.. But

Try out:
http://lmgtfy.com/?q=java+for+beginners

or:

http://lmgtfy.com/?q=python+for+beginners


greetings
Thu Aug 08, 2013 8:23 pm View user's profile Send private message
Display posts from previous:    
Reply to topic    hacker.org Forum Index » Runaway Robot Puzzle All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.