iSylence's forum posts

#1 Posted by iSylence (345 posts) -

I use Vim. Occasionally gedit.

#2 Posted by iSylence (345 posts) -

Not sure if this has already been pointed out, I had a look but I couldn't see if anyone else had posted it.

You can download the soundtrack for free from http://www.thinkwithportals.com/music.php

It's very good, I have been enjoying it thoroughly. I can't wait to be finished with University so I can play the game again! In 2 weeks time I be finished with a degree with Honours in Computer Science, yay! Got a job lined up as well, yay again!

Just an insight in to my life there, anyways enjoy!

#3 Posted by iSylence (345 posts) -

Changed. Used to be DrFreeman. Reeeeeeeally original name that was.

#4 Posted by iSylence (345 posts) -

I like the interns.

#5 Posted by iSylence (345 posts) -

You're right it would be cool, but you're also right in assuming it's been discussed before. I think I remember them talking about it on the bombcast at one point and they said that it was just too much content to manage in their databases, as well as the fact that there's already sites purely for videos which do it way better. Like youtube for example. :)

#6 Posted by iSylence (345 posts) -

Gah I just get here and it's answered already. Next time maybe post a small snippet of code to help people understand your situation. :)

#7 Posted by iSylence (345 posts) -

I need this.

#8 Posted by iSylence (345 posts) -
@example1013: Yeah I'm the same, when I'm learning a new language I like to have a few examples to go from to see how it differs from others.

@proggykins: I've put two ways on here as I'm sure you've seen. The second is much more elegant and will only tell them "oops" once for every time they click the button having exceeded their max attempts. The former will give them an infinite loop of "oops" which is bad code. If your lecturer wants that he's crazy and you should just submit the second one (with alerts for errors in it, sorry I commented those out).
#9 Posted by iSylence (345 posts) -
@takua108: It was because I was just leaving that part of his code. He said he wanted a while loop which did that. I was going to reply to that and say he just wants an if at the top just below the variables like this:

if(attempts>=3){
alert("oops");
return false;
}
   
I wrote out the code again and was trying to find a nice way to post it on here so that the formatting wouldn't get screwed up when I moved it from Notepad++ but I can't be bothered. I'll just post it messy again.

#10 Posted by iSylence (345 posts) -

This is what you want.



Things I changed: 
  • Put the attempts outside of the function to make it a global variable.
  • Put an if statement at the end so it will only increment once if at any point in the code returnValue was set to False. The way it was originally they could potentially get stuck in the loop after 1 attempt to log in.
  • Send an alert to let the user know how many attempts have been made.

I really shouldn't just give the answers, but whatever.