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
import os | |
from struct import pack | |
def export_mdd(premddpath, mddpath): | |
if os.path.isfile(premddpath): | |
pass | |
if os.path.isfile(mddpath): | |
pass | |
pre_mdd = open(premddpath, "r") | |
fmax = None |
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
class Window | |
def initialize | |
@default = { | |
:width => 640, | |
:height => 480, | |
:title => "window" | |
} | |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <time.h> | |
#include <stdbool.h> | |
#include <unistd.h> | |
#define WIDTH 40 | |
#define HEIGHT 20 | |
int grid[HEIGHT][WIDTH]; | |
int new_generation[HEIGHT][WIDTH]; |
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
class Comp | |
def initialize ext | |
@file_ext = ext | |
end | |
def compare n | |
len = Dir::glob(self.file_ext).length | |
if n+1 == len || len == 0 | |
return 0 | |
end | |
src = open(Dir::glob(self.file_ext)[n]) |
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
# -s => サイレントモード | |
# -n => 読み取る文字数 | |
read -s -n1 var | |
echo "$var" |
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
#!/bin/bash | |
:<<'#license' | |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
Version 2, December 2004 | |
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net> | |
Everyone is permitted to copy and distribute verbatim or modified | |
copies of this license document, and changing it is allowed as long | |
as the name is changed. |