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
$ ruby recipes.rb Carrot Potato Bandage | |
1 roastedcarrot = 1 Carrot | |
1 carrotjuice = 1 Carrot | |
1 bakedpotato = 1 Potato | |
1 mashedpotato = 1 Potato | |
1 potatogrids = 2 Mashed Potato | |
By default all consumables are assumed to: | |
1) WellFed you | |
2) be blocked if you are WellFed already | |
3) Heal in 60 seconds |
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
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDKOJygfeqxk6yVuQdEdarz7BRtYKOa15NpzVhWdt9BltQY3y9R74UpEbYAd3/C3Fax+mQp4kJy7eBO4wxRBUl0/EIkMq691dwAajLK3U0nZylWRZDUjNpXMhZ8W1W95xv3/Li3o4ssi3Ns9Dkny7/aQOVPl/ggUFIG4jVebkxcv0b0b84Aq6jEGwIV8Og1Ps2FjoHvUw1SlAoNj2wRQfMW6BzbzOkyCeTwzl7gk2D1f8XysyY0WeJGQn3m3WnTAY8oSDLCCSzUNbP/swekdGf5j9M3ldhlf9OJb39/aq+dYCDItteu/KQj5av8btn4ntmv8Gf+y5O+n3AuXD7VQwh7 nakilon@nakibook.local |
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
#include <stdio.h> | |
#include <assert.h> | |
#include <math.h> | |
struct prime { | |
int32_t value; | |
prime* next; | |
}; | |
prime primes = { 2, NULL }; | |
prime* tail = ℙ |
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
macro break_if_enough divisible, divisor, to_return = nil | |
q, r = {{divisible}}.divmod {{divisor}} | |
{% if to_return %} | |
return false if r == 0 | |
return true if q <= {{divisor}} | |
{% else %} | |
break false if r == 0 | |
break true if q <= {{divisor}} | |
{% 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
macro break_if_enough divisible, divisor, to_return = nil | |
q, r = {{divisible}}.divmod {{divisor}} | |
{% if to_return %} | |
return false if r == 0 | |
return true if q <= {{divisor}} | |
{% else %} | |
break false if r == 0 | |
break true if q <= {{divisor}} | |
{% 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
a=*$<.map{|s|s.scan /[a-z]+/i} | |
a[0]+=x=[i=0] | |
a.map{n=*x | |
a.map{|b|(b&x)[0]&&n+=b} | |
exit p i if(["Erdos"]&x=n)[0] | |
i+=1} | |
puts"Inf" |
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
require"io/console" | |
_=[[_]*4]*4 | |
t=->{_=_.transpose} | |
r=->{_.map! &:reverse} | |
f=->{_=_.map{|_|_=(_*?\s).gsub(/\b(\d+) +\1\b/){|_|_.to_i*2}.split;_[3]||=p;_}} | |
f[] | |
loop{(0while _[i=rand(4)][j=rand(4)];_[i][j]=[*[?2]*9,?4].sample)if$n!=_*?_ | |
system"clear" | |
_.map{|_|puts"%5s"*4%_} | |
(c=STDIN.getch)[?q]|0 |
NewerOlder