Skip to content

Instantly share code, notes, and snippets.

@mathias
Last active March 13, 2017 17:03
Show Gist options
  • Save mathias/40b73088c31c2161b3fb2dd316ecb933 to your computer and use it in GitHub Desktop.
Save mathias/40b73088c31c2161b3fb2dd316ecb933 to your computer and use it in GitHub Desktop.
#include <stdio.h>
int main(void) {
int number_of_barks = 5;
for(int i=0;i<number_of_barks;i++) {
printf("Woof!\n");
}
return 0;
}
class Duck
def initialize(number_of_quacks:)
@number_of_quacks = number_of_quacks
end
def quack!
@number_of_quacks.times do
puts "Quack!"
end
end
end
duck = Duck.new(number_of_quacks: 5)
duck.quack!
#> Quack!
#> Quack!
#> Quack!
#> Quack!
#> Quack!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment