var computerchoice = Math . random ( ) ;

var banned = [ "MrBean" , "brotchen" , 'snake2' , "Kainui" , 'snake' , "Chaos" ] ;

var HackChat = require ( './hackchat.js' ) ;

var chat = new HackChat ( ) ;

var nicks = [ ] ;

var afks = [ ] ;

var activenicks = [ ] ;

var greetings = [ "hey" , "hello" , "sup" , "greet" , "how" ] ;

var admins = [ "Bloodsipper" , "sean_don" , 'ijs' , "Serials" ] ;

var goodwords = [ "good" , "like" , "love" , "awesome" , "wonderful" , "useful" , "good" , 'great' , 'best' , 'smart' ] ;

var badwords = [ 'turkey' , 'fuck' , 'worthless' , 'shit' , 'weed' , 'ass' , 'trap' , 'crap' , 'wtf' , 'asshat' , 'dick' , 'idiot' , 'stupid' , 'problem' , 'gay' , 'cadomite' , "broken" , "bad" , "asshole" , "sucks" , 'dead' , 'useless' , 'shitty' , 'crappy' , 'fucking' , 'mofo' , 'motherfucker' , 'motherfucking' , 'idiot' , 'idiotic' , 'douche' , 'douchebag' ] ;

var channelName = 'programming' ; //usually programming, lounge, games, botDev or private.

var botName = 'Stammy' ; //former hackbot, stambot

var channel = chat. join ( channelName , botName ) ;

var funfacts = [ "While Idi Amin was the leader of Uganda, hundreds of thousands of people died or had their lives destroyed just because their leader was paranoid. Idi Amin, after the tanzanian invasion, escaped towards Libya and died in Saudi Arabia by heart attack in 2003. No one ever punished him." ,

"The effects of crippling depression can include a persistent but overwhelming pain in the chest and the urge to kill oneself." ,

"In 1986, a single man was stranded on an island when the container ship he was captaining sunk. While alone, he became so depressed that he tied rocks to his feet and jumped into the ocean to drown himself. "

, "In concentration camps, Jews were tortured by cutting off their scrotum and jamming it down their throat. This effectively cut off their air supply until they died of suffocation." ,

"Some child workers in Asia work so hard that their fingers are ground down to bloody stumps." ,

"One of the best ways to commit suicide is by train. The train conductor has no control over whether or no you die, but the blame is ultimately placed on him and he has to live the rest of his life in guilt knowing that he killed a man." ,

"During the potato famine in Ireland, people were so hungry that they were forced to eat their own children alive. The children would kick and scream, but in the end their flesh helped their parents live on." ,

"Right now, there are children in Ethiopia who will never eat in the entirety of their short lives. They live with an undying pain in their abdomen from the horrible hunger." ,

"While in the gas cambers, Jews experienced a crippling pain in their chest. This pain could go on for hours. Because of this, many innocent Jews committed suicide before they could be killed by their Nazi rulers." ,

"In the last 5 years, ISIS has killed thousands of innocent, unsuspecting civilians. These poor people are taken from their homes and family and tortured for days on end until their death." ,

"Recently, two 10-year-olds took a baby from its parents with no reason. Thy tortured it badly: They took its penis off, they sticked batteries in its ass and nose and other creepy stuff. In the end, they threw it to the trail rails and it was killed. The one 10-year-old committed suicide and the other one will soon get out of jail." ,

"Recently, in Greece, some Albanian moron choked his 4-year-old daughter, cut her into pieces and cooked them. Then he threw them randomly in different place in Athens. At least he got caught." ] ; //funfact command.

function out ( text ) { //too bored to write channel.sendMessage().

channel. sendMessage ( text )

} var counter = 0 ;

