Thursday, April 23, 2015

Personal Code for 4/23/15



I am going to have a technical interview either tomorrow or Saturday for a coding school in the Bay Area. I read a few articles. Brushed up on some jargon and have no idea how its going to go. I am hoping it goes something like this:

Interviewer: "Can you please tell me how you would write a code to recreate the song 99 bottles of beer on the wall"
Me: Why yes. Yes I can.
Interviewer: "Have you ever gotten really close to getting an amazing tic tac toe game with multiple options for computer opponents that have the funniest dialogue as you play the game, but then something happened where it didn't run?"
Me: "why yes. Yes I have. And I know I will get it to run. This weekend. I am going to debug it this very weekend."
Interviewer: (clears his throat, clearly impressed by my stick-to-itiveness.) "Wow, I'm impressed with your stick-to-itiveness."
Me:"This is a phone interview, so you can't tell, but I'm blushing right now."
Interviewer: "Whelp, I think I've heard all I need to. I will get back to you tomorrow and let you know what code we want you to build for the next phase of the interview process."
Me: "Awesome! Thank you so much."
END CALL

Anyway, at lunch I had my friend Maddy be my interviewer and she asked me to tell her how I'd make a tetris game...

So here is how I'd make a tetris game

shape = [1,2,3,4,5,6]

Class Shapes (shape)
class Square
end
class Line
end
class L
end
class T
end
class backwardsL
end
class GiantBlobOfAllShapes

method to make each pixel of the shape move as the player moves it or default to falling straight down

method random number generator to select next shape to drop ( assign each shape a numeric value eg shape = 1, shape =2 etc)
method timer  for the speed
method increase speed after given a mount of time or given amount of lines

method disappear lines

end

Sigh. I miss Tetris. It was hard to play for just long enough to get that screenshot and then quit... but alas, I have an interview to nail tomorrow.

No comments:

Post a Comment