Skip to content

Instantly share code, notes, and snippets.

View LucasRizzotto's full-sized avatar
💭
fuck

Lucas Rizzotto LucasRizzotto

💭
fuck
View GitHub Profile
@LucasRizzotto
LucasRizzotto / Eloquent JS - Triangle Loop
Created February 4, 2015 03:36
My answer to the Triangle Loop exercise @ Eloquent JS
var i = 0, string = "";
for ( i = 0 ; i < 7 ; i++ ) {
string += "#"
console.log(string)
}
@LucasRizzotto
LucasRizzotto / Eloquent JS - FizzBuzz
Created February 4, 2015 03:32
My answer to the Eloquent JS FizzBuzz exercise
/* My solution to the FizzBuzz exercise */
for ( i = 1 ; i <= 100 ; i++ ) {
if ( i % 3 === 0 && i % 5 === 0 ) {
console.log("FizzBuzz")
}
else if (i % 3 === 0) {
console.log("Fizz")
@LucasRizzotto
LucasRizzotto / Eloquent JS - Chessboard Exercise
Created February 4, 2015 03:22
My Chessboard Exercise solution from the Eloquent JS book.
/* This is the way I found to solve it. There are probably easier ways to do this. I am a total beginner */
var boardwidth = 8, boardheight = 5, board = "";
for ( i = 0 ; i < boardheight ; i++ ) {
for ( f = 0 ; f < boardwidth ; f++ ) {
if ( f % 2 === 0 )
board += " ";