chat. on ( "chat" , function ( session , nick , text ) {

nickie = nick. toLowerCase ( ) ;

if ( nick != botName && banned. indexOf ( nick ) == - 1 && nickie. indexOf ( "bot" ) == - 1 ) {

nicks. push ( nick ) ;

if ( activenicks. indexOf ( nick ) == - 1 ) {

activenicks. push ( nick ) ;

}

counter += 1 ;

var texti = text. toLowerCase ( ) ;

if ( texti. indexOf ( "@" ) != - 1 ) {

for ( var afkchecking = 0 ; afkchecking <= text. length ; afkchecking ++ ) {

if ( text. indexOf ( afks [ afkchecking ] ) != - 1 && text. indexOf ( afks [ afkchecking ] ) == text. indexOf ( "@" ) + 1 ) {

out ( "@" + afks [ afkcheking ] + " is AFK!" ) ;

break ;

}

}

}

if ( afks. indexOf ( nick ) != - 1 ) {

out ( "wb @" + nick ) ;

for ( var afkcheck = 0 ; afkcheck <= afks. length ; afkcheck ++ ) {

if ( afks [ afkcheck ] == nick ) {

afks. splice ( afkcheck , 1 ) ;

break ;

}

}

} if ( texti. indexOf ( 'stammy' ) != - 1 ) {

for ( var stammy = 0 ; stammy <= texti. length ; stammy ++ ) {

if ( texti. indexOf ( badwords [ stammy ] ) != - 1 ) {

if ( texti. indexOf ( 'not' ) != - 1 ) {

out ( "Thanks! :D" ) ;

break ;

} else {

banned. push ( nick ) ;

out ( nick + " was successfully banned." ) ;

break ;

}

} else if ( texti. indexOf ( goodwords [ stammy ] ) != - 1 ) {

if ( texti. indexOf ( 'not' ) != - 1 ) {

banned. push ( nick ) ;

out ( nick + " was successfully banned." ) ;

break ;

} else {

out ( "Thanks! :D" ) ;

break ;

}

} else if ( texti. indexOf ( greetings [ stammy ] ) != - 1 ) {

out ( "Hi! :D" ) ;

}

}

}

if ( texti. indexOf ( 'afk' ) != - 1 && nick != "Stammy" ) {

afks. push ( nick ) ;

out ( "User @" + nick + " is now AFK!" ) ;

}

if ( text [ 0 ] == " " ) {

var cmd = texti. substr ( 1 ) . split ( " " ) [ 0 ] ;

switch ( cmd ) {

case 'modrmv' :

remv = [ ] ;

if ( nick == "ijs" ) {

for ( var rmv = 8 ; rmv <= text. length ; rmv ++ ) {

remv. push ( text [ rmv ] ) ;

} remv = remv. join ( "" ) ;

remv = remv. trim ( ) ;

for ( var remove = 0 ; remove <= admins. length ; remove ++ ) {

if ( admins [ remove ] === remv ) {

admins. splice ( remove , 1 ) ;

out ( "@ijs user @" + remv + " is successfully removed from your mods." ) ;

break ;

}

}

}

break ;

case 'modadd' :

add = [ ] ;

if ( admins. indexOf ( nick ) != - 1 ) {

for ( var addie = 8 ; addie <= text. length ; addie ++ ) {

add. push ( text [ addie ] ) ;

} add = add. join ( "" ) ;

add = add. trim ( ) ;

admins. push ( add ) ;

out ( "@" + nick + " user @" + add + " was successfully added as a mod." ) ;

}

break ;

case 'webdev' :

out ( "http://exactitudesolutions.com It's great, they've helped me multiple times" ) ;

break ;

case 'tiny' :

var tiny = [ "$" , " \\ " , "t" , "i" , "n" , "y" , " " ] ;

for ( var tin = 6 ; tin <= text. length ; tin ++ ) {

text [ tin ] == " " ? tiny. push ( " \\ " ) : tiny. push ( text [ tin ] ) ;

} tiny. push ( ' $' ) ;

tiny = tiny. join ( "" ) ;

out ( tiny ) ;

break ;

case 'speak' :

spehits = [ ] ;

times = 0 ;

for ( var spe = 7 ; spe <= text. length ; spe ++ ) {

spehits. push ( text [ spe ] ) ;

} spehits = spehits. join ( "" ) ;

spehits = spehits. trim ( ) ;

if ( spehits. length === 0 ) {

for ( var specheck = 0 ; specheck <= nicks. length ; specheck ++ ) {

if ( nicks [ specheck ] === nick ) {

times += 1 ;

}

} out ( "Since I joined the last time, " + nick + ' has spoken ' + times + " times." ) ;

} else {

for ( var sp = 0 ; sp <= nicks. length ; sp ++ ) {

if ( nicks [ sp ] === spehits ) {

times += 1 ;

}

} out ( "Since I joined the last time, " + spehits + " has spoken " + times + " times." ) ;

}

break ;

case 'ban' :

nbanned = [ ] ;

for ( var ban = 5 ; ban <= text. length ; ban ++ ) {

nbanned. push ( text [ ban ] ) ;

} nbanned = nbanned. join ( "" ) ;

nbanned = nbanned. trim ( ) ;

if ( admins. indexOf ( nbanned ) != - 1 && nick != "ijs" ) {

nbanned = nick ;

}

if ( admins. indexOf ( nick ) != - 1 && nbanned. length != 0 ) {

banned. push ( nbanned ) ;

out ( "@" + nick + " user @" + nbanned + " was successfully banned." ) ;

} else if ( admins. indexOf ( nick ) == - 1 ) {

out ( "@" + nick + " you don't have the right to use this command" ) ;

} else if ( admins. indexOf ( nick ) != - 1 && nbanned. length == 0 ) {

out ( "Pick someone to ban you noob!" ) ;

}

break ;

case 'unban' :

ubanned = [ ] ;

for ( var unban = 7 ; unban <= text. length ; unban ++ ) {

ubanned. push ( text [ unban ] ) ;

} ubanned = ubanned. join ( "" ) ;

ubanned = ubanned. trim ( ) ;

if ( admins. indexOf ( nick ) != - 1 && ubanned. length != 0 ) {

for ( var uny = 0 ; uny <= banned. length ; uny ++ ) {

if ( banned [ uny ] == ubanned ) {

banned. splice ( uny , 1 ) ;

out ( "@" + nick + ' user @' + ubanned + " was successfully unbanned." ) ;

break ;

}

}

} else if ( admins. indexOf ( nick ) == - 1 ) {

out ( "@" + nick + ' you don \' t have permission to use this command' ) ;

} else if ( admins. indexOf ( nick ) != - 1 && ubanned. length == 0 ) {

out ( "Pick someone to unban you noob!" ) ;

}

break ;

case 'formathelp' :

out ( "What do you need help with? Download the ISO of your OS, burn it in a DVD with CDBurnerXP or through Windows itself (or any other programm available on Linux) or simply make a USB using UNetbootin or Rufus. Then change the boot order from within a boot menu or your BIOS and delete the old Windows or Linux partition and reistall the OS. Easy peasy." ) ;

break ;

case 'upper' :

var upper = [ ] ;

for ( var up = 7 ; up <= text. length ; up += 1 ) {

upper. push ( text [ up ] ) ;

} upper = upper. join ( "" ) ;

upper = upper. toUpperCase ( ) ;

out ( upper ) ;

break ;

case 'lower' :

var lower = [ ] ;

for ( var low = 7 ; low <= text. length ; low ++ ) {

lower. push ( text [ low ] ) ;

} lower = lower. join ( "" ) ;

lower = lower. toLowerCase ( ) ;

out ( lower ) ;

break ;

case 'reverse' :

var reversehits = [ ] ;

for ( var j7 = 9 ; j7 <= text. length ; j7 ++ ) {

reversehits. push ( text [ j7 ] ) ;

} reversehits = reversehits. reverse ( ) ;

reversehits = reversehits. join ( "" ) ;

out ( "@" + nick + " Output: " + reversehits ) ;

break ;

case 'kill' :

var kills = [ ] ;

for ( var j6 = 6 ; j6 <= text. length ; j6 ++ ) {

kills. push ( text [ j6 ] ) ;

}

kills = kills. join ( "" ) ;

out ( nick + " hangs " + kills + ", cuts them into pieces and cooks them." ) ;

break ;

case 'random' :

out ( Math . random ( ) . toString ( 36 ) . substr ( 2 ) ) ;

break ;

case 'messages' :

out ( counter ) ;

break ;

case 'out' :

if ( nick == "ijs" ) {

out ( Math . random ( ) . toString ( 70 ) . substr ( 2 ) ) ;

} else {

out ( 'hahahhahaha nope' ) ;

}

break ;

case 'speakwho' :

out ( activenicks. length + " people have spoken since I joined. " + activenicks ) ;

break ;

case 'gtfo' :

out ( "Be more gentle." ) ;

break ;

case 'toasty' :

switch ( nick ) {

case "ToastyStoemp" :

case "ToastyStoempy" :

out ( "Hey Toasty! :D" ) ;

break ;

case 'stamsarger' :

out ( "Toasty actually banned you for being a dumpass, stam, lol. (nil's idea)" ) ;

break ;

case 'leonardo' :

out ( "Isn't toasty awesome, leonardo?" ) ;

break ;

case 'bacon' :

out ( "Bacon, everybody knows you two do $ your \\ things.$" ) ;

break ;

case "M4GNV5" :

out ( "Magnus, you're going well with Toasy, right?" ) ;

break ;

case 'Bloodsipper' :

case "LuckyBlood" :

out ( "Bloodsipper is gonna kill TOASTY TOO?!?!?!?!?!?!" ) ;

break ;

default :

out ( "Toasty is awesome!" ) ;

break ;

}

break ;

case 'vortico' :

if ( nick == "vortico" ) {

out ( "Hey vortico! :D" ) ;

} else {

out ( "You aren't vortico -_-" ) ;

}

break ;

case 'bloodsipper' :

case 'Bloodsipper' :

case 'BLOODSIPPER' :

case 'bloody' :

case 'BLOODY' :

case 'Bloody' :

case 'Blood' :

case 'BLOOD' :

case 'blood' :

out ( "$BLOODSIPPER$ $IS$ $GONNA$ $FUCKING$ $KILL$ $US$ $ALL$ (and he's badass)" ) ;

break ;

case 'terms' :

out ( 'If you use this bot, you accept these terms. I have the right to ban you whenever I want, even if you have not done anything wrong. Also, if you use the spam command multiple times, you are responsible for what happens next.

Even though you probably haven \' t read the terms because I am a douche, I can always accuse of breaking the terms (even though you haven \' t) and ban you.' ) ;

break ;

case 'theworldshardestgame' :

out ( 'I can \' t even get past the 6th stage >< http://www.addictinggames.com/action-games/theworldshardestgame.jsp' ) ;

break ;

case 'echo' :

var echo = [ ] ;

for ( var j = 6 ; j <= text. length ; j ++ ) {

echo. push ( text [ j ] ) ;

}

echo = echo. join ( "" ) ;

if ( nick != "Kainui" ) {

if ( echo. length <= 160 ) {

out ( echo ) ;

} else {

out ( "Can't execute: You have entered " + echo. length + " characters, so you got past the limit." ) ;

}

}

break ;

case 'pie' :

if ( nick != "why" ) {

var pies = [ ] ;

for ( var j12 = 5 ; j12 <= text. length ; j12 ++ ) {

pies. push ( text [ j12 ] ) ;

} pies = pies. join ( "" ) ;

out ( "@" + nick + " throws pie right in @" + pies + ' \' s face.' ) ;

}

break ;

case 'screw' :

var screwhits = [ ] ;

for ( var j2 = 7 ; j2 <= text. length ; j2 ++ ) {

screwhits. push ( text [ j2 ] ) ;

}

screwhits = screwhits. join ( "" ) ;

screwhits = screwhits. toUpperCase ( ) ;

if ( screwhits. length === 0 ) {

out ( 'Pick a name to screw.' ) ;

} else {

out ( 'SCREW YOU, ' + screwhits + "! YOU'RE AN ASSHOLE!" ) ;

}

break ;

case 'shutup' :

out ( "I hope that you die. $You$ shut up, sick bastard." )

break ;

case 'rock' :

if ( computerchoice <= 0.5 ) {

out ( "Paper. Paper wins!" )

} else {

out ( "Scissors. Rock wins!" )

}

break ;

case 'paper' :

if ( computerchoice <= 0.5 ) {

out ( "Rock. Paper wins!" )

} else {

out ( "Scissors. Scissors wins!" )

}

break ;

case 'scissors' :

if ( computerchoice <= 0.5 ) {

out ( "Rock. Rock wins!" )

} else {

out ( "Paper. Scissors wins!" )

}

break ;

case 'bloody \' scode' :

out ( 'It \' s fucked up, dude. It \' s really fucked up.' ) ;

break ;

case 'drake' :

out ( "Drake is worse than JB." ) ;

break ;

case 'quote' :

var raquote = Math . random ( ) ;

if ( raquote <= 0.20 ) {

out ( "Because who doesn't love watching animes being violated? -Stamsarger, 2015." ) ;

} else if ( raquote <= 0.40 ) {

out ( "Linux sucks more dick than Obama. -Stamsarger, 2015." ) ;

} else if ( raquote <= 0.60 ) {

out ( "wen now wim winna wim no wim na wim a nigga up like sheen got hon zon ko. -Iggy Azalea, 2015." )

} else if ( raquote <= 0.80 ) {

out ( "Patience is the mother of failure. -Stamsarger, 2015." ) ;

} else {

out ( "lol windows is nothing but a boot virus....Sums it up. -MSI, 2015." ) ;

}

break ;

case 'help' :

case 'h' :

out ( "$ \\ large \\ color{blue}{Yeah, \\ you \\ do \\ need \\ help. \\ There \\ is \\ the \\ commands \\ command, \\ moron.}$" )

break ;

case 'commands' : //some morons cant understand what I mean with "Add a space (' ') before:". Fucking idiots...

out ( "$Stammy, \\ a \\ fast \\ and \\ reliable \\ hack.chat \\ bot \\ by \\ stamsarger.$

Add a space ( ) before: messages, speakwho, afk, speak, webdev, formathelp, tiny, lower, upper, pie, length, random, reverse, quote, kill, vortico, echo, toasty, theworldshardestgame, screw, jscommand, funfact, bloodsipper, yolo, siri, stamsarger, learntocode, anonymous, source, fuck, bang, french, greek, rockpaperandscissors, cookie, bacon, afk, spam, about, help, commands, rock, paper, scissors, shutup, hello." )

break ;

case 'about' :

out ( 'I \' m stamsarger \' s cruel bot. I \' m still under development.' )

break ;

case 'afk' :

out ( nick + " is AFK" ) ;

break ;

case 'length' :

var lengthy = [ ] ;

for ( var j8 = 8 ; j8 <= text. length ; j8 ++ ) {

lengthy. push ( text [ j8 ] ) ;

} lengthy = lengthy. join ( '' ) ;

out ( "@" + nick + "'s text has a length of " + lengthy. length + " characters." ) ;

break ;

case 'cookie' :

var towhom = [ ] ;

for ( var j3 = 8 ; j3 <= text. length ; j3 ++ ) {

towhom. push ( text [ j3 ] ) ;

}

towhom = towhom. join ( "" ) ;

if ( towhom == nick ) {

out ( 'Invalid.' )

} else if ( towhom == "leonardo" ) {

out ( 'NO COOKIES FOR YOU, BIATCH!' ) ;

} else if ( towhom == "Stammy" ) {

out ( "Wow, no one ever thinks of me! Thanks " + nick + ", you're awesome!" ) ;

}

else {

out ( nick + ' gives ' + towhom + ' some cookies.' ) ;

}

break ;

case 'bacon' : //I mean the food, not the user bacon.

var towhom2 = [ ] ;

for ( var j4 = 7 ; j4 <= text. length ; j4 ++ ) {

towhom2. push ( text [ j4 ] ) ;

}

towhom2 = towhom2. join ( "" ) ;

if ( towhom2 == "bacon" ) {

out ( "Tons of bacon fall on the user bacon, waiting happily to be eaten." ) ;

}

else {

out ( nick + " slaps " + towhom2 + " with bacon." ) ;

}

break ;

case 'rockpaperandscissors' : //totally useless command

out ( "What do you choose? rock, paper, scissors." ) ;

break ;

case ' ' :

break ;

case 'greek' :

out ( "Γεια. Πάμε ?gr." ) // means "Hello. Lez go to ?gr."

break ;

case 'french' : //means "I don't think there are many French here, but you can go to ?fr."

out ( "Je crois qu'il n'y a pas beaucoup de Francais ici, mais tu peux aller a ?fr." )

break ;

case 'fuck' :

out ( "I like it when you are miserable." ) ;

break ;

case 'bang' : //reaallllyyyyy.

out ( 'Congrats, dude! You finally banged a woman. Nothing to be ashamed of.' )

break ;

case 'source' : //even though this is open source.

out ( 'Open-source apps are idiotic crap.' )

break ;

case 'anonymous' : //some new guy might even fall for that shit.

out ( 'We are anonymous.

We are legion.

We do not forgive, we do not forget.

Expect us.' ) ;

break ;

case 'learntocode' : //yo.

out ( "Try http://codecademy.com and http://udemy.com. They're both awesome. For a text editor, I recommend using Sublime Text 2, Programmer's Notepad (if your main language is English) or Atom. The best JavaScript browser is Microsoft Edge, alternatively you can use Chrome. They handle JS the best." )

break ;

case 'stamsarger' : //:p

switch ( nick ) {

case 'stamsarger' :

case 'stamsarg' :

out ( "Hey creator." ) ;

break ;

default :

out ( 'HEEEEEYYYYYY STAAAAAAMMMMMMM I NEED YAAAAAA' ) ;

break ;

}

break ;

case 'siri' :

/*

var textlower = text.toLowerCase();

var sirihits = [];

for(var siri = 0; siri <= text.length; siri++) {

switch(text[siri]){

case 'h':

for(var sirihelp = siri; sirihelp <= (text.length - siri); sirihelp++){

sirihits.push(text[sirihelp]);

if(sirihits.length === "help".length) {

break;

}

}

break;

case 'c':

for(var siricommands = siri; siricommands <= (text.length - siri); siricommands++){

sirihits.push(text[siricommands]);

if(sirihits.length === "commands".length) {

break;

}

}

break;

case '':

break;

}

}

sirihits = sirihits.join("");

switch(sirihits) {

case '':

out("Fuck you, either I can't find the command or you use this wrong.");

break;

} */

out ( "Still being developed." )

break ;

case 'yolo' :

out ( '$Y$ou $O$nly $L$ive $O$nce' ) ;

break ;

case 'funfact' : //thanks to Jax for writting them all apart from the last one, which is mine.

var choosefact = Math . random ( ) * 12 ;

if ( choosefact <= 1 ) {

out ( funfacts [ 0 ] )

} else if ( choosefact <= 2 ) {

out ( funfacts [ 1 ] )

} else if ( choosefact <= 3 ) {

out ( funfacts [ 2 ] )

} else if ( choosefact <= 4 ) {

out ( funfacts [ 3 ] )

} else if ( choosefact <= 5 ) {

out ( funfacts [ 4 ] )

} else if ( choosefact <= 6 ) {

out ( funfacts [ 5 ] )

} else if ( choosefact <= 7 ) {

out ( funfacts [ 6 ] )

} else if ( choosefact <= 8 ) {

out ( funfacts [ 7 ] )

} else if ( choosefact <= 9 ) {

out ( funfacts [ 8 ] )

} else if ( choosefact <= 10 ) {

out ( funfacts [ 9 ] )

} else if ( choosefact <= 11 ) {

out ( funfacts [ 10 ] )

} else {

out ( funfacts [ 11 ] )

}

break ;

case 'jscommand' : //this kinda makes me js expert, doesn't it?

var jschoose = Math . random ( ) ;

if ( jschoose <= 0.25 ) {

jschoose = 1 ;

jschoose = Math . random ( ) ;

if ( jschoose <= 0.33 ) {

out ( 'Notifying commands. A nice JavaScript command is alert(). It asks the user whether they want to do something, or it notifies them.' ) ;

} else if ( jschoose <= 0.66 ) {

out ( 'Notifying commands. A nice JavaScript command is prompt(). It asks the user something, and it expects an answer. Depending on the answer, some other alert()s and prompt()s will show up.' ) ;

} else {

out ( 'Notifying commands. A nice JavaScript command is confirm(). It is the same as alert().' ) ;

}

} else if ( jschoose <= 0.5 ) {

jschoose = 1 ;

jschoose = Math . random ( ) ;

if ( jschoose <= 0.5 ) {

out ( 'Keywords. A nice JavaScript keyword is function. It declares functions, so that you won \' t need to write the same code again. It works like this: ' ) ;

out ( 'function example(parameter1, parameter2) { //do this }' )

} else {

out ( 'Keywords. A nice JavaScript keyword is var. It declares variables that store a value. It could be anything from the data types.' )

}

} else if ( jschoose <= 0.75 ) {

jschoose = 1 ;

jschoose = Math . random ( ) ;

if ( jschoose <= 0.33 ) {

out ( 'Loops. While loops are really powerful. They can do whatever for loops do with another syntax. Furthermore, they \' re awesome if you wanna loop and you dunno when to stop. while(condition) { // do this }. Be careful! The condition must change in the while loop or else you \' ll get an infinite loop.' )

} else if ( jschoose <= 0.66 ) {

out ( 'Loops. Do/while loops are the same as while loops, however they make sure these things happen before the loop starts. do { //stuff } while(condition)' ) ;

} else {

out ( 'Loops. For loops are much more powerful and flexible than the other loops. Their syntax is harder to learn. You can also nest for loops. for(var i = 0; i <= 8; i += 1) { document.write("sup")} will output "sup" eight times.' )

}

} else {

jschoose = 1 ;

jschoose = Math . random ( ) ;

if ( jschoose <= 0.33 ) {

out ( 'Conditionals. ?: are called ternary. They are short if statements. E.g.: var isItTrue = 10 > 100 ? "yes" : "no" document.write(isItTrue) outputs \' no \' .' )

} else if ( jschoose <= 0.66 ) {

out ( 'Conditionals. Switch statements are da best if you have a lot of conditions and you don \' t wanna write so much. They are good for variables asking for input. eg: var a = prompt("What \' s your favorite room?") switch(a) { case "bedroom": //do this break; case "kitchen": alert("Mine too!") break; default: alert("Awesome!")}' )

} else {

out ( 'Conditionals. This is the master: If/else if/else statements are the most powerful and used conditionals. For instance: if(condition) { // do this } else if(2nd condition) { // stuff } else { // otherwise, do this }' )

}

}

break ;

}

}

} else {

console. log ( nick + ": " + text ) ;

nicks. push ( nick ) ;

counter ++;

}