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
#!/usr/bin/siren | |
# coding: utf-8 | |
# 箱を2つ作成 | |
box1 = Prim::box [10, 10, 10] | |
box2 = Prim::box [10, 10, 10] | |
# 移動 | |
box2.translate! [5, 5, 5] |
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
set color { | |
#000000 | |
#cd0000 | |
#00cd00 | |
#cdcd00 | |
#0000ee | |
#cd00cd | |
#00cdcd | |
#e5e5e5 | |
#7f7f7f |
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
#!/usr/bin/env ruby | |
# coding: utf-8 | |
class Machine | |
RAMSIZE = 256 | |
def initialize(file) | |
@ram = File.open(file).read.each_char.map.to_a | |
@eoc = @ram.size | |
@ram.fill(0, @eoc..RAMSIZE) | |
@p = @eoc |
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 <stdlib.h> | |
int main(int c, char** v) | |
{ | |
int i; | |
qsort(v+1, c-1, sizeof(char*), | |
(int(*)(const void*, const void*)) | |
"\x55\x89\xe5\x56\x8b\x75\x08\x53\x8b\x5d\x0c\xeb\x0f\x84\xc0\x75\x04\x31" |
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 <stdlib.h> | |
// #include <string.h> | |
#ifndef _STRING_H | |
int strlen(const char* s) | |
{ | |
int i = 0; | |
while (s[++i]) | |
; |
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 <stdlib.h> | |
#include <sys/types.h> | |
#include <sys/wait.h> | |
void heavy_function() | |
{ | |
sleep(5); | |
} |
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> | |
int fib(int k) | |
{ | |
if (k == 0) | |
return 0; | |
else if (k == 1) | |
return 1; | |
else if (k >= 2) { | |
return fib(k-2) + fib(k-1); |
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 <math.h> | |
#define COL 64 | |
#define ROW 24 | |
FILE* f; | |
/* 画面を白く塗りつぶす */ | |
void clear() |
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
UEsDBBQAAAAIAJ1acUU2Njnh8hEAAAAmAAALABwAZGlzcGxheS5leGVVVAkAA4pbaVSKXiNVdXgL | |
AAEE6AMAAAToAwAA7Vl9cFzVdT/37e7bp5W0eCUsWfhrLcmwtqS1JNv4G0uy/CGwsSLJsoVJnbe7 | |
T/LDu+8t7721LTsGESZtnA4fbktbCJ06KZmO+wXMkEACaSHppKQzZkhSOpA0DHSafgBT2oRmhoTB | |
/Z373q5Wllr4N5k86Z17zrnnnnvuueeee+/bA7c9SCEiCuO9coXoGfKfPvroZwZvfOXX4/RUzeVV | |
z4j9l1eNHTfdZNGxpxy9kMzqlmV7yYyRdEpW0rSSgwdHkwU7Z6Tr62PtgY7h3UT7RYg+f9QcK+t9 | |
gxRRKzSiZSA0n3frNoBk2bA+H1d8u4lmS2mU4qMh6vss0SL5P1tWCvm8t5XocKCyO7LAID9FVIfi | |
0a2+OR/7SVZMl48Gel8VnfaM0x7KsaXBuJbN2l2l4lNpx3WyFNgGG0nFu2KuHNh9acfI21nfVrZZ | |
6mqfJzdwtZnd2/xyn2wSodQNRF4jkQCdQG/PrCYqio8zYP9p7A7TSyTbJ5QUPB1TQivWhVZ0iNA5 | |
DCGshJu6Q80dInxOZSqypCcSWbmoJ7S0Q0TORZkVD58Lc5mqQfeKcpZbLTuinOXK25SzajXpwsRY | |
qoF7UVKwOhZroNS1TEqqtkGkFqN0mwDOcbQobjOjGqNnGa6M2UtYXhLKhyqEVLcFHPu6CtvGHMXW |
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
#!/usr/bin/ruby | |
# coding: utf-8 | |
def get_score file1,file2 | |
def pattern path | |
f = 16 | |
tmp = '/tmp/imgmatch.xbm' | |
`convert -level 0%,75%,0.8 -fuzz 50% -trim -resize #{f}x#{f}! #{path} #{tmp}` | |
ptn = File.open(tmp).read.scan(/0x[\dA-F]{2}/).map{|n| n.hex.to_s(2).rjust(8, '0')}.join.split(//) | |
File.delete tmp |