This file contains hidden or 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<ppm.h> | |
| #include<math.h> | |
| #include<string.h> | |
| typedef float mask; | |
| #define HEIGHT 512 | |
| #define WIDTH 512 | |
| #define PI 3.14159265 | |
| typedef struct |
This file contains hidden or 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
| function permute(array) { | |
| // Identity | |
| if(!array.length) { | |
| return []; | |
| } | |
| var ret = [array], | |
| len = array.length, | |
| modlen = len - 1, | |
| mover = array[modlen], |
This file contains hidden or 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
| set = [] | |
| 8.upto(1000).each { | x | | |
| pop = [] | |
| 8.step(x - 8, 8).each { | y | | |
| popeye_2 = y | |
| popeye_1 = x - y | |
| bats = popeye_1 * 0.250 | |
| if bats.to_i == bats | |
| hits = 3 * popeye_2 / 8 + bats | |
| pop << [hits, popeye_1, popeye_2] |
This file contains hidden or 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
| #!/usr/bin/ruby | |
| $door_count = 3 | |
| $door_list = 0.upto($door_count - 1).to_a | |
| $game_count = 10 * 1000 | |
| def percent(numerator, denominator) | |
| return "%5.2f%" %[100 * numerator.to_f / denominator.to_f] | |
| end |
This file contains hidden or 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 OmniLog | |
| attr_reader :available | |
| def initialize(path) | |
| @real = Logger.new(path) | |
| @fake = Logger.new("/dev/null") | |
| @available = Set.new | |
| end | |
| def add!(which) |
NewerOlder