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
def englishNumber number | |
if number < 0 | |
return 'please' | |
end | |
if number == 0 | |
return 'zero' | |
end | |
numString = '' |
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 = "" | |
while var != "Privet" | |
puts "Why u so screwdly bad?!" | |
var = gets.chomp | |
end |
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 = "" | |
b = [] | |
while var != 333 | |
puts "Put a fixnum" | |
var = gets.chomp.to_i | |
b.push var | |
end | |
puts "Put a method: *, -, +, /" |
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
class Panda | |
def hello argument | |
@masiv ||= [].push argument | |
@masiv.each {|i| puts "Wazzup #{i}"} | |
end | |
end |
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
class Calculator | |
def plus (first, second) | |
result = first + second | |
puts result | |
end | |
def minus (first, second) | |
result = first - second | |
puts result | |
end |
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
class Nigga | |
def whazzup | |
@whazzup = "whazzup" | |
end | |
def sir | |
puts "#{@whazzup} sir" | |
end | |
end |
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
class Footballist | |
attr_accessor :goals, :udars, :power, :success_passes, :fail_passes, :saved_goals, :failed_goals | |
@@attempts = 0 | |
@@attempt_goals = 0 | |
def initialize(team, power=nil) | |
@power = (power < 0 or power > 10) ? rand(10)+1 : power | |
@team = team | |
@goals = 0 | |
@udars = 0 |
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
class Dog | |
@@growth = 100 | |
def greatden | |
puts @@growth | |
selfgrowth = 120 | |
end | |
def labrador | |
puts @@growth |
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
def add(*numbers) | |
numbers.inject(0) { |sum, number| sum + number } | |
end | |
def subtract(*numbers) | |
sum = numbers.shift | |
numbers.inject(sum) { |sum, number| sum - number } | |
end | |
def calculate(*arguments) |
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
module Kata | |
A = 5 | |
module Dojo | |
B = 9 | |
A = 7 | |
class ScopeIn | |
def push | |
ScopIn::A # (why if i write just "::A" - it work too ?) | |
end |
OlderNewer