Skip to content

Instantly share code, notes, and snippets.

@Ebonkuab
Ebonkuab / two_player_game.rb
Created January 12, 2016 20:56
two player guesing game using OOP ruby ( LIGHTHOUSE WEB DEV BOOTCAMP)
#two player maths game using objects
# defining the player class
class Player
attr_accessor :name, :number_of_lives
def initialize (name)
@name = name
@number_of_lives= 3
end
@Ebonkuab
Ebonkuab / barracks.rb
Created January 13, 2016 22:38
following the TDD concept and using Rspec as the automated testing platform to code A simulation of Warcraft 3 barracks Simulator
#require_relative 'footman'
class Barracks
attr_accessor :gold,:food
def initialize ( )
# Need to default the 2 instance variables here
# Also also give code outside this class access to these variables (via attr_reader, attr_writer or attr_accessor)
@Ebonkuab
Ebonkuab / roman_numerals.rb
Created January 18, 2016 02:29
ruby code to coNvert arabic (contemporary ) numbers to old style roman numerals. (LIGHTHOUSE WEB DEV BOOTCAMP)
# ROM ={ I: 1,
# V: 5,
# X: 10,
# L: 50,
# C: 100,
# D: 500,
# M: 1000
# }
@Ebonkuab
Ebonkuab / array_of_light2.js
Created February 9, 2016 20:08
javascript code for showing an array of numbers given an input
var ArrayOfLight = function (num) {
var arrayOfNumber = []
var i = 0 ;
var counter = 0;
while (counter <= num){
arrayOfNumber.push(i)
i = i + 1
counter = counter + 1
}