This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Created by molayodecker on 28/11/2016. | |
* Welcome | |
* Before your interview, write a program that lets two humans play a game of Tic Tac Toe in a terminal. | |
* The program should let the players take turns to input their moves. | |
* The program should report the outcome of the game. | |
* During your interview, you will pair on adding support for a computer player to your game. | |
* You can start with random moves and make the AI smarter if you have time. | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.IOException; | |
/** | |
* Created by molayodecker on 28/11/2016. | |
* Welcome | |
* Before your interview, write a program that lets two humans play a game of Tic Tac Toe in a terminal. | |
* The program should let the players take turns to input their moves. | |
* The program should report the outcome of the game. | |
* During your interview, you will pair on adding support for a computer player to your game. | |
* You can start with random moves and make the AI smarter if you have time. | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var name = "Elon"; | |
function musk(){ | |
console.log("Hello " + name); | |
} | |
musk("Elon Musk"); // Hello Elon Musk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function ice(){ | |
var icecream = "cookie & cream"; | |
console.log(icecream); | |
} | |
console.log(icecream); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var icecream = "cookie & cream"; | |
function ice(){ | |
var icecream = "cookie & cream"; | |
console.log(icecream); | |
} | |
console.log(icecream); // cookie & cream |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var name = "Elon"; | |
function musk(name){ | |
console.log("Hello " + name); | |
} | |
musk("Elon Musk"); // Hello Elon Musk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var a = 10; | |
function outer(){ | |
var b = a; | |
console.log(b); | |
function inner(){ | |
var b = 20; | |
var c = b; | |
console.log(c); | |
} | |
inner(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var name = "Arthur"; | |
function(){ | |
if(name === "Arthur"){ | |
var fullName = "Arthur Decker"; | |
} | |
} | |
console.log(fullName); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var name = "Arthur"; | |
if(name === "Arthur"){ | |
var fullName = "Arthur Decker"; | |
} | |
console.log(name); | |
console.log(fullName); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var milk = "Organic"; | |
var last; | |
function outer(){ | |
var withinOuter = "Health" | |
function inner(){ | |
console.log(milk); | |
console.log(withinOuter); | |
} | |
last = inner; | |
} |
OlderNewer