FAQ  •  Login

Level 4

Moderators: UncleTimmy, mjpieters

Enjoying the challenge? Need a hint?
Make a donation and help keep the site running! -thesamet
<<

martix

Posts: 4

Joined: Mon May 12, 2008 11:24 am

Post Sun Sep 07, 2008 1:51 pm

I did pass the level after some problems and conceptual failures.
I doubt anyone has even used my method before - that being JavaScript :P Didn't put a counter, but it did run for about 3 mins or so...
<<

boris

Posts: 2

Joined: Mon Nov 03, 2008 2:31 pm

Post Mon Nov 03, 2008 3:33 pm

thesamet wrote:... start from 51350 ...

Hehe! Thank you. ;)

BTW, the next link is 69 loops after 51350.
<<

swapnilka

Posts: 2

Joined: Tue Feb 10, 2009 12:58 pm

Post Tue Feb 10, 2009 1:00 pm

now what?

i already got "Divide by two and keep going" this reply ...
well i implemented it still 10 min no response...!!
Some times i get IOSocket error.... which which is bcoz of my internet problems.....!!......
Shall i keep waiting or change direction of code ????
<<

swapnilka

Posts: 2

Joined: Tue Feb 10, 2009 12:58 pm

Post Sat Feb 14, 2009 5:37 pm

Yes....!!
Finally got it .....!!
Silly mistake .....!!
but was a fun ..!!
<<

kryptobs2000

Posts: 2

Joined: Tue Apr 14, 2009 11:29 am

Post Tue Apr 14, 2009 11:38 am

I don't get it

I just can't figure this one out.

I keep putting in the next nothing until I get to divide by 2. I then divide the next nothing by 2, enter it, then continue entering the next nothings not dividing by 2. Eventually I get into a loop.

I also get into a loop if I divide the number before divide by 2 and enter it in.
I get into a loop if I keep dividing the next nothings after divide by 2 by 2.
I get into a loop if I never divide by 2

So now I'm just scanning every number possible starting at 1 and printing if I get something other than 'and the next nothing is' because I'm out of ideas. What else have I not tried?

edit: n/m, I just kept passing over the answer and not realizing it.
<<

cwheit

Posts: 1

Joined: Tue Oct 13, 2009 2:06 pm

Post Tue Oct 13, 2009 2:09 pm

Freakbuffet18 wrote:Hey, does anyone know if there a way to do this one with visual basic, thats the only language i know in any substantial amount so far... i'm not sure how to get the number from the page to the url yet...


You'll need to use System.Net and the HttpWebRequest if you want to use VB. But try to learn the Python, you'll need it for the next challenge.
<<

horacc

Posts: 2

Joined: Tue Dec 15, 2009 9:56 am

Post Wed Jan 20, 2010 1:27 pm

Re: Level 4

Hi,
I have been trying to get the solution for this one, got the divide by 2 and keep going. altho I got a total of 400 numbers, I tried to use the 400th number as the solution and even the 399th number as address/<number>.html or even .php and doesnt seem to work.

dont know what I havent read or figure out to complete the problem. Comments?
<<

horacc

Posts: 2

Joined: Tue Dec 15, 2009 9:56 am

Post Fri Jan 22, 2010 7:42 am

Re: Level 4

what happened is that I though the divide by 2 was in a fixed position, but it wasnt, looks like every time follow the link it goes to different numbers but it always reach the same end

better to manually set up the new number or a regex to recognize the phrase.

regards and keep going!
<<

Lord Soahc

Posts: 1

Joined: Mon Feb 08, 2010 10:45 pm

Post Wed Feb 10, 2010 5:51 pm

Re: Level 4

I attempted this problem using version 3.1.1 of python how ever i think there must be a bug because the code line i get the following error. end="".join (re.findall (r"nothing is (\d+)",text))
File "/usr/lib/python3.1/re.py", line 192, in findall
return _compile(pattern, flags).findall(string)
TypeError: can't use a string pattern on a bytes-like object

how ever this same code ran on a previous version of python worked perfectly. i used version 2.6 to make it work. is there a way to get this to work using version 3.1.1?
<<

taralluccio

Posts: 11

Joined: Wed Feb 18, 2009 7:00 am

Location: Bergamo, Italy

Post Wed Feb 17, 2010 4:41 pm

Re: Level 4

Python3 won't allow you to mix bytes and string data.

If text contains bytes data, you should decode it with
  Code:
text.decode('ascii')
<<

iAreNubcake

Posts: 2

Joined: Mon Mar 29, 2010 12:47 am

Post Mon Mar 29, 2010 12:50 am

Re: Level 4

Well, as the hint suggested, I'm trying to use urllib. However, I've got a problem...
  Code:
'module' object has no attribute 'urlopen'

I am importing urllib (as you could probably guess since' it is acknowledging that it is a module), and yet I cannot use it...

Any ideas? Thanks. :)
<<

iAreNubcake

Posts: 2

Joined: Mon Mar 29, 2010 12:47 am

Post Mon Mar 29, 2010 1:05 am

Re: Level 4

Fixed that last thing: it was my own stupidity... >.> For future reference, don't name your file the same name as a library you're importing IN the file...

I think I've got this now... just gotta wait for things to finish what they are doing I guess. :)
<<

sudo

Posts: 4

Joined: Mon Apr 12, 2010 7:56 am

Post Wed Apr 14, 2010 4:26 am

Re: Level 4

It's easier in retrospect!

My hint for you: split each next nothing
<<

mark

Posts: 1

Joined: Thu Apr 22, 2010 9:29 am

Post Thu Apr 22, 2010 9:33 am

Re: Level 4

I have gotten into an infinite loop after dividing by 2.
I print out the entire read from the url, I also print out what value I parse (using re) from that text.
I have read every line up to 400 and I can not find where I am going wrong. This infinite loop is killing me!
<<

gull_kins

Posts: 2

Joined: Mon Apr 16, 2012 6:00 am

Post Mon Apr 16, 2012 6:11 am

Re: Level 4

Hi. I've written pretty little script which can go through pages, one by one. Maybe I just have to wait (30, 40, 60 minutes) and let it do its job, but it doesn't look optimally. How did you solve this problem? Is there any better way?
PreviousNext

Return to Python Challenge Hints

Who is online

Users browsing this forum: Google [Bot] and 7 guests

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.