Skip to content

Instantly share code, notes, and snippets.

@teenst
teenst / test
Created April 11, 2011 18:21
test file
this is test
@teenst
teenst / nikki.txt
Created May 10, 2011 18:30
真の日記
ここに日記を書いても許されますか.
今日の日記
暑い.
今日の日記
今日もダメだった
今日の日記
フォークされて嬉しい
#!/usr/bin/env perl
use strict;
use warnings;
use utf8;
use Encode;
binmode STDOUT,':utf8';
while(<>){
print ord $_;
@teenst
teenst / yokubou.rb
Created December 5, 2011 08:37
男子の欲求
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
year = ["正月の着物","リクルートスーツ","卒業式の制服","入学式のスーツ","春物の服","長靴と雨合羽","水着","浴衣","半袖Tシャツ","秋物の服","カラータイツとコート","サンタコス"]
month=rand(12)
puts "男子 #{month+1}月は #{year[month]}着た女の子とデートしたいとか言う"
@teenst
teenst / prob11.rb
Created December 6, 2011 09:30
prob11
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
#prob11
file = open("prob11.txt","r")
grid = Array.new(20).map!{ Array.new( 20, 0 ) }
20.times do |i|
line = file.gets
line.chomp!
@teenst
teenst / prob25.rb
Created December 7, 2011 19:34
ゴミ
def upto_fibonacci(i,list)
return 1 if i == 1
list[i] = list[i-1].to_i + list[i-2].to_i
return list[i]
end
list = [0,1]
i = 1
while upto_fibonacci(i,list).to_s.length < 1000
i+=1
end
@teenst
teenst / Gemfile
Created December 22, 2011 16:18 — forked from phelrine/stranimate.rb
string animation
# A sample Gemfile
source "http://rubygems.org"
gem "rmagick"
@teenst
teenst / fizzbuzz.py
Created January 17, 2012 16:51
FizzBuzz by python
#!/usr/bin/env python
# http://www.aoky.net/articles/jeff_atwood/why_cant_programmers_program.htm
for i in xrange(1,101):
if i % 3 == 0 and i % 5 == 0:
print 'FizzBuzz'
elif i%3 == 0:
print 'Fizz'
elif i % 5 == 0:
@teenst
teenst / HelloPython.py
Created July 2, 2012 08:26
HelloPython.py
# -*- coding: utf-8 -*-
'''
Created on 2012/07/02
@author: teenst
'''
print "Hello Python world!"
print "縺�
@teenst
teenst / fizzbuzz.rb
Created September 1, 2012 03:35
fizzbuzz
#!usr/bin/env ruby
1.upto(100) do |i|
if i % 15 == 0
puts "fizzbuzz"
elsif i % 3 == 0
puts "fizz"
elsif i % 5 == 0
puts "buzz"
else