Skip to content

Instantly share code, notes, and snippets.

View ananace's full-sized avatar

Alexander "Ananace" Olofsson ananace

  • Linköping University
  • Sweden
View GitHub Profile
gets.to_i # I don't care about the number :D
gets # Friendships:
direct_friends = {}
indirect_friends = {}
until /Queries/ =~ (data = gets) do # Until it reads the line Queries:
names = data.split # Split on space
# Create entries in the friend dictionaries if they don't exist

Examples:

Ruby:

variable = 5

if variable > 4 then
    puts variable.to_s + " is over 4"
    puts "It's exactly five" if variable == 5
elsif variable == 4 then