Hatena::Grouprubyist

たばさの RSSフィード

12/31(月) 2007

cygwinから。sourceforgeにて

cygwinから。sourceforgeにて - たばさの を含むブックマーク はてなブックマーク - cygwinから。sourceforgeにて - たばさの

http://sourceforge.jp/projects/sourceforge/document/Shell_Server_Service/

http://programnet.hp.infoseek.co.jp/coloum/cygwin5.html

http://cyberam.dip.jp/linux_security/ssh/ssh_main.html

いろいろ出来そうだけど使い方わからず。どうにか鍵は登録、最後にログインの仕方が。

tabasaをつければいいのか。

$ ssh tabasa@shell.sourceforge.jp
...略
tabasa@sf-usr-shell:~$ vi
...略
tabasa@sf-usr-shell:~$ ls
test1.txt
tabasa@sf-usr-shell:~$ ls -l
total 4
-rw-r--r-- 1 tabasa users 26 Dec 31 08:50 test1.txt
tabasa@sf-usr-shell:~$ cat test1.txt
test ;hello, sourceforge!
tabasa@sf-usr-shell:~$ exit
logout
Connection to shell.sourceforge.jp closed.

viもある。なあんだインストールしなくて良かったかも。

トラックバック - http://rubyist.g.hatena.ne.jp/hatecha/20071231

12/30(日) 2007

hello, world

| hello, world - たばさの を含むブックマーク はてなブックマーク - hello, world - たばさの

ついに19!

この人たちなら10くらいまで縮むんじゃないかって気もしてくるね。

トラックバック - http://rubyist.g.hatena.ne.jp/hatecha/20071230

12/28(金) 2007

memo

| memo - たばさの を含むブックマーク はてなブックマーク - memo - たばさの

http://www.softsynth.com/pforth/pf_tut.htm

http://gw.souken.co.jp/techrep/index.php?StackLanguage%2FForth%E5%85%A5%E9%96%80#e2734b05

()内
 コメント。
true は -1 ,false は 0
= は代入ではなく比較

forthには0との比較word 0= 0> 0< がある。0 と別々に呼ぶより速い。
do ... loop 内では I が loop counter をあらわす。
0sp (zeroS P) => スタックをクリア

宣言はコロンで始まりセミコロンで終わる。
: average + 2/ ;
新しいword , average が宣言された。辞書に追加された。
words でword listが表示される。

INCLUDE SAMPLE.FTH
 fileからコンパイル。
forget square
  word squareをuncompileする。
  

." 
  "で終わる文字列。wordなので空白が後ろに必要。
emit 
  一文字出力。
key 
  一文字入力。

variable my-var 
  変数宣言。変数に4バイト確保。
my-var .
  my-varに割り当てられたメモリ上のアドレスを表示。
123 my-var !
  123をmy-varにstore。(代入)
my-var @ .
  my-varにstoreされている値を表示。
my-var ?
  定義されているかどうか。

73 253000 !
  253000はアドレスとみなされ、そこに73をstoreする。
  これを実行したらどうなるかは保証しない。
  

68000では奇数番地に@,!,w@,w!をつかうと例外を発生しabortする。
どうしても奇数番地にアクセスしたいならodd@,odd!を使う。
c@,c!は奇数偶数関わらず使える。

hello, world!

| hello, world! - たばさの を含むブックマーク はてなブックマーク - hello, world! - たばさの

3日かかった。なにかとlinux有利。

memo

| memo - たばさの を含むブックマーク はてなブックマーク - memo - たばさの

Vd => 一行?消す

aほげほげ[esc]ZZ =>「ほげほげ」書いて終了。[esc]のとこは0x1bをどうにかして書く。

年末。

年末。 - たばさの を含むブックマーク はてなブックマーク - 年末。 - たばさの

rubyマニュアルでも読もうかと思ったのにviマニュアル見てる。

トラックバック - http://rubyist.g.hatena.ne.jp/hatecha/20071228

12/27(木) 2007

ruby 1.9.0

ruby 1.9.0 - たばさの を含むブックマーク はてなブックマーク - ruby 1.9.0 - たばさの

と書くと人来るかも。

irb(main):001:0> "wert"[0]

=> 119

ということで。入れてみました。

ruby 1.9.0 (2007-12-25 revision 14709) [i386-mswin32]

irb(main):001:0> "wert"[0]

=> "w"

確かに。


まあまだ良く知らないんですが。

1.8.6
irb(main):001:0> "abc".methods.size
=> 147
irb(main):002:0> "abc".methods.sort
=> ["%", "*", "+", "<", "<<", "<=", "<=>", "==", "===", "=~", ">", ">=", "[]", "
[]=", "__id__", "__send__", "all?", "any?", "between?", "capitalize", "capitaliz
e!", "casecmp", "center", "chomp", "chomp!", "chop", "chop!", "class", "clone",
"collect", "concat", "count", "crypt", "delete", "delete!", "detect", "display",
 "downcase", "downcase!", "dump", "dup", "each", "each_byte", "each_line", "each
_with_index", "empty?", "entries", "eql?", "equal?", "extend", "find", "find_all
", "freeze", "frozen?", "gem", "grep", "gsub", "gsub!", "hash", "hex", "id", "in
clude?", "index", "inject", "insert", "inspect", "instance_eval", "instance_of?"
, "instance_variable_defined?", "instance_variable_get", "instance_variable_set"
, "instance_variables", "intern", "is_a?", "is_binary_data?", "is_complex_yaml?"
, "kind_of?", "length", "ljust", "lstrip", "lstrip!", "map", "match", "max", "me
mber?", "method", "methods", "min", "next", "next!", "nil?", "object_id", "oct",
 "partition", "private_methods", "protected_methods", "public_methods", "reject"
, "replace", "require", "require_gem", "respond_to?", "reverse", "reverse!", "ri
ndex", "rjust", "rstrip", "rstrip!", "scan", "select", "send", "singleton_method
s", "size", "slice", "slice!", "sort", "sort_by", "split", "squeeze", "squeeze!"
, "strip", "strip!", "sub", "sub!", "succ", "succ!", "sum", "swapcase", "swapcas
e!", "taguri", "taguri=", "taint", "tainted?", "to_a", "to_f", "to_i", "to_s", "
to_str", "to_sym", "to_yaml", "to_yaml_properties", "to_yaml_style", "tr", "tr!"
, "tr_s", "tr_s!", "type", "unpack", "untaint", "upcase", "upcase!", "upto", "zi
p"]

1.9.0
irb(main):001:0> "abc".methods.size
=> 153
irb(main):002:0> "abc".methods.sort
=> [:"!", :"!=", :"!~", :%, :*, :+, :<, :<<, :<=, :<=>, :==, :===, :=~, :>, :>=,
 :[], :[]=, :__id__, :__send__, :ascii_only?, :between?, :bytes, :bytesize, :cap
italize, :capitalize!, :casecmp, :center, :chomp, :chomp!, :chop, :chop!, :chr,
:class, :clear, :clone, :concat, :count, :crypt, :define_singleton_method, :dele
te, :delete!, :display, :downcase, :downcase!, :dump, :dup, :each_byte, :each_ch
ar, :each_line, :empty?, :encode, :encode!, :encoding, :end_with?, :enum_for, :e
ql?, :equal?, :extend, :force_encoding, :freeze, :frozen?, :gem, :gsub, :gsub!,
:hash, :hex, :include?, :index, :insert, :inspect, :instance_eval, :instance_exe
c, :instance_of?, :instance_variable_defined?, :instance_variable_get, :instance
_variable_set, :instance_variables, :intern, :is_a?, :kind_of?, :length, :lines,
 :ljust, :lstrip, :lstrip!, :match, :method, :methods, :next, :next!, :nil?, :ob
ject_id, :oct, :ord, :partition, :private_methods, :protected_methods, :public_m
ethod, :public_methods, :public_send, :replace, :respond_to?, :reverse, :reverse
!, :rindex, :rjust, :rpartition, :rstrip, :rstrip!, :scan, :send, :singleton_met
hods, :size, :slice, :slice!, :split, :squeeze, :squeeze!, :start_with?, :strip,
 :strip!, :sub, :sub!, :succ, :succ!, :sum, :swapcase, :swapcase!, :taint, :tain
ted?, :tap, :to_enum, :to_f, :to_i, :to_s, :to_str, :to_sym, :tr, :tr!, :tr_s, :
tr_s!, :unpack, :untaint, :upcase, :upcase!, :upto, :valid_encoding?]

共存できたかなあとおもったけど、展開するだけでした。

http://ftp.ruby-lang.org/pub/ruby/binaries/mswin32/unstable/

hは3つも引数が取れる

| hは3つも引数が取れる - たばさの を含むブックマーク はてなブックマーク - hは3つも引数が取れる - たばさの

なんとなくソースを覗くと

"  def h(a='H', b='w', c='!')\n"
"    puts \"#{a}ello, #{b}orld#{c}\"\n"
"  end\n"

なんという無( 思ったより凝っているようですね。

ruby-dev 流通量

ruby-dev 流通量 - たばさの を含むブックマーク はてなブックマーク - ruby-dev 流通量 - たばさの

盛り上がりっぷりを見ようと。

# rbdev-graph.rb
$g={}
open("rbdev-.txt"){|f|
  f.each{|i|
    if $g[i[0,8]]
      $g[i[0,8]]=$g[i[0,8]]+1 
    else
      $g[i[0,8]]=1
    end
  }
}

$g.sort.each{|d,n| puts d+" "+"."*n}

dataはこういうの。

97/07/28 23:51:40 [keiju bc.mbn.or] Re: [ruby-list:3486] Re: eval with dynamic binding [Re: meta programming features]

97/07/28 23:53:50 [matz netlab.co.] Re: [ruby-list:3516] Re: [Problem] for local class

97/07/28 23:53:52 [matz netlab.co.] Re: [ruby-list:3517] Re: meta programming features

ソートだと00/が頭にくる。まあエディタでごまかす。

97/07/28 ...

97/07/29 ............

97/07/31 ............

97/08/01 .....

97/08/02 .

97/08/03 ......

97/08/04 ......

97/08/05 ....

97/08/06 .....................

97/08/07 ....

97/08/08 ..................

97/08/11 .....

97/08/12 ..............

97/08/13 ............

97/08/14 ....

97/08/15 ..........

97/08/16 .......

97/08/17 ....

97/08/18 ..........

97/08/19 ................

97/08/20 ...........................

97/08/22 .........................

97/08/24 .

97/08/25 ...........................

97/08/26 .................

97/08/27 ...................

97/08/28 ..........................

97/08/29 ................

97/08/30 ...

97/08/31 ......

97/09/01 .................

97/09/02 ..........................

97/09/03 ...........

97/09/04 ......................

97/09/05 ............

97/09/08 .

97/09/09 ...........

97/09/10 ...............

97/09/11 ...................

97/09/12 .........

97/09/13 .

97/09/14 .

97/09/16 ........

97/09/17 ..

97/09/18 .......

97/09/19 ....

97/09/21 .

97/09/22 ..

97/09/23 .

97/09/24 .........

97/09/25 ..........

97/09/26 ......................

97/09/27 .......

97/09/29 ........

97/09/30 .............................

97/10/01 ...........................

97/10/02 ..............

97/10/03 ....

97/10/04 .

97/10/06 .........

97/10/07 ................................................

97/10/08 ........

97/10/09 .........

97/10/10 ......

97/10/12 ..

97/10/13 .......

97/10/14 ......

97/10/15 .........

97/10/16 ..

97/10/17 .

97/10/19 ..

97/10/20 .........

97/10/21 ..

97/10/22 .

97/10/23 ...

97/10/28 ....

97/10/29 ...

97/10/30 .....

97/10/31 .........

97/11/03 ...

97/11/04 ...

97/11/05 .......

97/11/06 ....

97/11/07 ...

97/11/08 ...

97/11/09 .....

97/11/10 ......

97/11/11 ............

97/11/12 ..

97/11/13 .

97/11/14 ..................

97/11/15 ..

97/11/17 .......

97/11/19 ..........

97/11/20 .........................................

97/11/21 ......

97/11/22 .

97/11/23 .

97/11/24 ...

97/11/25 ..

97/11/27 .............

97/11/28 ....

97/11/29 .

97/11/30 .

97/12/01 ...

97/12/05 .

97/12/06 .....

97/12/07 ....

97/12/08 .........................

97/12/09 .................

97/12/10 ...................................

97/12/11 ...................

97/12/12 ....................

97/12/13 ..

97/12/15 .....................

97/12/16 ...........

97/12/17 ..............

97/12/18 ..............................

97/12/19 .....

97/12/20 ..

97/12/24 ......

97/12/25 ......

97/12/26 ..........

97/12/30 ..

98/01/03 ...

98/01/04 ...

98/01/05 ............

98/01/06 ...............................

98/01/07 ............

98/01/08 ...........

98/01/09 ...........

98/01/10 .....

98/01/11 .

98/01/12 ...

98/01/13 .......

98/01/14 ..............

98/01/16 ..

98/01/20 ...

98/01/21 .........

98/01/22 ........

98/01/23 .......

98/01/24 ..

98/01/26 ...

98/01/27 ...

98/01/29 ...................

98/01/30 ......

98/02/01 .

98/02/02 ........

98/02/03 ........

98/02/04 ......

98/02/05 .........

98/02/06 .............

98/02/09 ...

98/02/10 .........................

98/02/11 .

98/02/12 .................

98/02/13 ....

98/02/16 .............

98/02/17 ..........

98/02/18 ...........

98/02/19 ............

98/02/20 ....

98/02/21 ..

98/02/22 ..

98/02/23 ...........

98/02/24 ........

98/02/25 ............

98/02/26 .......

98/02/27 ......

98/03/03 ...................

98/03/04 .................

98/03/05 ............

98/03/06 .

98/03/07 ......

98/03/08 ..

98/03/09 .............

98/03/10 .....................................

98/03/11 ......................................

98/03/12 ......................................................

98/03/13 ...........................

98/03/14 .........

98/03/15 ..

98/03/16 .....................

98/03/17 ....................................

98/03/18 .........

98/03/19 ...........

98/03/20 ....................

98/03/23 ...................

98/03/24 ........

98/03/25 ....................

98/03/26 ................

98/03/27 ..............

98/03/28 ...............

98/03/29 ..

98/03/30 ................

98/03/31 ...........

98/04/01 .

98/04/02 ........................

98/04/03 ............................

98/04/04 .

98/04/05 ....

98/04/06 ...............................

98/04/07 .............................................................................

98/04/08 ................................

98/04/09 ............

98/04/10 ...................

98/04/11 .....

98/04/12 .............

98/04/13 ...................................

98/04/14 ...............................

98/04/15 ........................................

98/04/16 ....................

98/04/17 ............................................

98/04/18 .

98/04/19 ...

98/04/20 .................

98/04/21 ...................

98/04/22 .........

98/04/23 ...................

98/04/24 ..................

98/04/25 .

98/04/26 ....

98/04/27 .............

98/04/28 .............

98/04/29 ..

98/04/30 .................

98/05/01 ....

98/05/02 .

98/05/03 ...

98/05/06 ..

98/05/07 .......

98/05/08 ...................

98/05/10 .

98/05/11 .....

98/05/12 ....

98/05/13 ......

98/05/14 ....................

98/05/15 .....................

98/05/16 ......

98/05/17 ....

98/05/18 ...................

98/05/19 ........................

98/05/20 ...............

98/05/21 .....

98/05/22 ..

98/05/23 ...

98/05/24 ..

98/05/25 .............

98/05/26 ...............

98/05/27 .......

98/05/28 ...........

98/05/29 ...........

98/05/31 .

98/06/01 ......

98/06/02 ......

98/06/03 ...

98/06/04 ..

98/06/07 .

98/06/08 ...

98/06/09 ...........

98/06/10 .....................

98/06/11 .............

98/06/12 ...........

98/06/13 .

98/06/15 ....

98/06/16 ................

98/06/17 .............

98/06/18 ...................

98/06/19 .......................

98/06/20 ....

98/06/21 ...

98/06/22 ...................

98/06/23 ...........................

98/06/24 .................

98/06/25 ...............

98/06/26 ..............................

98/06/27 ......

98/06/28 .

98/06/29 ............................

98/06/30 ..............................................

98/07/01 ............................................

98/07/02 ............

98/07/03 .................

98/07/04 ..

98/07/05 .

98/07/06 .........

98/07/07 ........

98/07/08 ....

98/07/09 ...............

98/07/10 .........

98/07/12 ....

98/07/13 ..................

98/07/14 .......

98/07/15 ......

98/07/16 .............................

98/07/17 ................

98/07/18 ......

98/07/19 .

98/07/20 ..

98/07/21 .............

98/07/22 .....

98/07/23 ..............................

98/07/24 ...........

98/07/25 ..

98/07/26 ...

98/07/27 .............

98/07/29 .....

98/07/30 ...........

98/08/05 ....

98/08/06 ..

98/08/13 .

98/08/15 .

98/08/16 .

98/08/17 ....

98/08/18 ..

98/08/19 ..

98/08/20 .

98/08/24 .......

98/08/25 .........

98/08/26 ..................

98/08/27 ....

98/08/28 ...

98/08/29 ..

98/09/08 ..

98/09/10 ..

98/09/12 .

98/09/13 .

98/09/14 .

98/09/15 ..

98/09/16 .

98/09/21 ....

98/09/22 .

98/09/24 ..

98/09/25 ...

98/10/13 ......

98/10/14 ..

98/10/16 ..

98/10/19 .

98/10/21 .

98/10/22 ...

98/10/23 .........

98/10/27 ..........

98/10/28 ..

98/10/29 ..

98/10/31 ..

98/11/01 ...

98/11/02 ....

98/11/09 ....

98/11/10 ....

98/11/11 .

98/11/12 ..

98/11/13 .

98/11/16 .

98/11/17 .........

98/11/18 .....

98/11/19 .

98/11/20 ......................

98/11/21 ..

98/11/22 ..........

98/11/23 ............

98/11/24 ...............

98/11/25 .................

98/11/26 ..........

98/11/27 ...

98/11/28 .......

98/11/30 ...........

98/12/01 ....................

98/12/02 ....

98/12/03 ......

98/12/04 .....

98/12/06 ....

98/12/07 .............

98/12/08 ..........

98/12/09 .................

98/12/10 ...

98/12/11 ..

98/12/12 .

98/12/13 ..

98/12/14 ................

98/12/15 ...............

98/12/16 ...........

98/12/17 ......................

98/12/18 .......

98/12/19 ........

98/12/20 ..

98/12/21 ......

98/12/22 ......................

98/12/23 .................

98/12/24 ...........................................

98/12/25 .........................

98/12/26 ...........

98/12/27 ...

98/12/28 ..............................

98/12/29 ......

98/12/30 ...

98/12/31 ....

99/01/01 ...

99/01/02 .

99/01/04 ...

99/01/05 .......

99/01/06 ...........

99/01/07 ....

99/01/08 ....

99/01/09 ......

99/01/10 ..

99/01/11 ..........

99/01/12 ....................

99/01/13 ....................................

99/01/14 .........................

99/01/15 .....

99/01/16 ......

99/01/17 .....

99/01/18 .............................................

99/01/19 .....................................

99/01/20 ....................

99/01/21 .......................

99/01/22 .......

99/01/23 .......

99/01/24 .

99/01/25 .........................

99/01/26 ...................................................................

99/01/27 .......................

99/01/28 .............................

99/01/29 ................

99/01/30 .............

99/01/31 .......................

99/02/01 ................................................

99/02/02 .............

99/02/03 ..........................................

99/02/04 ..................................................

99/02/05 ........................................................

99/02/06 .............................

99/02/07 .......................................

99/02/08 ........................

99/02/09 ...................................................................................

99/02/10 .......................................................

99/02/11 ........................................

99/02/12 .................................

99/02/13 ...............

99/02/14 ...............

99/02/15 ...................................

99/02/16 ..........................................

99/02/17 ...................................................

99/02/18 ..................................................................

99/02/19 .......................................................................

99/02/20 ....................................................

99/02/21 .....................

99/02/22 ....................................................

99/02/23 ............................................................

99/02/24 ............................................................................................

99/02/25 ..............................................................................................

99/02/26 ............................................................

99/02/27 .......

99/02/28 .........

99/03/01 ..................................................

99/03/02 ..........................................

99/03/03 .............................................

99/03/04 ....................................

99/03/05 ................................

99/03/06 ................................

99/03/07 ........................

99/03/08 .............................................................

99/03/09 ...............................

99/03/10 ........................................

99/03/11 ..............................

99/03/12 .......................................................................

99/03/13 ........

99/03/14 ...

99/03/15 .............

99/03/16 .....................................

99/03/17 ..........................

99/03/18 ................

99/03/19 ......

99/03/20 ........

99/03/21 ......

99/03/22 ............

99/03/23 .............................

99/03/24 .....................

99/03/25 ........................

99/03/26 ...............

99/03/27 ...

99/03/28 .

99/03/29 ...

99/04/02 ....

99/04/03 ..

99/04/04 ...

99/04/05 ......

99/04/06 .........

99/04/07 ...

99/04/08 ...

99/04/09 ......

99/04/10 ..

99/04/12 .............

99/04/13 .........

99/04/14 .........................

99/04/15 .....

99/04/16 .....

99/04/17 ..

99/04/18 ...

99/04/19 .......

99/04/22 ......

99/04/23 ...........

99/04/26 .........

99/04/27 .......

99/04/28 ......

99/04/29 .

99/04/30 ..................

99/05/01 ....

99/05/03 ..

99/05/04 ...

99/05/05 ..

99/05/06 ...................

99/05/07 ....

99/05/08 ..........

99/05/09 ....

99/05/10 ..............

99/05/11 .......

99/05/12 ...

99/05/13 ........................

99/05/14 ...................

99/05/15 .......

99/05/16 .

99/05/17 .............................................

99/05/18 ..............................

99/05/19 .....................

99/05/20 ................

99/05/21 ....................

99/05/23 ....

99/05/24 .............................

99/05/25 ........

99/05/26 .......

99/05/27 .......

99/05/28 ............

99/05/29 ...

99/05/30 ...

99/05/31 ...........

99/06/01 .........................

99/06/02 .........

99/06/03 .......

99/06/04 ..

99/06/05 .

99/06/06 .

99/06/08 .......

99/06/09 .......

99/06/10 ...

99/06/11 ........

99/06/12 ..

99/06/14 ..

99/06/15 ...........

99/06/16 ....

99/06/17 .....

99/06/18 .....

99/06/19 ......

99/06/20 .

99/06/21 ...............

99/06/22 ...............

99/06/23 ............................

99/06/24 ..............

99/06/25 ................

99/06/26 ..

99/06/27 ..

99/06/28 ................

99/06/29 .......

99/06/30 .........

99/07/01 ....

99/07/02 ..........

99/07/04 ..

99/07/05 .

99/07/06 .

99/07/07 .....

99/07/08 ....

99/07/09 .....

99/07/11 .

99/07/12 .

99/07/13 ........

99/07/15 ............

99/07/16 ............................

99/07/17 ...

99/07/18 ........

99/07/19 ....................

99/07/21 ............

99/07/22 .

99/07/23 ..................

99/07/25 ....

99/07/26 .....

99/07/27 ..............................

99/07/28 ............

99/07/29 .............

99/07/30 ..........................

99/07/31 ...........

99/08/01 ..........

99/08/02 ......

99/08/03 .....

99/08/04 .......

99/08/05 .....

99/08/06 ......

99/08/07 ..

99/08/08 .................

99/08/09 ...........

99/08/10 .............

99/08/11 ...................

99/08/12 ................

99/08/13 .....................................

99/08/14 .

99/08/15 ..........

99/08/16 ..................

99/08/17 .........

99/08/18 .................

99/08/19 ............

99/08/20 ....

99/08/21 ......

99/08/23 .

99/08/24 ....

99/08/25 ...

99/08/26 .....

99/08/29 ..

99/08/30 ............

99/08/31 ......

99/09/01 .

99/09/02 ...........

99/09/03 ................

99/09/04 .

99/09/06 ...

99/09/07 .......

99/09/08 ......

99/09/09 ........

99/09/10 ...

99/09/12 ....

99/09/13 ..

99/09/14 ....

99/09/15 ..

99/09/16 .........

99/09/17 ...............

99/09/18 .......

99/09/19 .....

99/09/20 ...

99/09/21 ......

99/09/22 .........

99/09/23 ........

99/09/24 ...

99/09/25 ..

99/09/26 .................

99/09/27 ......

99/09/28 ........

99/09/29 .......

99/09/30 ..

99/10/02 ..

99/10/03 ....

99/10/04 .....

99/10/06 .

99/10/07 ....

99/10/10 ....

99/10/11 ......

99/10/12 .........

99/10/13 ...........................

99/10/14 .....

99/10/15 ............

99/10/16 .....

99/10/17 ..............

99/10/18 ........

99/10/19 .....

99/10/20 ..............

99/10/21 ......

99/10/22 .....

99/10/23 ................

99/10/24 .............

99/10/25 ...

99/10/26 ..

99/10/27 .....

99/10/29 ...........

99/10/30 ..........

99/10/31 .......

99/11/01 ...........................................

99/11/02 ............

99/11/03 ......

99/11/04 ............

99/11/05 ............................

99/11/06 ..

99/11/07 ........

99/11/08 .........................

99/11/09 .....

99/11/10 ........

99/11/11 ...

99/11/12 ..

99/11/13 ..

99/11/14 ..

99/11/15 .....

99/11/16 .......

99/11/17 ........................

99/11/18 ......................

99/11/19 ..............

99/11/20 .........

99/11/21 .

99/11/22 .....

99/11/23 .

99/11/24 ............

99/11/25 ...................

99/11/26 ..

99/11/27 ..

99/11/28 ..

99/11/29 .....

99/11/30 ..............

99/12/01 ......................

99/12/02 ............................

99/12/03 ...............

99/12/04 .....

99/12/05 ....

99/12/06 .....................

99/12/07 ............................

99/12/08 .................................

99/12/09 ...

99/12/10 ........

99/12/11 .......

99/12/12 ..

99/12/13 ........

99/12/14 ..........

99/12/15 ..............

99/12/16 ....

99/12/17 ..

99/12/18 ...

99/12/20 ...

99/12/21 ............

99/12/22 ...........

99/12/23 ......

99/12/24 ..............

99/12/25 ......

99/12/26 ..

99/12/27 ...........

99/12/28 ..............

99/12/29 .............

99/12/30 ................

99/12/31 .........

00/01/01 .............

00/01/02 .

00/01/03 .....

00/01/04 ...........

00/01/05 ..............

00/01/06 .....................

00/01/07 ..................

00/01/08 ............

00/01/09 .....

00/01/10 .....

00/01/11 .............

00/01/12 .............

00/01/13 ...

00/01/14 ...

00/01/15 ..

00/01/16 ........

00/01/17 .........

00/01/18 ...........

00/01/19 ...........

00/01/20 ..............

00/01/21 ..............

00/01/22 .......

00/01/24 ....

00/01/25 .........

00/01/26 ..........

00/01/27 ..........

00/01/28 ...

00/01/29 .

00/01/30 ...

00/01/31 ..

00/02/01 .....

00/02/02 ........

00/02/03 ......

00/02/04 ................................................

00/02/05 ...............

00/02/06 .

00/02/07 ...................

00/02/08 ..........

00/02/09 ..................

00/02/10 ............

00/02/11 .............

00/02/12 .

00/02/13 ......

00/02/14 .........

00/02/15 ......

00/02/16 ........

00/02/17 ......................

00/02/18 ..

00/02/19 .

00/02/20 .....

00/02/21 ...

00/02/22 ....

00/02/23 .........

00/02/24 ........

00/02/25 ...

00/02/26 ..

00/02/27 ......

00/02/28 .....

00/02/29 ........................

00/03/01 ............

00/03/02 ...........

00/03/03 ..................

00/03/04 ...

00/03/05 ..

00/03/06 ............

00/03/07 .........

00/03/08 ...................

00/03/09 ........

00/03/10 ...

00/03/11 .....

00/03/12 ...

00/03/13 ......

00/03/15 ........

00/03/16 .

00/03/17 ..

00/03/18 ......

00/03/19 .

00/03/20 ....

00/03/21 ....

00/03/22 ........

00/03/23 ..

00/03/24 ..............

00/03/25 .......

00/03/26 .......

00/03/27 ...............

00/03/28 ........

00/03/29 ...

00/03/30 ........

00/03/31 ......

00/04/01 ......

00/04/02 .

00/04/03 ..

00/04/04 ...

00/04/05 ..

00/04/06 ...

00/04/07 .

00/04/09 .

00/04/10 ...

00/04/11 .

00/04/12 .....

00/04/14 ......

00/04/15 .

00/04/16 ...

00/04/17 ..

00/04/18 ..............

00/04/19 ....

00/04/21 .......

00/04/22 ..

00/04/23 .

00/04/24 .

00/04/27 ..

00/05/02 ......

00/05/03 ......

00/05/04 ...

00/05/05 ...

00/05/06 .

00/05/07 .

00/05/08 .....

00/05/09 ........

00/05/10 ......

00/05/11 ...........

00/05/12 .....

00/05/13 ......

00/05/14 .........

00/05/15 ..................

00/05/16 ...................

00/05/17 ......................

00/05/18 ..................

00/05/19 ..........

00/05/20 ........

00/05/21 ........

00/05/22 ....

00/05/23 ............

00/05/24 .............

00/05/25 .............................................

00/05/26 ..............

00/05/27 ..

00/05/28 .......

00/05/29 .......................

00/05/30 .............

00/05/31 ................

00/06/01 ................

00/06/02 .....

00/06/03 ..

00/06/04 ...

00/06/05 ..

00/06/06 ............

00/06/07 ......

00/06/08 .....

00/06/09 ..............

00/06/10 .......

00/06/12 .....

00/06/13 ........................

00/06/14 ........

00/06/15 ..........

00/06/16 ..............

00/06/17 .....

00/06/18 .........

00/06/19 ........

00/06/20 ......

00/06/21 ......

00/06/22 .....

00/06/23 ..............

00/06/24 .

00/06/25 ..

00/06/26 .

00/06/27 .................

00/06/28 .........

00/06/30 ...

00/07/01 .......

00/07/02 ......

00/07/03 ................

00/07/04 ........................

00/07/05 ...........................

00/07/06 ....................

00/07/07 ..........

00/07/08 ...

00/07/09 .

00/07/10 .....

00/07/11 ................

00/07/12 ................

00/07/13 ..............

00/07/14 ........

00/07/15 ......

00/07/16 ....

00/07/17 ...

00/07/18 ......

00/07/19 .......

00/07/20 ..

00/07/21 ..

00/07/23 ....

00/07/24 ..............

00/07/25 .....................

00/07/26 ..............................

00/07/27 .........

00/07/28 .........

00/07/29 .......

00/07/30 .

00/07/31 ................

00/08/01 ..........................

00/08/02 .................

00/08/03 ..................................

00/08/04 .................................

00/08/05 ..........

00/08/06 .

00/08/07 .............

00/08/08 ...........

00/08/09 ..

00/08/10 .

00/08/11 ..

00/08/12 ....

00/08/13 ...

00/08/14 .....

00/08/15 ..........

00/08/16 ...

00/08/17 ...

00/08/18 ..

00/08/19 .

00/08/20 ....

00/08/21 .........

00/08/22 .....

00/08/23 ......

00/08/24 ..

00/08/25 ...

00/08/26 .....

00/08/27 ..

00/08/28 ..............

00/08/29 ................

00/08/30 ..................................

00/08/31 ..............

00/09/01 .............................

00/09/02 ............

00/09/03 .......

00/09/04 ................

00/09/05 .................

00/09/06 ....

00/09/07 ..........

00/09/08 .............

00/09/09 ...

00/09/10 ....

00/09/11 .......

00/09/12 ..............

00/09/13 .........

00/09/14 .........

00/09/15 ...

00/09/16 ........

00/09/17 ......

00/09/18 ..........

00/09/19 ..............................

00/09/20 ........

00/09/21 .................................

00/09/22 ...................

00/09/23 ...........

00/09/24 .......

00/09/25 .........

00/09/26 ...........

00/09/27 .........

00/09/28 ......

00/09/29 ........

00/09/30 ..

00/10/01 ....

00/10/02 ...

00/10/03 .........

00/10/04 ...............

00/10/05 ...

00/10/06 ......

00/10/07 ..

00/10/09 ....

00/10/10 .............

00/10/11 ...........

00/10/12 .................

00/10/13 ....................

00/10/14 ..........

00/10/15 ..............

00/10/16 ...................

00/10/17 ...........

00/10/18 ....

00/10/19 ......

00/10/20 .....

00/10/22 ....

00/10/23 ........

00/10/24 ....

00/10/25 ..

00/10/26 ...

00/10/27 ........

00/10/29 ........

00/10/30 .........................

00/10/31 ..........

00/11/01 ..........

00/11/02 .............

00/11/03 ..

00/11/04 ..

00/11/06 ...........

00/11/07 ........................

00/11/08 ..................................

00/11/09 ............

00/11/10 .............

00/11/11 ...........

00/11/12 .....

00/11/13 ...........

00/11/14 ..................

00/11/15 ..........................

00/11/16 ..............................

00/11/17 .............

00/11/18 .

00/11/19 ....................

00/11/20 ..................

00/11/21 ........

00/11/22 .....

00/11/23 ...

00/11/24 ..

00/11/25 .....

00/11/26 ..

00/11/27 ..........

00/11/28 ..........

00/11/29 ....

00/11/30 ...

00/12/01 ...

00/12/02 ....

00/12/03 ......

00/12/04 .........

00/12/05 .......

00/12/06 ..............

00/12/07 ...............

00/12/08 ....

00/12/09 .....

00/12/11 ...

00/12/12 ..

00/12/13 ....

00/12/14 ...

00/12/15 ..........

00/12/16 ........

00/12/17 .....

00/12/18 .........

00/12/19 ...........

00/12/20 ........

00/12/21 .........

00/12/22 ..

00/12/23 .

00/12/24 ..........

00/12/25 ....................

00/12/26 ........................

00/12/27 ...........

00/12/28 ...........

00/12/29 .....

00/12/30 ........

00/12/31 ....

01/01/01 ..

01/01/03 ...

01/01/04 .

01/01/05 ........

01/01/06 ...................

01/01/07 ..

01/01/08 ....

01/01/09 .

01/01/10 ......................

01/01/11 ...............

01/01/12 ...............

01/01/13 ........

01/01/14 .....

01/01/15 .............

01/01/16 ...

01/01/17 ..

01/01/18 ......

01/01/19 ..........

01/01/20 .

01/01/21 ...

01/01/22 ..............

01/01/23 ........

01/01/26 ....

01/01/27 .............

01/01/28 ...............

01/01/29 ........................

01/01/30 .........

01/01/31 .

01/02/03 .............

01/02/04 .........

01/02/05 ........

01/02/06 ................

01/02/07 ......

01/02/08 .

01/02/09 .................

01/02/11 .

01/02/12 .....

01/02/13 ..........

01/02/14 .................

01/02/15 .....

01/02/16 .....

01/02/17 .....

01/02/18 ............

01/02/19 .........

01/02/20 ....

01/02/21 ....

01/02/23 .

01/02/24 ...

01/02/25 ...

01/02/26 .............

01/02/27 ...........

01/02/28 .........

01/03/01 ........

01/03/02 ............

01/03/03 .

01/03/04 ..

01/03/05 ............

01/03/06 ................

01/03/07 ..........

01/03/08 ........

01/03/09 .......

01/03/10 ...........

01/03/11 ...

01/03/12 ....................

01/03/13 ...............................

01/03/14 .................

01/03/15 ...................................

01/03/16 ..................

01/03/17 ...

01/03/18 ........

01/03/19 ......................

01/03/20 ...................

01/03/21 ........

01/03/22 .............................

01/03/23 ...................

01/03/24 ....................

01/03/25 .......

01/03/26 ......

01/03/27 ......

01/03/28 .............

01/03/29 ....

01/03/30 .....

01/03/31 .....

01/04/01 ......

01/04/02 .................

01/04/03 ........

01/04/04 .......................

01/04/05 ...................

01/04/06 ......

01/04/07 ....

01/04/08 ......

01/04/09 ............................

01/04/10 ............................

01/04/11 ............................

01/04/12 .......................

01/04/13 ..............................

01/04/14 .............

01/04/15 ....

01/04/16 ....................

01/04/17 .............

01/04/18 .............

01/04/19 .......

01/04/20 ........

01/04/21 .

01/04/22 ...

01/04/23 ....

01/04/24 ........

01/04/25 .........

01/04/26 ....

01/04/27 .

01/04/28 ......

01/04/29 ...

01/04/30 ...........

01/05/01 .........

01/05/02 ......

01/05/03 .................

01/05/04 .........

01/05/05 ..

01/05/06 ...

01/05/07 ....................

01/05/08 ................

01/05/09 .......

01/05/10 ........

01/05/11 .....

01/05/13 ......

01/05/14 ..................

01/05/15 ...........

01/05/16 ..................

01/05/17 ...........

01/05/18 .................

01/05/19 .......

01/05/20 ..

01/05/21 ....................

01/05/22 .............

01/05/23 ......

01/05/24 ..............................

01/05/25 ......................

01/05/26 ......

01/05/27 ...

01/05/28 ..........................

01/05/29 .....................

01/05/30 ........

01/05/31 .............

01/06/01 .........

01/06/02 ..........

01/06/03 ...

01/06/04 .......

01/06/05 ........................

01/06/06 .......

01/06/07 ........

01/06/08 ......................

01/06/09 ...............

01/06/10 .....

01/06/11 .......

01/06/12 .............

01/06/13 .................

01/06/14 .......................

01/06/15 .......

01/06/16 .

01/06/17 ....

01/06/18 .......

01/06/19 ...

01/06/20 ...

01/06/22 ..

01/06/23 ....

01/06/24 ......

01/06/25 .........

01/06/26 .........................

01/06/27 .............

01/06/28 ............

01/06/29 .................

01/06/30 ......

01/07/01 ....

01/07/02 ........

01/07/03 .....................

01/07/04 ...

01/07/05 .....

01/07/06 ....

01/07/07 ...

01/07/08 ...

01/07/09 ...........................

01/07/10 .....................

01/07/11 ...

01/07/12 ...

01/07/13 ...........................

01/07/14 ...............

01/07/15 ...........

01/07/16 ...............................

01/07/17 ................

01/07/18 ..

01/07/19 ...............

01/07/20 ..............

01/07/21 ...........................

01/07/22 .......

01/07/23 ...........................

01/07/24 .......................

01/07/25 .............................................

01/07/26 ...........................................

01/07/27 ..................

01/07/28 ............

01/07/29 ......

01/07/30 ......

01/07/31 ..................

01/08/02 .........

01/08/03 .....

01/08/04 .......

01/08/05 ......................................................................

01/08/06 ...............................................................................................

01/08/07 ..............

01/08/08 ...

01/08/09 ..............

01/08/10 .....................

01/08/11 ....

01/08/12 .......

01/08/13 .....

01/08/14 ...................

01/08/15 .................

01/08/16 ......................................

01/08/17 ...........

01/08/18 ..

01/08/19 ...

01/08/20 ...........

01/08/21 .......

01/08/22 .....

01/08/23 ........

01/08/24 ......

01/08/25 .

01/08/26 ......

01/08/27 .........

01/08/28 .........

01/08/29 ..

01/08/30 ....

01/08/31 .....

01/09/01 .

01/09/02 .......

01/09/03 ..........................

01/09/04 ........

01/09/05 ......................................

01/09/06 .............................................

01/09/07 ..........

01/09/08 ..............

01/09/09 ....

01/09/10 .......

01/09/11 ...

01/09/12 ........

01/09/13 ....

01/09/14 .

01/09/15 ......

01/09/16 ......

01/09/17 ...

01/09/18 ....

01/09/19 .

01/09/20 ...

01/09/21 .

01/09/22 .

01/09/23 ..

01/09/24 .

01/09/25 .....

01/09/26 .....

01/09/27 ....

01/09/28 ....

01/09/29 ..

01/10/01 ..

01/10/02 ..........

01/10/03 .............................

01/10/04 ...................

01/10/05 .........

01/10/09 .....

01/10/11 ....

01/10/12 ......

01/10/14 ......

01/10/15 ..........

01/10/16 ...................

01/10/17 ...

01/10/18 ......

01/10/19 ........

01/10/22 ...........

01/10/23 .......

01/10/24 ........

01/10/25 ......

01/10/26 ......

01/10/27 .

01/10/28 .

01/10/29 .

01/10/30 ....

01/10/31 .....

01/11/01 .....

01/11/02 .

01/11/03 ......

01/11/05 .....

01/11/06 .....

01/11/07 .................

01/11/08 ........

01/11/09 ............................

01/11/10 ....

01/11/11 .....

01/11/12 ..................................

01/11/13 .................

01/11/14 .......

01/11/15 .............

01/11/16 ....................

01/11/17 .........

01/11/18 ..

01/11/19 ..............

01/11/20 ..........

01/11/21 ..

01/11/22 .....

01/11/23 ..

01/11/26 ...........

01/11/27 .......

01/11/28 ...............

01/11/29 ...............................

01/11/30 ...................

01/12/01 .

01/12/02 .....

01/12/03 ........

01/12/04 ..............

01/12/05 ...........

01/12/06 ..................

01/12/07 .........

01/12/08 ..........

01/12/09 ..

01/12/10 .......

01/12/11 ..........

01/12/12 ......

01/12/13 .....

01/12/14 ...................

01/12/15 ........

01/12/16 ...

01/12/17 .................

01/12/18 .............

01/12/19 ...........

01/12/20 ...

01/12/21 ...................

01/12/22 .........

01/12/24 ......

01/12/25 ....

01/12/26 ........

01/12/27 ................

01/12/28 ..........................

01/12/29 ......

01/12/30 .......

01/12/31 .........

02/01/01 .

01/02 ...

01/04 ......

01/05 ...............

01/06 ..

01/07 ..............

01/08 ......

01/09 ..

01/10 .....

01/11 .....

01/12 .

01/13 ..

01/14 ....

01/15 ..

01/16 ............

01/17 .........

01/18 ..............

01/19 ......

01/20 .....

01/21 ..............

01/22 ....

01/23 ....

01/24 ...

01/25 .......

01/26 .......

01/27 ...

01/28 .................

01/29 ..........

01/30 ................

01/31 ...........

02/01 ...........

02/02 ...

02/03 ..

02/04 .....

02/05 ........

02/06 ....

02/07 ...

02/08 ......

02/09 .

02/10 .....

02/11 .

02/12 ....

02/13 ...

02/14 ...

02/15 .........

02/16 ......

02/17 .......

02/18 ........................................

02/19 ...........................

02/20 ....................

02/21 ................................

02/22 ............

02/23 ......

02/24 ........

02/25 ........................

02/26 ...........................................

02/27 ..........................

02/28 .....

03/01 ........

03/02 ..........

03/03 .............

03/04 ..........................

03/05 .............

03/06 .................

03/07 ..........................

03/08 ..........................

03/09 ............

03/10 ....

03/11 ........................

03/12 .....................

03/13 ..................

03/14 .............................

03/15 ......................

03/16 ........

03/17 ........

03/18 ..........................................

03/19 ..................

03/20 .................

03/21 ....

03/22 ........................

03/23 .....

03/24 .............................

03/25 ...............

03/26 .......................

03/27 ...............

03/28 ....................

03/29 ....................................

03/30 .

03/31 ........

04/01 ...........

04/02 ...................

04/03 ...................

04/04 ...........

04/05 .......

04/06 ............

04/07 ......

04/08 ..............

04/09 ..................

04/10 ...................

04/11 .........................

04/12 .................................

04/13 .............

04/14 ....

04/15 ...........

04/16 ....................

04/17 .........

04/18 .................

04/19 ..............

04/20 ..

04/21 ..

04/22 ...

04/23 ..

04/24 ...

04/25 ..

04/26 .....

04/28 ..

04/29 .

05/01 ....

05/03 ....

05/04 ...

05/06 ..

05/07 .....

05/08 ....

05/09 ........

05/10 .....................

05/11 ...

05/12 .....

05/13 ............................

05/14 .....................

05/15 ......

05/16 ...........

05/17 ........

05/18 .........

05/19 ..........

05/20 .........

05/21 ................

05/22 ................

05/23 .....................

05/24 ..

05/25 .

05/26 .

05/28 ..

05/29 ..

05/30 ..................

05/31 ....................

06/01 .......

06/02 ..............

06/03 ....................

06/04 ..................

06/05 ......

06/06 .......

06/07 .................................

06/08 ..

06/09 .

06/10 ..

06/11 ..........................

06/12 .............

06/13 ................................

06/14 .....

06/15 ..........

06/16 .................

06/17 .......................

06/18 ....................

06/19 ..............

06/20 .

06/21 ...........

06/22 ........

06/23 ....

06/24 .......................

06/25 ................

06/26 ..........

06/27 ..........

06/28 ..

06/29 .

07/01 .

07/02 ..........

07/03 .......................

07/04 ....................

07/05 ............

07/06 ....

07/08 ..

07/09 .

07/10 ..

07/11 .........

07/12 ...

07/13 ....

07/14 .

07/18 ........

07/19 ........

07/20 ...................

07/21 ...............

07/22 ........

07/23 .................

07/24 ..............................

07/25 ................

07/26 ..............

07/27 ..........

07/31 .................

08/01 ........

08/02 .............

08/03 ....................

08/04 .......

08/05 ................

08/06 ..................

08/07 ........

08/08 ......

08/09 .....

08/10 ..

08/11 ....

08/12 ...........

08/13 ...................

08/14 .........

08/15 ........

08/16 .........

08/18 .

08/19 ....

08/20 ..............

08/21 .........

08/22 ...........

08/23 ....

08/24 ...

08/25 ..

08/26 ....

08/27 ..........

08/28 ..

08/29 ......

08/30 .............

08/31 ....

09/01 ....................

09/02 ................

09/03 ..............

09/04 ..........

09/05 ...............

09/06 ..................

09/07 ..........

09/08 .......

09/09 ..................

09/10 ..........

09/11 ..............

09/12 ......

09/13 .......

09/14 .......

09/15 ..

09/16 ..........

09/17 ..........

09/18 ....

09/19 ....

09/20 ..

09/21 ..........

09/22 ........................

09/23 ......

09/24 ........

09/25 ....

09/26 ..................

09/27 .........

09/28 ..................

09/30 ..

10/01 ...

10/02 .................

10/03 ............

10/04 .....

10/05 .

10/06 ...

10/07 .

10/09 .........

10/10 .................

10/11 ......

10/12 ...........

10/13 ..........

10/14 .

10/15 ........

10/16 .........

10/18 ....

10/19 ...

10/20 ...

10/21 .....

10/22 ..................

10/23 ......

10/24 ........

10/25 .

10/26 .

10/28 .................

10/29 .....

10/30 .........

11/01 ..

11/03 ................

11/04 ...........

11/05 ....

11/06 ....................

11/07 ..............

11/08 ..............................

11/09 ..............

11/10 ........

11/11 ............

11/12 ..........

11/13 ...................

11/14 .............

11/15 ........................

11/16 ..

11/17 ......

11/18 ....................

11/19 ...........

11/20 .............

11/21 ..................

11/22 ...........................................

11/23 .........

11/24 ......

11/25 ..........

11/26 ....

11/27 ........

11/28 ..........

11/29 ...

11/30 ....

12/01 .

12/02 ..........

12/03 .........

12/04 ....

12/05 .......

12/06 ...............

12/07 ........

12/08 .....

12/09 ..

12/10 ......

12/11 .....

12/12 .........

12/13 ........

12/14 ..

12/15 .

12/16 ...........

12/17 ...............

12/18 ....................

12/19 ......

12/20 ..........................

12/21 ............

12/22 ...

12/23 ....

12/24 ...........

12/25 .............

12/26 ............

12/27 ...........

12/28 ...........

12/29 .............

12/30 .....

12/31 .............

03/01/01 ......................

01/02 .......

01/03 ...........

01/04 .......

01/05 ...

01/06 ........

01/07 .

01/09 ............................

01/10 ........

01/11 .

01/12 .

01/14 .....

01/15 ....

01/17 ...........

01/18 .....

01/19 .

01/20 .....................

01/21 ......

01/22 .............

01/23 .....

01/24 ..........

01/25 .

01/26 ....

01/27 ..

01/28 ...

01/29 .

02/01 .......

02/02 ....

02/03 ..............

02/04 ..........................

02/05 .....

02/06 ...........

02/07 ...................

02/08 .......

02/09 .....

02/10 ...

02/11 .....

02/12 ..

02/13 .....

02/14 .............

02/15 .......

02/16 .......

02/17 ........

02/18 ......

02/19 .........

02/20 .............

02/21 ............

02/22 ...........

02/23 .

02/24 ......

02/25 ............

02/26 .................

02/28 ..

03/01 ..

03/02 ...

03/03 ....................

03/04 ................................

03/05 ..........

03/07 ...............

03/08 .....

03/09 ..........

03/10 .......

03/11 .........

03/12 ..............

03/13 .............

03/14 .

03/17 .......

03/18 .........

03/19 .............

03/20 ..........

03/21 ........

03/22 ......

03/23 ......

03/24 .............

03/25 .............

03/26 ......

03/27 ......

03/28 .................

03/29 .......

03/30 .

03/31 .....

04/01 ..

04/02 .

04/03 ..

04/04 .

04/05 ....

04/06 .

04/07 ......

04/08 .......

04/09 ..

04/10 ...........................

04/11 ........

04/12 ..

04/13 ...

04/14 ...........

04/18 ........

04/20 .......

04/21 ................

04/22 ...

04/23 ...............

04/24 .....

04/25 ...........

04/26 ....

04/27 .

04/28 .........

04/29 .....

04/30 ...........

05/01 ..........

05/02 .........

05/03 ......

05/04 ...

05/05 ..............

05/06 ........

05/07 .....

05/08 ..

05/09 ...

05/11 ..

05/12 ..

05/13 .

05/14 .

05/15 ....

05/16 .

05/17 ..

05/18 ....

05/19 .............................

05/20 .......................

05/21 ..............

05/22 ..........

05/23 ........

05/26 .....

05/27 ........

05/28 ........

05/29 .

05/30 ..

05/31 ...

06/01 ...

06/02 .

06/03 ....

06/04 ......

06/05 ......

06/06 ..

06/08 .....

06/09 ..

06/10 ..

06/11 .

06/14 ....

06/15 .

06/16 ........

06/17 ...

06/18 .........

06/19 .......

06/20 ...................

06/21 .........

06/22 ....

06/23 .................

06/24 ....................

06/25 ...............

06/26 ....

06/27 .................

06/28 ......

06/29 .

07/01 ...

07/03 .......

07/04 ..................

07/05 ...

07/07 .............

07/08 .............................

07/09 ....................

07/10 .......................................

07/11 ..............

07/12 .......

07/13 .........

07/14 .............

07/15 .........................

07/16 ...............

07/17 ............

07/18 ..............

07/19 ...

07/20 ...

07/21 ........................

07/22 .......................................

07/23 .....................................................

07/24 .......................

07/25 ..............................

07/26 .........................

07/27 ...............

07/28 ......................................

07/29 ........................

07/30 ........................

07/31 ...............

08/01 .............

08/02 ........................

08/03 ...........................

08/04 .........................

08/05 .................

08/06 .........

08/07 ..........

08/08 .....

08/10 .

08/11 ........

08/12 .......

08/13 ...

08/14 .........

08/15 ....

08/17 .

08/18 ...

08/19 ...

08/21 .........

08/22 ....

08/23 .........................

08/24 ..

08/25 ......

08/26 .......

08/27 ........

08/28 ..

08/29 ..............

08/30 ...

08/31 .

09/01 ........

09/03 ......................

09/04 ......................

09/05 ...........

09/06 ....

09/08 ..

09/09 ..

09/10 .........

09/11 ..

09/12 ..

09/13 ..

09/15 .

09/16 ..

09/17 ........

09/18 ..........

09/19 .

09/22 .

09/25 ....

09/26 ........

09/27 ..

09/28 .......

09/29 ........

09/30 ...............

10/01 ............

10/02 ..........

10/03 ..........

10/04 ...

10/05 .......................

10/06 ...................

10/07 ................

10/08 ..........

10/09 ...................................

10/10 ...........

10/11 ...

10/12 .....

10/13 .....

10/14 .....

10/15 ...........

10/17 .

10/18 .

10/19 .......

10/20 ..................

10/21 ..............

10/22 ..........

10/23 ......................

10/24 .......

10/25 ..............

10/26 .....

10/27 ........

10/28 .........

10/29 ........................

10/30 .......................

10/31 .........

11/01 ............

11/02 ........

11/03 ...

11/04 ......

11/05 .................

11/06 ...............

11/07 ........

11/08 ..........

11/09 ....

11/10 ..

11/11 .............

11/12 ......................

11/13 .

11/14 ......

11/16 .

11/17 ..........

11/18 ..............

11/19 ....................

11/20 ...............

11/21 .............

11/22 ..........

11/24 .......

11/25 ...................................

11/26 ...........

11/27 .....

11/28 ....

11/29 ............

11/30 .........

12/01 ................

12/02 ........

12/03 ..........

12/04 ..............

12/05 .........................

12/06 ..........

12/07 .....

12/08 .....

12/09 ............

12/10 ............................

12/11 .........

12/12 ................

12/13 ......................

12/14 .......

12/15 ................

12/16 ....

12/17 .

12/18 .

12/19 ......

12/20 ...........

12/21 ...

12/22 ......

12/23 .....................

12/24 ............................................

12/25 ..................................

12/26 ........

12/27 ......

12/28 .......

12/29 ....

12/30 ..........

12/31 ......

04/01/01 ....

01/02 .........

01/03 .....

01/04 ...

01/05 ...

01/06 .............

01/07 ........................................

01/08 ........

01/09 ....

01/10 ........

01/11 ........

01/12 ....

01/13 ....

01/14 ...

01/15 ....

01/16 ................

01/17 ....

01/18 ..............

01/19 ..........

01/20 ...................

01/21 .........

01/22 ..............

01/23 ..

01/24 .

01/25 ......

01/26 ......

01/27 ...............................

01/28 ..................................

01/29 ...............................

01/30 .....

01/31 .........

02/01 ...

02/02 .

02/03 .

02/04 ..

02/06 .........

02/07 ............

02/08 ...............

02/09 ........

02/10 ........

02/12 ....

02/13 .

02/14 .....................

02/15 ............

02/16 ...................

02/17 ........................

02/18 ....................

02/19 ......

02/20 .................................

02/21 .....

02/22 ...

02/23 ........

02/24 ...

02/25 .....

02/26 ...........

02/27 .............

02/28 ................

02/29 ............

03/01 .................

03/02 ..................

03/03 ......

03/04 .................

03/05 .............

03/06 ............

03/07 ........

03/08 ............

03/09 ......

03/10 .

03/11 .

03/12 ......

03/13 ...

03/14 ....

03/15 ..

03/16 ...

03/17 .

03/18 ...

03/20 .....

03/23 ..

03/24 ....

03/25 .......

03/26 ..........

03/27 .......

03/28 ............

03/29 .....

03/30 .......................

03/31 ...........

04/01 ......

04/02 ....................

04/03 .

04/04 ..

04/05 .........

04/06 ...........

04/07 ....

04/08 .............

04/09 ....

04/10 .

04/11 ........

04/12 ....

04/13 ..

04/15 .............

04/16 ................

04/19 .

04/20 ...........

04/21 .......

04/22 ....

04/23 ........

04/24 .

04/26 ...

04/27 .......

04/28 .........

04/29 .

04/30 ...

05/05 .

05/06 .....

05/07 .........

05/08 .........

05/11 .

05/12 .

05/13 .........

05/14 ...............

05/15 ......

05/16 ....

05/17 ............

05/18 ...

05/19 ........

05/20 .........

05/21 ......

05/22 ......

05/23 ...............

05/24 .....................

05/25 ................

05/26 .............

05/27 .....................

05/28 .......

05/29 ...

06/02 ...

06/03 ..

06/04 .

06/06 ..

06/09 .....

06/10 ..

06/11 ........

06/12 ....

06/15 ...

06/16 .......

06/17 ................

06/18 .

06/19 ...........

06/21 ............

06/22 ............

06/23 ........

06/24 ..................

06/25 .......................

06/26 .................

06/27 ....

06/28 ........

06/29 ...

06/30 ........

07/01 ...........

07/02 ..

07/04 ......

07/05 .....

07/06 ....

07/07 ..

07/09 .....

07/10 .

07/11 .

07/12 .....

07/13 ...

07/14 .....................

07/15 ....

07/16 ......................

07/17 .....

07/18 ...

07/19 ....

07/21 ...

07/22 .......

07/23 ........

07/24 .

07/25 ..

07/26 .......

07/27 ........

07/28 .......

07/30 ..........

07/31 .........

08/01 ...

08/02 ....

08/03 .

08/04 ..

08/05 .

08/06 .........

08/08 .

08/09 ............

08/10 .........

08/11 .....

08/12 .............

08/13 ..

08/14 ........

08/15 .

08/16 ............

08/17 ...........

08/18 ..............

08/19 ................

08/20 .............

08/21 .......

08/22 ..

08/24 ................

08/25 .......

08/26 ........

08/27 ..

08/28 ..

08/29 ........

08/30 ...

09/01 ..

09/02 ...

09/03 ..........

09/04 .

09/05 ........

09/06 ......

09/07 .....

09/08 ..

09/09 ....

09/10 .......

09/11 ...

09/12 ..

09/13 ......

09/14 ......

09/15 .......

09/16 .....

09/17 ....

09/18 ...

09/19 ...

09/20 .........

09/21 ....

09/22 ..........

09/23 ..............

09/24 ......

09/25 ............

09/26 ....

09/27 ..................

09/28 ..

09/29 ...

09/30 .......

10/01 ....

10/02 ......................

10/03 ....

10/04 ........................

10/05 ..

10/06 .....

10/07 .......

10/08 .........

10/09 ......

10/10 ..

10/11 ................

10/12 .........

10/13 ..

10/14 ..

10/15 .......

10/16 ....

10/17 .......

10/18 ..........

10/19 ..........

10/20 ..................

10/21 ..............

10/22 .....

10/23 ...........

10/24 ........

10/25 .......

10/26 ........

10/27 ....................

10/28 .....

10/29 ................

10/30 ......

10/31 .......

11/01 ...............

11/02 ................

11/03 ..................

11/04 ...

11/05 ...................

11/06 ........

11/07 ...

11/08 ............

11/09 ................

11/10 ..

11/11 ................

11/12 .................

11/13 ..........................

11/14 ...................

11/15 ..............

11/16 .................

11/17 .......................

11/18 ..................

11/19 .............

11/20 ........

11/21 .

11/22 ......

11/23 ......

11/24 ...

11/25 ...

11/26 .....

11/27 ............

11/28 .........

11/29 .......

11/30 ............

12/01 ...............

12/02 .............

12/03 .......

12/04 ......

12/05 .............

12/06 ........................

12/07 ......................

12/08 ............................

12/09 .................

12/10 .

12/11 ........

12/12 ...

12/13 ..........................

12/14 ...........

12/15 ..............

12/16 ..............

12/17 ................

12/18 .......

12/19 ..

12/20 ..........

12/21 ..........

12/22 ...............

12/23 ......

12/24 ..................

12/25 .............

12/26 ................

12/27 ..................

12/28 ......

12/29 ..

12/30 .....

12/31 .

05/01/01 .............

01/02 ......

01/03 ......

01/04 .....

01/05 ........

01/06 ...........

01/07 .......

01/08 .....

01/09 ..............

01/10 .....

01/11 ..........

01/12 ....

01/13 ....

01/14 ..

01/15 ......

01/16 ..

01/17 ......

01/22 ..

01/23 ...

01/24 ....

01/25 .........................

01/26 ............................

01/27 ..................

01/28 ..................

01/29 ...

01/30 .......

01/31 ..........

02/01 .......

02/02 ......

02/03 .........

02/04 ......

02/05 ....

02/06 .....

02/07 ........

02/08 ..........

02/09 ....

02/10 ....

02/11 ....

02/12 .............

02/13 .......

02/14 ....

02/15 ....

02/16 .....

02/17 ....

02/18 ........

02/19 .....

02/20 ......

02/21 ..........

02/22 ........

02/23 .....

02/24 ..........

02/25 .......

02/26 ...

02/27 ..

02/28 ..

03/01 ...

03/02 ..............

03/03 .......

03/04 .........

03/05 .

03/06 ....

03/07 ............

03/08 ............

03/09 ......

03/10 .........

03/11 ...........

03/12 ..

03/13 ......

03/14 ............................

03/15 .................

03/16 .........

03/17 .

03/22 .

03/23 ............

03/25 ..

03/27 ........

03/28 ...

03/29 .........

03/30 ....

03/31 ......

04/02 ..

04/03 .....

04/04 ............

04/05 .

04/06 ...

04/07 ....

04/08 ...

04/09 ....

04/10 ...

04/11 .........

04/12 ................

04/13 ..........

04/14 ..............

04/15 ...............

04/16 .

04/17 ...

04/18 ..

04/19 ......

04/20 ..

04/21 ....

04/22 ..

04/23 .....

04/26 .....

04/27 ..

04/29 ....

04/30 .........

05/01 .....

05/02 ..

05/06 .

05/08 .......

05/11 .........

05/12 ...............

05/13 .

05/14 ....

05/15 ...........

05/17 .....

05/18 .......

05/19 ...

05/20 ...

05/21 ....

05/22 ......

05/23 ................

05/24 ....

05/25 ..........

05/26 ......

05/27 .......

05/28 ..

05/29 .

05/31 ......

06/01 ......

06/02 ........

06/03 .....

06/04 .....

06/05 ...............

06/06 ...

06/07 ......

06/08 .......

06/09 ..........

06/10 .........

06/11 ........

06/12 ..........

06/13 .......

06/14 ..

06/18 ..

06/20 .....

06/22 ..

06/23 .........

06/24 ...

06/25 ......

06/26 ...

06/27 ........

06/28 .........

06/29 .

06/30 ...............

07/01 ......................

07/02 ...

07/03 .....

07/04 ..........

07/05 ...

07/07 ....

07/08 ...................

07/09 ........

07/10 ........

07/11 .................

07/12 ........

07/13 .........

07/14 ....

07/15 ............

07/16 .....

07/17 .

07/18 .............

07/19 ........

07/20 .........

07/21 .........

07/22 .......

07/25 ...........

07/26 .

07/27 ..

07/28 ...................

07/29 ..............

07/30 .....

07/31 ......

08/01 ............................

08/02 .....................

08/03 .......................

08/04 ........

08/05 ..........

08/06 .....

08/07 ....

08/08 ......

08/09 ..............

08/10 ........

08/11 .

08/12 ....

08/13 .....

08/14 ..

08/15 .....

08/17 .........

08/18 .............

08/19 ............

08/20 ....

08/21 .......

08/22 ......

08/23 .....

08/24 ......

08/25 ........

08/26 ...........

08/28 ..

08/29 .......

08/30 ......................

08/31 .......

09/01 .........

09/02 ........

09/03 ....

09/04 ..

09/05 ....

09/06 ......

09/07 .............

09/08 .............

09/09 .......

09/10 ..............

09/11 ..

09/12 ................................

09/13 ..............

09/14 ...............

09/15 ..................

09/16 ........................

09/17 .......

09/18 ............

09/19 ............................................

09/20 ......................................................

09/21 .....................................

09/22 ........................

09/23 ............

09/24 ....

09/25 ...

09/26 .....

09/27 ...........

09/28 .........................

09/29 ......

09/30 .....

10/01 .......

10/02 .......

10/03 .........

10/04 .

10/05 .

10/06 .....

10/07 ....

10/08 ....

10/09 .

10/10 .......

10/11 ..

10/13 .......

10/14 ...

10/17 .......

10/18 .....

10/19 ...................

10/20 .............

10/21 ..........

10/23 ...

10/24 ................

10/25 ..........................

10/26 ........

10/27 .......

10/28 ...

10/29 .........

10/30 ...................

10/31 .........................................

11/01 .....

11/02 ...........

11/03 ...

11/04 .....

11/06 .............

11/07 .........

11/08 ...

11/10 .........

11/11 ..................

11/12 .....

11/13 ..

11/14 ..........

11/15 ........

11/16 ...........

11/17 ....

11/18 ........................

11/19 ......

11/20 ......

11/21 ...............................

11/22 ..............

11/23 ...

11/24 ..

11/25 .........

11/26 ...

11/27 ........

11/28 .............................

11/29 .........

11/30 ..........................

12/01 ......................

12/02 ..................

12/03 ....

12/04 ......

12/05 ....

12/06 .........

12/07 ......

12/09 ............

12/10 ...

12/11 ......

12/12 ..................

12/13 ......

12/14 .................

12/15 ........

12/16 ..

12/18 ..

12/19 .................

12/20 ....................

12/21 ..........

12/22 ........

12/23 ...

12/24 ...............

12/25 ...

12/26 .....

12/27 ..............

12/28 .........

12/29 ............................

12/30 ...................

12/31 ..

06/01/02 ...

01/03 ....

01/05 .

01/09 .....

01/10 .....

01/13 ...

01/14 .

01/16 ..

01/17 ......

01/18 ....

01/19 .......

01/20 ......

01/21 ...........

01/22 .........

01/23 .......

01/24 ......

01/25 ..

01/26 ...

01/27 .

01/30 ..

01/31 .

02/01 .

02/02 .

02/04 .....

02/05 ...

02/06 ..........

02/07 .......

02/08 ......

02/09 ....

02/10 ....

02/12 .

02/13 ...

02/14 .

02/15 ..

02/18 .

02/19 ..

02/20 ................

02/21 .........

02/22 ......

02/23 .............

02/24 .......

02/25 .....

02/26 .

02/27 ............

02/28 ..

03/01 .....

03/02 .

03/03 ......

03/04 .

03/10 .....

03/11 ...

03/12 ..

03/15 .....

03/16 .

03/20 ......

03/21 ........

03/22 ......

03/23 ....

03/24 ....

03/25 ...

03/27 .

03/28 .......

03/29 ......

03/30 ..........

03/31 ...

04/03 ...

04/04 ....

04/05 .....

04/06 ............

04/07 ........

04/09 .

04/10 .....

04/11 ........

04/12 .......

04/13 ...........

04/14 .

04/15 ...

04/16 .........

04/17 ....

04/18 ......

04/19 .

04/20 .

04/23 ..

04/24 ..........

04/25 ...

04/26 ...

04/27 .

04/28 ...

04/30 .

05/01 ....

05/02 .

05/05 .

05/07 ........

05/08 ...

05/11 .....

05/12 ....

05/13 ..

05/14 ...

05/16 .......

05/17 .

05/18 ........

05/20 .

05/21 ...

05/22 ....

05/23 ..

05/25 ..

05/29 .....

05/30 ..

06/02 .....

06/03 ...

06/04 .......

06/05 ...

06/07 ....

06/08 ..

06/09 .....

06/10 ....

06/11 ......

06/12 .....

06/13 ...

06/14 ............

06/15 ...

06/16 .

06/17 .

06/18 ....

06/19 ...............

06/20 ..............

06/21 .............

06/22 .............

06/23 ...............

06/24 ..................

06/25 .................

06/26 ...............

06/27 .......

06/28 .........................

06/29 ..............

06/30 .........

07/01 ..

07/02 .....

07/03 .....................

07/04 ..........

07/05 .........

07/06 ........

07/07 ..........

07/08 ....

07/09 ....

07/10 ..................

07/11 ...........

07/12 ...

07/13 .....

07/14 .

07/17 .......

07/18 ...........................

07/19 .....................

07/20 ....

07/21 .....................

07/22 ...

07/23 ...

07/24 ..........

07/25 .

07/26 .................

07/27 ...............

07/28 ..........

07/29 .......

07/30 ...

07/31 ..

08/01 .

08/04 ......

08/06 ..

08/07 ................

08/08 ....................

08/09 .....................

08/10 ....

08/11 .....

08/12 .......

08/13 ...

08/15 ..

08/16 .....

08/17 ..............

08/18 ..........................

08/19 .......

08/20 ...............

08/21 .......

08/22 ........

08/24 .

08/25 ..

08/26 ...

08/29 .....

08/30 .....

09/01 ........................

09/02 .....................

09/03 ................................

09/04 ............................

09/05 ......................

09/06 ...................

09/07 ....

09/08 .....................

09/09 .......

09/10 ............

09/11 ...

09/12 ....

09/13 ..

09/14 ...........

09/15 .

09/16 ....

09/17 ...

09/18 ...

09/19 ...

09/21 ..

09/22 ..

09/24 .

09/25 ..

09/26 ..............

09/27 ...

09/28 ..

09/29 .

10/02 ...

10/03 ........

10/04 ...

10/05 ...

10/06 .....

10/09 .

10/10 ...

10/11 ....

10/13 .

10/14 ........

10/15 ......

10/17 ...

10/19 .....

10/20 ..

10/21 ..

10/22 ...

10/23 .............

10/26 .

10/27 ...

10/28 ....

10/29 .

10/30 ............

10/31 ....

11/01 ........

11/02 ...............

11/03 .................

11/04 ....................................

11/05 .....................................

11/06 ............................................

11/07 .....................

11/08 ...

11/09 .......

11/10 .

11/13 ....

11/15 ...

11/23 ...

11/24 ......................

11/25 .....

11/26 ......

11/27 ......

11/28 ......

11/29 ..........

11/30 .

12/01 ...

12/02 .

12/04 .....

12/05 .......

12/06 ...

12/09 ..

12/10 ..

12/11 ..

12/12 .

12/13 .

12/14 .....

12/15 ....

12/18 .......

12/19 .............

12/20 ......

12/21 .

12/22 .

12/23 .

12/25 .......

12/26 .....

12/29 ..

12/31 .

07/01/01 ..

01/02 ..

01/03 ....

01/04 .....

01/05 ..................

01/06 ......

01/07 .........

01/08 .........

01/09 ....

01/11 .

01/12 .......

01/13 ..

01/14 .......

01/16 .....

01/17 .

01/18 ...

01/19 .....

01/21 .

01/23 ........................

01/24 .....

01/25 .........

01/26 ........

01/29 ............

01/30 ..............

01/31 .......

02/01 .........

02/02 ......

02/03 ...

02/04 .....

02/05 ...........

02/06 ............................

02/07 ..........

02/08 .

02/09 ..

02/10 ......

02/11 ........

02/12 ..

02/13 ..

02/14 ................

02/15 ............

02/16 ....

02/17 ...............

02/18 .....

02/19 ......

02/20 .

02/21 .....

02/22 ..

02/23 ....

02/24 .....

02/25 .........

02/26 .................

02/27 ........

02/28 ..........

03/01 ...........

03/02 ....

03/03 .........

03/04 .....

03/05 ...............

03/06 ........

03/08 ....

03/09 ..........

03/10 ...

03/11 ..........

03/12 .................

03/13 .........

03/14 .........................

03/15 ..............

03/16 ..............

03/17 ..........

03/18 .....

03/19 ..................

03/20 ............

03/21 ........

03/22 ........

03/23 .

03/24 .

03/25 ..

03/28 ...

03/29 .

04/03 .

04/04 ...............

04/05 ...

04/09 ......

04/10 ...

04/12 ..

04/14 ..

04/15 ..

04/16 ..

04/17 ...

04/18 ..

04/19 ..

04/21 ...

04/23 .

04/26 ...........

04/27 ...

04/28 .

04/29 .

05/02 ...................

05/03 ..

05/06 ...

05/07 .....

05/08 ....

05/09 ..

05/11 ..

05/12 ...

05/13 .

05/15 .

05/16 .

05/17 ......

05/18 .

05/19 ..

05/20 ..

05/21 ......

05/22 .....

05/23 ...

05/24 ..

05/25 .........

05/26 ....

05/27 ..

05/28 ....

05/29 ..

05/30 ..............

05/31 ..........

06/01 ..............

06/02 .....

06/03 .

06/04 ...........

06/05 ..........

06/06 ....

06/07 ........................

06/08 .........

06/09 ...........

06/10 ...

06/11 ....

06/12 ............

06/13 ...........

06/14 ............

06/15 ................

06/16 .........

06/17 ...

06/18 .....

06/19 ......

06/20 .....

06/21 ...

06/22 ..

06/23 ....

06/24 .....

06/25 .

06/26 .................

06/27 ......

06/28 ...............

06/29 ............

06/30 ...

07/01 ..

07/02 ..............

07/03 ....

07/04 ...............

07/05 ..

07/06 ...............

07/07 ..........

07/08 ......

07/09 ...

07/10 .......

07/11 .......

07/12 ................

07/13 ..............

07/14 ........

07/15 ..............

07/16 ...

07/17 ....

07/18 ............

07/19 .........

07/20 ...

07/21 ..

07/22 .

07/23 ...............

07/24 ..........

07/25 ...

07/26 ......

07/27 .......

07/29 ..

07/30 ...

07/31 ..

08/01 ..............

08/02 ........

08/03 ...

08/04 ...

08/05 ...

08/06 .

08/07 ......

08/08 .....

08/09 ..........

08/10 .

08/11 ...

08/12 .....

08/13 ....................

08/14 .................

08/15 .......

08/16 ................

08/17 ....................

08/18 .............................

08/19 ...................

08/20 ..................................

08/21 .................................

08/22 ................................

08/23 .................

08/24 .................

08/25 ...........

08/26 .....

08/27 .......

08/28 .....

08/29 ..........

08/30 ........

08/31 .

09/01 ............

09/02 .............

09/03 ..............

09/04 ......

09/05 ........

09/06 .........

09/07 ..

09/08 ...........

09/09 ....

09/10 .....

09/11 ..

09/12 .....

09/14 .

09/15 ..............

09/17 .

09/18 ..

09/19 .

09/20 .......

09/21 .....

09/22 .....

09/23 ...............

09/24 .............

09/25 ...............

09/26 ...........

09/27 .......

09/28 ......................

09/29 .........

09/30 ............

10/01 .....

10/02 ..

10/03 .....

10/04 .........

10/05 ..............

10/06 ...

10/07 ..........

10/08 .........

10/09 .....................

10/10 .......................

10/11 ..............

10/12 .......

10/13 ........

10/14 ....

10/15 .................

10/16 .............

10/17 .......

10/18 ...

10/19 ...

10/20 ............

10/21 ........

10/22 ............

10/23 .........

10/24 ...........

10/25 ...........

10/26 .

10/30 .

10/31 ....

11/01 .

11/04 .

11/05 ...

11/06 ...........

11/07 ...

11/08 ..

11/09 ..........

11/10 .......

11/11 ..............

11/12 ........................

11/13 ..........................

11/14 ............................

11/15 ..

11/16 ........

11/17 .

11/18 .

11/19 ............

11/20 ......

11/21 ..

11/22 ........

11/23 ...........

11/24 ...

11/25 .......

11/26 ............

11/27 ..................

11/28 .......

11/29 ........

11/30 ...........

12/01 ................

12/02 .......

12/03 .......

12/04 ................

12/05 ...........

12/06 ....

12/07 ...........

12/08 .....

12/09 ....

12/10 ....................................

12/11 ............

12/12 ..............

12/13 .............................

12/14 ..................

12/15 ......

12/16 .....

12/17 ..

12/18 .............

12/19 ...................

12/20 ...........

12/21 ...........

12/22 ..............

12/23 .....

12/24 ......................

12/25 ...............................................................................

12/26 ......................

12/27 ..................

トラックバック - http://rubyist.g.hatena.ne.jp/hatecha/20071227

12/25(火) 2007

ソースを覗く

| ソースを覗く - たばさの を含むブックマーク はてなブックマーク - ソースを覗く - たばさの

さっぱり。つわもの。

苦し紛れにはかない抵抗をしてみる。

"#{$stack=[]}"

解析は出来なくても

| 解析は出来なくても - たばさの を含むブックマーク はてなブックマーク - 解析は出来なくても - たばさの

いじる事は出来るのだ!


stackを二つにしてみたくなりました

	def compile(tokens=scan(/[a-zA-Z_][a-zA-Z0-9_]*| ...

トークン解析の先頭に追加

	def compile(tokens=scan(/@@|;;|[a-zA-Z_][a-zA-Z0-9_]*| ...

定義部を追加

var'@@','$stack0=$stack;$stack=$stack2;$stack2=$stack0'.cc
var';;','$stack2<<a'.cc1

スタック入れ替えとトップの移動。

初期化もいるのかな。

$stack2 = [Gstring.new("")]

う、動くか?

# smileysdup.gs
':'n':-'n':-)':a;0:i;{i 32<}{a['))']i*''*i 1+:i;n}while; 
;; ;; ;; ;; ;; ;; ;; ;; ;; @@ 
print print print print print print print print print @@
;; ;; ;; ;; ;; ;; ;; ;; ;; @@ 
print print print print print print print print print @@
;; ;; ;; ;; ;; ;; ;; ;; ;; @@ 
print print print print print print print print print @@

:-)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
:-)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
:-)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
:-)))))))))))))))))))))))))))))))))))))))))))))))))))))
:-)))))))))))))))))))))))))))))))))))))))))))))))))))))))
:-)))))))))))))))))))))))))))))))))))))))))))))))))))))))))
:-)))))))))))))))))))))))))))))))))))))))))))))))
:-)))))))))))))))))))))))))))))))))))))))))))))))))
:-))))))))))))))))))))))))))))))))))))))))))))))))))):
:-
:-)
:-)))
:-)))))
:-)))))))
:-)))))))))
:-)))))))))))
:-)))))))))))))
:-)))))))))))))))
:-)))))))))))))))))
:-)))))))))))))))))))
:-)))))))))))))))))))))
:-)))))))))))))))))))))))
:-)))))))))))))))))))))))))
:-)))))))))))))))))))))))))))
:-)))))))))))))))))))))))))))))
:-)))))))))))))))))))))))))))))))
:-)))))))))))))))))))))))))))))))))
:-)))))))))))))))))))))))))))))))))))
:-)))))))))))))))))))))))))))))))))))))
:-)))))))))))))))))))))))))))))))))))))))
:-)))))))))))))))))))))))))))))))))))))))))
:-)))))))))))))))))))))))))))))))))))))))))))
:-)))))))))))))))))))))))))))))))))))))))))))))

トラックバック - http://rubyist.g.hatena.ne.jp/hatecha/20071225

12/24(月) 2007

バグ修正してる

| バグ修正してる - たばさの を含むブックマーク はてなブックマーク - バグ修正してる - たばさの

いつのまにやら

しかも短くなってる。さすがgolfer。(ちがった、改行コードのせいかも。)

http://www.darrenks.com/golfscript/index.html

トラックバック - http://rubyist.g.hatena.ne.jp/hatecha/20071224

12/23(日) 2007

括弧

| 括弧 - たばさの を含むブックマーク はてなブックマーク - 括弧 - たばさの

echo: 普通にやったあと、shが使えるようなのでshで短縮。

timeout: 普通にやったあと、(略)


制御構造を使うため?、

[]括弧でコンパイルとインタプリタを切り替えるという仕様がうまいなあ。

http://golf.shinh.org/reveal.rb?join+lines/51b/1179784348 など参考に。


golfscriptがトップに。まだ全問制覇を目指すんでしょう。

stackベースということで、forthもやってるのかなと、製作者のflagitiousさんエントリーをチェック。

そうでもないようで。


ソースも(まだ読めないけど)読みやすい、無駄がない。

ruby+5

| ruby+5 - たばさの を含むブックマーク はてなブックマーク - ruby+5 - たばさの

http://yowaken.dip.jp/tdiary/20071216.html#p01

"#{ rubyのコード }"

でいいらしい。ほー。

Xmas バージョン

| Xmas バージョン - たばさの を含むブックマーク はてなブックマーク - Xmas バージョン - たばさの

などと洒落込むかと思ってるうちにif文解析がおかしくなった。

とりあえずつじつま合わせる。

動作を変えずに更新するのが難しい。

rb
 ruby のコード
rb

ruby使えるようにしたのでruby+6?レベル。?


#!/bin/ruby
# koneko-0.4.93.1a-1.rb

$os="win"

require 'Win32API' if $os=="win"

$version="koneko 0.4.93a-1 (2007/12/23)"
$mode=""
$stack=[""]

$prompt=">"
$lprompt=">>"
$prprompt=":"
$repprompt="|>"
$programend='__END__'
$show=false
$debug=false
$editor=""
$IOI="STDIN."
$gflag=false

def checkeq d
  / *(.+) *== *([^ ]+)/ =~ d
  if $&
    return $1==$2
  end
  d
end

def keval(a,env)
  p a if $debug
  env.hlist.each{|v|
    a.gsub!(v,env.mem[env.assign[v]])
  }
  a=checkeq(a)
  p a if $debug
  return a if a.class==TrueClass
  v=reval(a)
  #p v
  v
end

def reval a
  p a if $debug
  begin
   v=eval(a)
   v
  rescue
   p "eval rescue |#{a}|" if $debug
   return a
  end
end

def type txt,env
 if $os=='win'
  system("type #{keval(txt,env)}")
 else
  system("cat #{keval(txt,env)}")
 end
end

def edit txt,editor=$editor
  if editor=="type"
    type txt
  elsif editor!=""
    `#{editor} #{txt}` 
  else
    browse txt
  end
end

def browse ur
  p "browse:"+ur if $debug
  return if $os!="win"
  shellexecute = Win32API.new('shell32.dll','ShellExecuteA',%w(p p p p p i),'i')
  shellexecute.call(0, 'open', stripbl(ur), 0, 0, 1)
end

class Env
 attr_accessor(:hlist,:assign,:mem,:his)
 def reset
   @mem=[]
   @hlist=[]
   @assign={}
   @his=[]
 end
end

$base = Env.new
$envs=["base"]
$base.reset
$current=$base
$currentname="base"
$hisfile="hensu-his.txt"

def showprompt
  print $currentname+$prompt
end

class Fv
 attr_accessor(:hlist,:assign,:name,:argv,:body)
end

def stripbl x
 /^ *([^ ]*)/ =~ x
 x=$1 if $1
 x
end

def exist x,env
 env.hlist.member?(stripbl(x))
end

def get d,env
 d=stripbl d
 if exist(d,env)
   d=env.mem[env.assign[d]] 
 end
 d
end

def subst(d, env)
 d=stripbl(d)
 if exist(d,env)
  a=env.mem[env.assign[d]] 
 else
  a=d
 end
 return $last if d=="$last"
 a
end



def isarray? a,env
  / *(.*)/=~a
  a=calc($1,env)
  env.hlist.each{|m|
    /#{a}\[/ =~ m
    # p m,$&
    return true if $&
  }
  false
end

def isstr? a,env
  exist a,env
end

def existusing x
 /(.*):([^ ]*)/ =~ x
 return [false,nil,nil]if !$&
 $envs.each{|en|
   next if en!=$1
   env=eval("$"+en)
   return [true,env,$2] if exist($2,env)
   return [false,nil,nil]
 }
 [false,nil,nil]
end

def indmax ar,env
  i=0
  while exist(ar+"["+i.to_s+"]",env)
    i+=1
  end
  i
end

def existarray ar,env
  i=0
  exist(ar+"["+i.to_s+"]",env)
end

def arreset(ar,env)
  i=0
  while exist(ar+"["+i.to_s+"]",env)
    setvalstr(ar+"["+i.to_s+"]","",env)
    i+=1
  end
  i
end

# function search
def existf x,env
 /\(.*\)/ =~x
 return false if !$`
 name=$`
 env.hlist.each{|i|
  /\(.*\)/ =~i
  n=$`
 # p"exf",x,n,name,"$$"
  if $&
    if n==name
      return true
    end
  end
 }
 false
end

def getfunc x,env
 /\(([^\)]*)\)/ =~x
 vals=$1
 name=$`
 env.hlist.each{|i|
  /\(([^\)]*)\)/ =~i
  n=$`
  if $&
    if n==name
      arg =$1
      return [i,arg.split(','),vals.split(',')]
    end
  end
 }
 false
end

def set x,env
 n=0
 while 1
  (env.assign[stripbl(x)]=n ;env.mem[n]=""; break) if env.mem[n]==nil
  n+=1
 end
end

def argcalc arg,vals,a
  tmp=a.dup
  arg.length.times{|i|
    v=mainloop(vals[i])
    tmp.gsub!(arg[i],v)
  }
  mainloop(tmp)
end

# uhenchi
def calc d,env
 p "calc:"+d if $debug
 /^"([^"]*)"/ =~d
 str=$&
 mae=$`
 usr=$'
 if str
   tmp =$1.gsub("\\n","\n")
   /\#\{([^\}]*)\}/ =~ tmp
   if $&
     return calc(mae+"\""+$`+mainloop($1,env)+$'+"\""+usr,env)
   end
   return mae+tmp+usr if !$&
 end
 /^'([^']*)'/ =~d
 str=$&
 mae=$`
 usr=$'
 if str
   tmp =$1.gsub("\\n","\n")
   /\#\{([^\}]*)\}/ =~ tmp
   if $&
     return calc(mae+"\'"+$`+mainloop($1,env)+$'+"\'"+usr,env)
   end
   return mae+tmp+usr if !$&
 end
 /- *-[0-9]+/=~d
 d.gsub!(/- *-/,'+') if $&
 # func(..)
 /([a-zA-Z_][a-zA-Z_0-9]*\([^\)]+\))/ =~ d
 mae=$`
 usr=$'
 if $1
  if existf($1,env)
   f,arg,vals =getfunc($1,env)
   a = env.mem[env.assign[f]]
   a = argcalc(arg,vals,a)
   # p a,f,arg,vals,"$!$"
   return calc(mae+a.to_s+usr,env)
  else
   return calc(mae+usr,env)
  end
 end
 return calc($`+calc($1,env)+$',env) if $1
 # (...)
 /(.*)\(([^\)]+)\)(.*)/ =~ d
 return calc($1+calc($2,env)+$3,env) if $2
 # array
 /([a-zA-Z_0-9]+)\[([^\.])\.\.([^\.])\]/ =~d
 return calc($`+calc($1,env)[$2.to_i..$3.to_i]+$',env) if $&
 # ..*/..
 /([a-zA-Z_0-9\.\[\]]+ *[\*\/] *[a-zA-Z_0-9\.\[\]]+) *([+\/\*\-].+)/ =~ d
 return calc($`+calc($1,env)+$2,env) if $2
 # ..*/..
 /(.+[+\/\*\-]) *([a-zA-Z_0-9\.\[\]]+ *[\*\/] *[a-zA-Z_0-9\.\[\]]+)/ =~ d
 return calc($1+calc($2,env)+$',env) if $2
 # ..+-..
 /([a-zA-Z_0-9\.\[\]]+ *[+\-] *[a-zA-Z_0-9\.\[\]]+) *([+-].+)/ =~ d
 return calc($`+calc($1,env)+$2,env) if $2
 # p d
 /([a-zA-Z_0-9\.\[\]]+) *([+\*\-\/%]) *([a-zA-Z_0-9\.\[\]]+)/=~d
 a=$1
 si=$2
 c=$3
 if !a
  p "search",d if $debug
  f,en,a = existusing(d)
  if f
   a =get a,en
   return a.to_s
  elsif exist(d,env)
   a = get d,env
   return a.to_s
  else 
   system(d[1..-1]) if d.class==String && d.length>0 && d[0,1]=="$"
   return d 
  end
 end
 a=subst($1,env)
 c=subst($3,env)
 /[^0-9e+\-\. ]/ =~ a.to_s
 f1=$&
 /[^0-9e+\-\. ]/ =~ c.to_s
 f2=$&
 return calc(a,env).to_s + calc(c,env).to_s if f2!=nil || f1!=nil
 return calc(eval(calc(a,env).to_s + si + calc(c,env).to_s ).to_s,env)
end

def getfname da
 / *(.+)/ =~ da
 file =$1
 if !$1
   file ="mylog.txt" 
 else
   /\./ =~file
   file =file+".ko" if !$&
 end
 file
end

def getstr da
 / *(.+)/ =~ da
 file =$1
 file ="" if !$1
 file
end

def memo env
 open($hisfile,'a'){|f|
  f.puts env.his
 }
end

def funccalc a,b,c
  fn=Fv.new
  fn.name=a
  fn.argv=b.split(',')
  fn.body=c
  fn
end

def setval a,b,env=$base,eoff=false
  (env.hlist<<a) if !exist a,env
  set a,env if env.assign[a]==nil 
  envfrom=env
  f,en,v =existusing(b)
  (envfrom=en;b=v) if f
  if eoff
    v=b
  else
    v=calc(b,envfrom)
    v="nul" if v==nil
  end
  env.mem[env.assign[a]] =v
  $last=v if v!="$last"
  return v
end

def setvalstr a,b,env=$base
  setval a,b,env,true
end

def geteditor env
  return "" if !env.hlist.member?("editor")
  env.mem[env.assign["editor"]]
end

def dropw d
  /^[^ ]+ */ =~d
  $'
end

def mainloop da,env=$base
 return "" if !da
 env.his<<da
 p "main:"+da if $debug
 /^rb[ \n]/ =~ da
 if da[0,5]=='reval' || $&
     a = reval(dropw(da))
     p a
     return a
 end
 # comment
 # p
 /^ *p  *(.*)/ =~ da
 if $&
   p mainloop($1,env)
   return $` 
 end
 # regexp
 /(\/[^\/]+\/) *=~ *(.*)/ =~ da
 if $&
   a=calc($2,env)
   body="#{$1}=~\""+a+"\""
   p "regex:",a,$&,da,body if $debug
   eval(body) 
   p "eval:$&:",$&
   eval("$match=$~") if $&
   if $1
     9.times{|i|
       p eval("$#{i+1}") if $debug
       eval("setval(\"$#{i+1}\",$#{i+1},env)") 
     }
     setval("$&",$&,env)
     setval("$`",$`,env)
     setval("$'",$',env)
   end
   return ""
 end
 # file :write array
 /file\(([^\)]+)\) *(=|<<) *(.*)/ =~ da
 f=$1
 op=$2
 a=$3
 if f
   /(.*),(.*)/ =~ f
   if $&
     f=$1
     mode=$2
   else
     mode='w' if op=='='
     mode='a' if op=='<<'
   end
   open(f,mode){|fo|
     if existarray(a,env)
       imax=ii=indmax(a,env)
       while ii>0
         line=calc(a+"["+(imax-ii).to_s+"]",env)
         fo.puts(line)
         ii-=1
       end
     elsif !exist(a,env)
       fo.puts(calc(a,env))
     else
       fo.puts(a)
     end
   }
   return ""
 end
 # function
 /([a-zA-Z_][a-zA-Z_0-9]*\((.*)\)) *=(.+)/ =~ da
 if $&
   a=funccalc $1,$2,$3
   # p a
   env.hlist<<a.name if !exist a.name,env
   set a.name,env if env.assign[a.name]==nil 
   env.mem[env.assign[a.name]]=$3 #calc($3,env)
   return a.name
 end
 # while
 /while  *([^><=]+)(!?[=><]+)(.+)  *\{([^\}]+)\}/ =~ da
 mae,usr,m1,m2,m3,body =$`,$',$1,$2,$3,$4
 if $1
  ans =calc($1,env)+$2+calc($3,env)
  if eval(ans)
    / *break */=~ mainloop(body,env)
    if $&
      return mainloop(mae+usr,env)
    end
    return mainloop(mae+"while "+m1+m2+m3+" {"+body+"}"+usr,env)
  else
    return mainloop(mae+usr,env)
  end
 end
 /while  *([^\{]+)  *\{([^\}]+)\}/ =~ da
 mae,usr,cond,body =$`,$',$1,$2
 if cond
  ans =mainloop(cond,env)
  if ans
    / *break */=~ mainloop(body,env)
    if $&
      return mainloop(mae+usr,env)
    end
    return mainloop(mae+"while "+cond+" {"+body+"}"+usr,env)
  else
    return mainloop(mae+usr,env)
  end
 end
 / *loop *\{([^\}]+)\}/ =~ da
 mae,usr,body =$`,$',$1
 if $&
   while 1
     / *break */=~ mainloop(body,env)
     if $&
       return mainloop(mae+usr,env)
     end
   end
 end
 / *case ([^ ]+) *\{([^\}]+)\}/ =~ da
 mae,usr,var,body = $`,$',$1,$2
 if $&
   /(&&)? *([^ ]*) *: *(([^;];?)*);; *(&&)?/ =~ body
   value,vdo,nex = $2,$3,$'
   p "case::",value,vdo,da if $debug
   if $&
     data=get(var,env)
     /^\/(.*)\/$/ =~ value
     if $&
       /#{$1}/ =~ data
     end
     if data==value || $&
       return mainloop(vdo,env)
     else
       return mainloop("case #{var} \{#{nex}\}")
     end
     return ""
   end
   return ""
 end
 # num.times
 /([a-zA-Z_0-9]+)\.times *\{ *([^\}]+) *\}/ =~ da
 body=$2
 if $&
  num=calc($1,env).to_i
  return num.times{ |it|
    a=body.gsub(/it/, it.to_s)
    a=a.gsub(/ti/, (num-it).to_s)
    print "(#{a})",$repprompt if $debug
    / *break */=~ mainloop(a,env)
    break if $&
  }
 end
 # multi
 /(.+) *&& *(.*)/ =~ da
 m1=$1
 m2=$2
 /\{/ =~ $1
 if m1 && !$&
   p "multi&&:" if $debug
   ans =mainloop m1,env
   / *break */ =~ ans
   return "break" if $&
   return mainloop(m2,env)
 end
 /([^;]*) *; *(.*)/ =~ da
 m1=$1
 m2=$2
 if $1
   ans =mainloop $1,env
   / *break */ =~ ans
   return "break" if $&
   return mainloop(m2,env)
 end
 # gets
 /gets(\([^\)]*\))?/ =~ da
 if $&
   inp=$IOI+$&
   a=eval(inp)
   setval("$_",$_,env)
   return a if $`=="" && $'==""
   a="" if a==nil
   return mainloop($`+a+$',env)
 end
 /if  *(.+) *([!=]=) *([^ ]+)  *then *(.+)/ =~ da
 mae,usr,m1,m2,m3,mtrue =$`,$',$1,$2,$3,$4
 if $1
  p $& if $debug
  /else  *(.*)/ =~ mtrue
  mfalse =$1
  mtrue =$` if $&
  p $& if $debug
  if m2=="=="
   if calc(m1,env)==calc(m3,env)
    return mainloop(mae +mtrue +usr,env) 
   else
    if mfalse
      return mainloop(mae+mfalse+usr,env)
    else
      return mainloop(mae+usr,env)
    end
   end
  else
   if calc(m1,env)!=calc(m3,env)
    return mainloop(mae+mtrue+usr,env)
   else
    if mfalse
      return mainloop(mae+mfalse+usr,env)
    else
      return mainloop(mae+usr,env)
    end
   end
  end
 end
 /if  *(.+) *< *([^ ]+)  *then (.+)  *else  *(.+)/ =~ da
 if $1
  if calc($1,env)<calc($2,env)
    return mainloop($`+$3+$',env)
  else
    return mainloop($`+$4+$',env)
  end
 end
 /if  *(.+) *> *([^ ]+)  *then (.+) *(else  *(.+))?/ =~ da
 if $1
  p "if:" if $debug
  if calc($1,env)>calc($2,env)
    return mainloop($`+$3+$',env)
  else
    return mainloop($`+$5+$',env) if $4
  end
  return ""
 end
 /if *(.+) *(goto) *([^ ]+)/ =~ da
 if $& && keval($1,env)
   $glabel=$3
   $gflag=true
   return "break"
 end
 # print
 /print  *((.|\n)+)/ =~ da
 strs=$1
 if strs
   /(.*),(.*)/ =~ strs
   m1=$1
   m2=$2
   #/"/ =~ strs
   if m1 # !$& && m1
     return (mainloop("print #{m1}");mainloop("print #{m2}"))
   else
     a= calc(strs,env)
     p a if $debug
     print a
     return (mainloop($`.to_s+a+$'.to_s) )
   end
 end
 # puts
 /puts  *((.|\n)+)/ =~ da
 strs=$1
 if strs
   /(.*),(.*)/ =~ strs
   m1=$1
   m2=$2
   #/"/ =~ strs
   if m1
     return (mainloop("puts #{m1}");mainloop("puts #{m2}")) 
   else
     a= calc(strs,env)
     puts a
     return (mainloop($`.to_s+a+$'.to_s) )
   end
 end
 # browse
 /^http.*/ =~ da
 browse($&) if $&
 /^type *(.*)$/ =~ da
 type($&,env) if $&
 # browse
 /.*\.txt/ =~ da
 editor=""
 editor=geteditor(env) if exist("editor",env)
 edit($&,editor) if $&
 # reval
 /(([a-zA-Z_][a-zA-Z_0-9]*)(\[ *([0-9]+) *\])?) *= *([rk]eval.+)/ =~ da
 a=$1
 a=$2+"["+$3+"]" if $3
 rk=$5
 if a
   /keval\( *([^,]*)(, *.+)?\)/ =~rk
   rk="keval("+$1+",env)" if !$2 && $1
   return setval(a, eval(rk).to_s,env,true)
 end
 # file to Array
 /(([a-zA-Z_][a-zA-Z_0-9]*)(\[ *([0-9]+) *\])?) *(=|<<) *file\( *(.+) *\)/ =~ da
 a=$2
 ind=$4
 op=$5
 f=$6
 if a
   mode="r"
   /(.*) *, *(.*)/ =~ f
   if $&
     f=$1
     mode=$2
   end
   tmp=[]
   /^"(.*)"$/ =~ f
   f=$1 if $&
   open(f,mode){|fi|
     tmp=fi.readlines
   }
   #p tmp
   start=indmax(a,env)
   (arreset(a,env) ; start=0) if op=='=' && !ind
   start=ind.to_i if ind
   tmp.length.times{|i|
     puts a+"[#{i+start}]",tmp[i] if $debug
     setval(a+"[#{i+start}]",tmp[i],env,true)
   }
   return ""
 end
 # multi eqation
 /([^, ]+) *, *(.+) *= *([^, ]+) *, *(.+)/ =~da
 la,lb,ra,rb = $1,$2,$3,$4
 if $&
   a= mainloop(la+"="+ra)
   b= mainloop(lb+"="+rb)
   return b
 end
 # browse multi
 /browse *\{ *(&&)? *([^ ]+) *(&&)? *((.+))? *(&&)? *\}/ =~ da
 if $&
   p "br.multi:"+$2 if $debug
   browse($2)
   mainloop("browse \{#{$5}\}") if $5
   return ""
 end
 /browse *([^ ]+) *(, *(.+))?/ =~ da
 if $&
   p "br:"+$1 if $debug
   browse($1)
   mainloop("browse #{$3}") if $2
   return ""
 end
 # simple equation
 /([a-zA-Z_][a-zA-Z_0-9]*(\[[0-9]+\])?) *= *(.+)/ =~ da
 a=$1
 b=$3
 if a
   return setval(a,b,env)
 else
   if da=="??"
     env.hlist.each{|i| 
       puts $prprompt+i+"= '"+env.mem[env.assign[i]].to_s+"'"
     }
     return""
   elsif da=="?"
     puts env.hlist*","
     return ""
   elsif da=="???" || da=="?3"
     p env.mem,env.hlist,env.assign
     return ""
   elsif da=="his"
     p env.his
     return ""
   elsif da=="hiss"
     return memo(env)
   elsif da=="hisl"
     return mainloop("!load #{$hisfile}",env)
   elsif exist(da,env) 
     a=env.mem[env.assign[da]]
     system(a[1..-1]) if a.class==String && a[0..0]=="$"
     return a
   elsif da=="????" || da=="?4"
     print "hensuu:\t"
     p env.hlist
     print "assign:\t"
     p env.assign
     print "memory:\t"
     p env.mem
     print "env:\t"
     p $envs
     puts
     return ""
   elsif da=="?????" || da=="?5"
     $envs.each{|e|
       puts "env::"+":"*30+"("+e+")"
       mainloop("?",eval("$"+e))
     }
     puts
     return ""
   elsif da=="??????" || da=="?6"
     $envs.each{|e|
       puts "env:"+"."*30+" ("+e+")"
       mainloop("????",eval("$"+e))
     }
     return ""
   elsif da=="???????" || da=="?e"
     $envs.each{|e|
       p eval("$"+e)
     }
     return ""
   elsif da=='$'
     memo env
     exit
   elsif da=='exit'
     exit
   elsif da[0..9]=='@namespace' || da[0..2]=='@ns' 
     /[^ ]+ *(.*)/ =~ da
     if !$1
       p env
       return ""
     end
     envname=getstr $1
     (p $envs;return"") if envname==""
     if ! $envs.member?(envname)
       name="$#{envname}"
       eval(name+"=Env.new")
       $envs<<envname
       eval("$current="+name)
       $current.reset
     else
       eval("$current=$"+envname)
     end
     $currentname=envname
     mainloop("?",$current)
     return""
   elsif da=='help'
     help
     return ""
   elsif da=='show'
     $show=!$show
     return ""
   elsif da=='debug'
     $show=true
     $debug=true
     return ""
   elsif da=='undebug'
     $show=false
     $debug=false
     return ""
   elsif da[0,8]=="isarray?"
     a=isarray?(da[8..-1],env).to_s
     puts a
     return a
   elsif da=='reset'
     env.reset
     return ""
   elsif da[0,4]=='keval'
     a = keval(da[5..-1],env)
     p a
     return a
   elsif da[0,5]=='reval'
     a = reval(da[6..-1])
     p a
     return a
   elsif da[0,6]=='$eopen'
     file =getfname da[6..-1]
     edit(file,geteditor(env))
     return ""
   elsif da[0,1]=='$'
     puts da[1..-1]
     system(da[1..-1])
     return ""
   elsif da[0,5]=="!load"
     loadf da[5..-1]
     return ""
     # puts "loaded \'#{file}\'."
   elsif da[0,2]=="!l"
     loadf da[2..-1]
     return ""
   elsif da==$programend
     exit
   elsif da[0,5]=="!save"
     file =getfname da[5..-1]
     open(file,"a"){|f| 
       env.hlist.each{|i| 
         f.puts i.to_s+"="+env.mem[env.assign[i]].to_s
       }
     }
     return "saved as \'#{file}\'."
   else
     p "elsecase" if $debug
     a=calc(da,env)
     return a
   end
 end
end

def help
 puts "example: 'x=1','y=text','?'(list),'z=x*2+(5-x)','!save [file]'(file save),'!load [file]', '???'(internal hensu dump),'$dir'(exec system.command) etc."
end

# check whether this block is a single line
def blockok d
  flag = false
  a=d.gsub(/[^\{\}]/,'')
  a=a.gsub(/\{\}/,'')
  while $& ;a=a.gsub(/\{\}/,'') end
  #p "a=",a
  return false if a!="" 
  /puts *"((.|\n)*)/ =~ d
  if $&
    #p "qst:"+$1+".m:"+$&
    /"/ =~$1
    if !$&
      return false
    end
  end
  /print *"[^"]*$/ =~ d
  return false if $&
  true
end

def commentoff da
  /[ \t]*#.*/ =~da
  flag =false
  a =$&
  b =$`
  if a
    flag =true
    /^\{[^\}]+\}/ =~a
    flag =false if $&
    /\"/ =~a
    flag =false if $&
  end
  return b if flag
  da
end


def main da, env=$current
  line=$stack.pop 
  data=commentoff(da.chomp)
  ($stack.push(""); return "") if data=="" && line==""
  if line!=""
    /^[^\\]*\"[^\"]*$/ =~ line 
    if $&
      line = line +"\n" + da.chomp
    else
      line = line+"&&"+ data
    end
  else
    line = data
  end
  p "l:"+line if $debug
  $stack.push(line) 
  if blockok(line)
    p"blk:"+line if $debug
    an=mainloop(line,env)
    puts an if $show
    mainloop("??",env) if $debug
    showprompt if $mode!="load" || $show
    $stack.pop
    line=""
    $stack.push(line)
  else
    print $repprompt if $mode!="load" || $show
  end
end


def searchlabel label,lines=$lines
  n=0
  puts "label:"+label if $debug
  lines.each{|i|
    / *#{label.chomp}: */ =~ i
    return n if $&
    n+=1
  }
  false
end

def rbsearch ar
  c=ar.length
  d=[]
  tmp=""
  flag=false
  c.times{|i|
    /^rb[ \n]/ =~ ar[i]
    if !$&
      if !flag
        d<<ar[i]
      else
        tmp<<ar[i]
      end
    else
      flag=!flag
      if flag
        tmp<<ar[i]
      else
        d<<tmp
        tmp=""
      end
    end
  }
  d<<tmp if flag
  d
end

# prepro
def loadf fname
 $mode="load"
 file =getfname fname
 setvalstr("$l",file)
 lines=[]
 $alias={}
 open(file,"r"){|f|
   lines =f.readlines
 }
 lines =rbsearch lines
 # p lines if $debug
 lnum=0
 $stack.push("")
 len=lines.length
 lines.each{|i|
   /alias  *([^ ]+)  *(.+)/ =~ i
   if $&
     $alias[$1]=$2
     i.sub!(/.*/,"")
   else
     len.times{|n|
       i.gsub!("_#{n}_",lines[n].chomp)
       $alias.each{|al,to|
         i.gsub!(al,to)
       }
     }
   end
 }
 p "prepro:",lines if $debug
 $lines=lines
 while lnum<len
   print lnum.to_s+":",lines[lnum],"("+file +")" if $show
   /^ *goto *([^ ]+)/ =~lines[lnum]
   if $&
     lnum =searchlabel($1,lines)
     exit if !lnum
   end
   /^ *[0-9a-zA-Z]+: *$/ =~ lines[lnum]
   lnum+=1 if $&
   #p lines[lnum],file
   main(lines[lnum]) if lines[lnum]!=nil
   (lnum =searchlabel($glabel,lines);$gflag=false) if $gflag
   lnum+=1
 end
 $stack.pop
 $mode=""
end

def pversion
  puts $version
end



#...... start .......................................#

if ARGV==[]
  # dialog mode
  showprompt
  while gets
    main $_, $current
    print "last:[",$last,"]\n" if $debug
  end
else
  ag=ARGV
  if ag[0]=='-v' || ag[0]=='--version'
    pversion
    exit
  elsif ag[0]=='--debug' || ag[0]=='-d'
    $debug=true
    ag[0]=ag[1]
  elsif ag[0]=='-e'
    open('tmp.ko',"w"){|f|
      f.puts(ag[1])
    }
    ag[0]='tmp.ko'
  end
  # file load mode
  loadf ag[0]
end
トラックバック - http://rubyist.g.hatena.ne.jp/hatecha/20071223

12/22(土) 2007

ruby にこめ

ruby にこめ - たばさの を含むブックマーク はてなブックマーク - ruby にこめ - たばさの

cygwinにもrubyあるなあでも要らないし。

...


そうか、テスト用に使えるか。

と思いcygwin setup起動>ruby選択>インストール。バージョンチェック。

$ ruby -v

ruby 1.8.6 (2007-03-13 patchlevel 0) [i386-cygwin]

pathを探して

#!/bin/ruby

をkoneko.rb先頭に加えて実行。

$ ./koneko.rb -e '...'

ややこしい。どっちのルビーが動いてるか見た目じゃあ分からないなあ。

トラックバック - http://rubyist.g.hatena.ne.jp/hatecha/20071222

12/20(木) 2007

続き goto

| 続き goto - たばさの を含むブックマーク はてなブックマーク - 続き goto - たばさの

# koneko.rb
$os="win"

require 'Win32API' if $os=="win"

$version="koneko 0.4.83 (2007/12/20)"
$mode=""
$stack=[""]

$prompt=">"
$lprompt=">>"
$prprompt=":"
$repprompt="|>"
$show=false
$debug=false
$editor=""
$IOI="STDIN."
$gflag=false

def keval(a,env)
  p a if $debug
  env.hlist.each{|v|
    a.gsub!(v,env.mem[env.assign[v]])
  }
  v=eval(a)
  #p v
  v
end

def reval a
  p a if $debug
  v=eval(a)
  #p v
  v
end

def edit txt,editor=$editor
  if editor=="type"
    system("type #{txt}")
  elsif editor!=""
    `#{editor} #{txt}` 
  else
    browse txt
  end
end

def browse ur
  return if $os!="win"
  shellexecute = Win32API.new('shell32.dll','ShellExecuteA',%w(p p p p p i),'i')
  shellexecute.call(0, 'open', ur, 0, 0, 1)
end

class Env
 attr_accessor(:hlist,:assign,:mem,:his)
 def reset
   @mem=[]
   @hlist=[]
   @assign={}
   @his=[]
 end
end

$base = Env.new
$envs=["base"]
$base.reset
$current=$base
$currentname="base"
$hisfile="hensu-his.txt"

def showprompt
  print $currentname+$prompt
end

class Fv
 attr_accessor(:hlist,:assign,:name,:argv,:body)
end


def exist x,env
 env.hlist.member?(x)
end

def subst(d, env)
 if exist(d,env)
  a=env.mem[env.assign[d]] 
 else
  a=d
 end
 p d
 return $last if d=="$last"
 a
end



def isarray? a,env
  / *(.*)/=~a
  a=calc($1,env)
  env.hlist.each{|m|
    /#{a}\[/ =~ m
    # p m,$&
    return true if $&
  }
  false
end

def isstr? a,env
  exist a,env
end

def existusing x
 /(.*):(.*)/ =~ x
 return [false,nil,nil]if !$&
 $envs.each{|en|
   next if en!=$1
   env=eval("$"+en)
   return [true,env,$2] if exist($2,env)
   return [false,nil,nil]
 }
 [false,nil,nil]
end

def indmax ar,env
  i=0
  while exist(ar+"["+i.to_s+"]",env)
    i+=1
  end
  i
end

def existarray ar,env
  i=0
  exist(ar+"["+i.to_s+"]",env)
end

def arreset(ar,env)
  i=0
  while exist(ar+"["+i.to_s+"]",env)
    setvalstr(ar+"["+i.to_s+"]","",env)
    i+=1
  end
  i
end

# function search
def existf x,env
 /\(.*\)/ =~x
 return false if !$`
 name=$`
 env.hlist.each{|i|
  /\(.*\)/ =~i
  n=$`
 # p"exf",x,n,name,"$$"
  if $&
    if n==name
      return true
    end
  end
 }
 false
end

def getfunc x,env
 /\(([^\)]*)\)/ =~x
 vals=$1
 name=$`
 env.hlist.each{|i|
  /\(([^\)]*)\)/ =~i
  n=$`
  if $&
    if n==name
      arg =$1
      return [i,arg.split(','),vals.split(',')]
    end
  end
 }
 false
end

def set x,env
 n=0
 while 1
  (env.assign[x]=n ;env.mem[n]=""; break) if env.mem[n]==nil
  n+=1
 end
end

def argcalc arg,vals,a
  tmp=a.dup
  arg.length.times{|i|
    v=mainloop(vals[i])
    tmp.gsub!(arg[i],v)
  }
  mainloop(tmp)
end

# uhenchi
def calc d,env
 p "calc:"+d if $debug
 /^"([^"]*)"/ =~d
 str=$&
 mae=$`
 usr=$'
 if str
   tmp =$1.gsub("\\n","\n")
   /\#\{([^\}]*)\}/ =~ tmp
   if $&
     return calc(mae+"\""+$`+mainloop($1,env)+$'+"\""+usr,env)
   end
   return mae+tmp+usr if !$&
 end
 /^'([^']*)'/ =~d
 str=$&
 mae=$`
 usr=$'
 if str
   tmp =$1.gsub("\\n","\n")
   /\#\{([^\}]*)\}/ =~ tmp
   if $&
     return calc(mae+"\'"+$`+mainloop($1,env)+$'+"\'"+usr,env)
   end
   return mae+tmp+usr if !$&
 end
 /- *-[0-9]+/=~d
 d.gsub!(/- *-/,'+') if $&
 # func(..)
 /([a-zA-Z_][a-zA-Z_0-9]*\([^\)]+\))/ =~ d
 mae=$`
 usr=$'
 if $1
  if existf($1,env)
   f,arg,vals =getfunc($1,env)
   a = env.mem[env.assign[f]]
   a = argcalc(arg,vals,a)
   # p a,f,arg,vals,"$!$"
   return calc(mae+a.to_s+usr,env)
  else
   return calc(mae+usr,env)
  end
 end
 return calc($`+calc($1,env)+$',env) if $1
 # (...)
 /(.*)\(([^\)]+)\)(.*)/ =~ d
 return calc($1+calc($2,env)+$3,env) if $2
 # array
 /([a-zA-Z_0-9]+)\[([^\.])\.\.([^\.])\]/ =~d
 return calc($`+calc($1,env)[$2.to_i..$3.to_i]+$',env) if $&
 # ..*/..
 /([a-zA-Z_0-9\.\[\]]+ *[\*\/] *[a-zA-Z_0-9\.\[\]]+) *([+\/\*\-].+)/ =~ d
 return calc($`+calc($1,env)+$2,env) if $2
 # ..*/..
 /(.+[+\/\*\-]) *([a-zA-Z_0-9\.\[\]]+ *[\*\/] *[a-zA-Z_0-9\.\[\]]+)/ =~ d
 return calc($1+calc($2,env)+$',env) if $2
 # ..+-..
 /([a-zA-Z_0-9\.\[\]]+ *[+\-] *[a-zA-Z_0-9\.\[\]]+) *([+-].+)/ =~ d
 return calc($`+calc($1,env)+$2,env) if $2
 # p d
 /([a-zA-Z_0-9\.\[\]]+) *([+\*\-\/%]) *([a-zA-Z_0-9\.\[\]]+)/=~d
 a=$1
 si=$2
 c=$3
 if !a
  f,en,a = existusing(d)
  if f
   a =en.mem[en.assign[a]]
   return a.to_s
  elsif exist(d,env)
   a = env.mem[env.assign[d]]
   return a.to_s
  else 
   system(d[1..-1]) if d.class==String && d.length>0 && d[0,1]=="$"
   return d 
  end
 end
 a=subst($1,env)
 c=subst($3,env)
 /[^0-9e+\-\. ]/ =~ a.to_s
 f1=$&
 /[^0-9e+\-\. ]/ =~ c.to_s
 f2=$&
 return calc(a,env).to_s + calc(c,env).to_s if f2!=nil || f1!=nil
 return calc(eval(calc(a,env).to_s + si + calc(c,env).to_s ).to_s,env)
end

def getfname da
 / *(.+)/ =~ da
 file =$1
 if !$1
   file ="mylog.txt" 
 else
   /\./ =~file
   file =file+".ko" if !$&
 end
 file
end

def getstr da
 / *(.+)/ =~ da
 file =$1
 file ="" if !$1
 file
end

def memo env
 open($hisfile,'a'){|f|
  f.puts env.his
 }
end

def funccalc a,b,c
  fn=Fv.new
  fn.name=a
  fn.argv=b.split(',')
  fn.body=c
  fn
end

def setval a,b,env,eoff=false
  (env.hlist<<a) if !exist a,env
  set a,env if env.assign[a]==nil 
  envfrom=env
  f,en,v =existusing(b)
  (envfrom=en;b=v) if f
  if eoff
    v=b
  else
    v=calc(b,envfrom)
    v="nul" if v==nil
  end
  env.mem[env.assign[a]] =v
  $last=v
  return v
end

def setvalstr a,b,env
  setval a,b,env,true
end

def geteditor env
  return "" if !env.hlist.member?("editor")
  env.mem[env.assign["editor"]]
end

def mainloop da,env=$base
 env.his<<da
 p "main:"+da if $debug
 # comment
 # p
 / *p  *(.*)/ =~ da
 if $&
   p mainloop($1,env)
   return $` 
 end
 # regexp
 /\/[^\/]+\/ *=~.*/ =~ da
 eval($&) if $&
 eval("$match=$~") if $&
 if $1
   9.times{|i|
     p eval("$#{i+1}") if $debug
     eval("setval(\"$#{i+1}\",$#{i+1},env)") 
   }
   setval("$&",$&,env)
   setval("$`",$`,env)
   setval("$'",$',env)
 end
 # file :write array
 /file\(([^\)]+)\) *(=|<<) *(.*)/ =~ da
 f=$1
 op=$2
 a=$3
 if f
   /(.*),(.*)/ =~ f
   if $&
     f=$1
     mode=$2
   else
     mode='w' if op=='='
     mode='a' if op=='<<'
   end
   open(f,mode){|fo|
     if existarray(a,env)
       imax=ii=indmax(a,env)
       while ii>0
         line=calc(a+"["+(imax-ii).to_s+"]",env)
         fo.puts(line)
         ii-=1
       end
     elsif !exist(a,env)
       fo.puts(calc(a,env))
     else
       fo.puts(a)
     end
   }
   return ""
 end
 # function
 /([a-zA-Z_][a-zA-Z_0-9]*\((.*)\)) *=(.+)/ =~ da
 if $&
   a=funccalc $1,$2,$3
   # p a
   env.hlist<<a.name if !exist a.name,env
   set a.name,env if env.assign[a.name]==nil 
   env.mem[env.assign[a.name]]=$3 #calc($3,env)
   return a.name
 end
 # while
 /while  *([^><=]+)(!?[=><]+)(.+)  *\{([^\}]+)\}/ =~ da
 mae,usr,m1,m2,m3,body =$`,$',$1,$2,$3,$4
 if $1
  ans =calc($1,env)+$2+calc($3,env)
  if eval(ans)
    / *break */=~ mainloop(body,env)
    if $&
      return mainloop(mae+usr,env)
    end
    return mainloop(mae+"while "+m1+m2+m3+" {"+body+"}"+usr,env)
  else
    return mainloop(mae+usr,env)
  end
 end
 /while  *([^\{]+)  *\{([^\}]+)\}/ =~ da
 mae,usr,cond,body =$`,$',$1,$2
 if cond
  ans =mainloop(cond,env)
  if ans
    / *break */=~ mainloop(body,env)
    if $&
      return mainloop(mae+usr,env)
    end
    return mainloop(mae+"while "+cond+" {"+body+"}"+usr,env)
  else
    return mainloop(mae+usr,env)
  end
 end
 # num.times
 /([a-zA-Z_0-9]+)\.times *\{ *([^\}]+) *\}/ =~ da
 body=$2
 if $&
  num=calc($1,env).to_i
  return num.times{ |it|
    a=body.gsub(/it/, it.to_s)
    a=a.gsub(/ti/, (num-it).to_s)
    print "(#{a})",$repprompt if $debug
    / *break */=~ mainloop(a,env)
    break if $&
  }
 end
 # gets
 /gets(\([^\)]*\))?/ =~ da
 if $&
   inp=$IOI+$&
   a=eval(inp)
   setval("$_",$_,env)
   return a if $`=="" && $'==""
   a="" if a==nil
   return mainloop($`+a+$',env)
 end
 # multi
 /([^;]*);(.*)/ =~ da
 m1=$1
 m2=$2
 if $1
   ans =mainloop $1,env
   / *break */ =~ ans
   return "break" if $&
   return mainloop(m2,env)
 end
 /if  *(.+)([!=]=)(.+)  *then *(.+)/ =~ da
 mae,usr,m1,m2,m3,mtrue =$`,$',$1,$2,$3,$4
 if $1
  p $& if $debug
  /else  *(.*)/ =~ mtrue
  mfalse =$1
  mtrue =$` if $&
  p $& if $debug
  if m2=="=="
   if calc(m1,env)==calc(m3,env)
    return mainloop(mae +mtrue +usr,env) 
   else
    if mfalse
      return mainloop(mae+mfalse+usr,env)
    else
      return mainloop(mae+usr,env)
    end
   end
  else
   if calc(m1,env)!=calc(m3,env)
    return mainloop(mae+mtrue+usr,env)
   else
    if mfalse
      return mainloop(mae+mfalse+usr,env)
    else
      return mainloop(mae+usr,env)
    end
   end
  end
 end
 /if  *(.+)<(.+)  *then (.+)  *else  *(.+)/ =~ da
 if $1
  if calc($1,env)<calc($2,env)
    return mainloop($`+$3+$',env)
  else
    return mainloop($`+$4+$',env)
  end
 end
 /if  *(.+)>(.+)  *then (.+)  *else  *(.+)/ =~ da
 if $1
  if calc($1,env)>calc($2,env)
    return mainloop($`+$3+$',env)
  else
    return mainloop($`+$4+$',env)
  end
 end
 /if *(.+) *(goto) ([^ ]+)/ =~ da
 if $& && keval($1,env)
   $glabel=$3
   $gflag=true
   return ""
 end
 # print
 /print  *((.|\n)+)/ =~ da
 strs=$1
 if strs
   /(.*),(.*)/ =~ strs
   m1=$1
   m2=$2
   #/"/ =~ strs
   if m1 # !$& && m1
     return (mainloop("print #{m1}");mainloop("print #{m2}"))
   else
     a= calc(strs,env)
     print a
     return (mainloop($`.to_s+a+$'.to_s) )
   end
 end
 # puts
 /puts  *((.|\n)+)/ =~ da
 strs=$1
 if strs
   /(.*),(.*)/ =~ strs
   m1=$1
   m2=$2
   #/"/ =~ strs
   if m1
     return (mainloop("puts #{m1}");mainloop("puts #{m2}")) 
   else
     a= calc(strs,env)
     puts a
     return (mainloop($`.to_s+a+$'.to_s) )
   end
 end
 # browse
 /^http.*/ =~ da
 browse($&) if $&
 # browse
 /.*\.txt/ =~ da
 editor=""
 editor=geteditor(env) if exist("editor",env)
 edit($&,editor) if $&
 # reval
 /(([a-zA-Z_][a-zA-Z_0-9]*)(\[ *([0-9]+) *\])?) *= *([rk]eval.+)/ =~ da
 a=$1
 a=$2+"["+$3+"]" if $3
 rk=$5
 if a
   /keval\( *([^,]*)(, *.+)?\)/ =~rk
   rk="keval("+$1+",env)" if !$2 && $1
   return setval(a, eval(rk).to_s,env,true)
 end
 # file to Array
 /(([a-zA-Z_][a-zA-Z_0-9]*)(\[ *([0-9]+) *\])?) *(=|<<) *file\( *(.+) *\)/ =~ da
 a=$2
 ind=$4
 op=$5
 f=$6
 if a
   mode="r"
   /(.*) *, *(.*)/ =~ f
   if $&
     f=$1
     mode=$2
   end
   tmp=[]
   /^"(.*)"$/ =~ f
   f=$1 if $&
   open(f,mode){|fi|
     tmp=fi.readlines
   }
   #p tmp
   start=indmax(a,env)
   (arreset(a,env) ; start=0) if op=='=' && !ind
   start=ind.to_i if ind
   tmp.length.times{|i|
     puts a+"[#{i+start}]",tmp[i] if $debug
     setval(a+"[#{i+start}]",tmp[i],env,true)
   }
   return ""
 end
 # simple equation
 /([a-zA-Z_][a-zA-Z_0-9]*(\[[0-9]+\])?) *= *(.+)/ =~ da
 a=$1
 b=$3
 if a
   return setval(a,b,env)
 else
   if da=="??"
     env.hlist.each{|i| 
       puts $prprompt+i+"= '"+env.mem[env.assign[i]].to_s+"'"
     }
     return""
   elsif da=="?"
     puts env.hlist*","
     return ""
   elsif da=="???" || da=="?3"
     p env.mem,env.hlist,env.assign
     return ""
   elsif da=="his"
     p env.his
     return ""
   elsif da=="hiss"
     return memo(env)
   elsif da=="hisl"
     return mainloop("!load #{$hisfile}",env)
   elsif exist(da,env) 
     a=env.mem[env.assign[da]]
     system(a[1..-1]) if a.class==String && a[0..0]=="$"
     return a
   elsif da=="????" || da=="?4"
     print "hensuu:\t"
     p env.hlist
     print "assign:\t"
     p env.assign
     print "memory:\t"
     p env.mem
     print "env:\t"
     p $envs
     puts
     return ""
   elsif da=="?????" || da=="?5"
     $envs.each{|e|
       puts "env::"+":"*30+"("+e+")"
       mainloop("?",eval("$"+e))
     }
     puts
     return ""
   elsif da=="??????" || da=="?6"
     $envs.each{|e|
       puts "env:"+"."*30+" ("+e+")"
       mainloop("????",eval("$"+e))
     }
     return ""
   elsif da=="???????" || da=="?e"
     $envs.each{|e|
       p eval("$"+e)
     }
     return ""
   elsif da=='$'
     exit
   elsif da=='exit'
     memo env
     exit
   elsif da[0..9]=='@namespace' || da[0..2]=='@ns' 
     /[^ ]+ *(.*)/ =~ da
     if !$1
       p env
       return ""
     end
     envname=getstr $1
     (p $envs;return"") if envname==""
     if ! $envs.member?(envname)
       name="$#{envname}"
       eval(name+"=Env.new")
       $envs<<envname
       eval("$current="+name)
       $current.reset
     else
       eval("$current=$"+envname)
     end
     $currentname=envname
     mainloop("?",$current)
     return""
   elsif da=='help'
     help
     return ""
   elsif da=='show'
     $show=!$show
     return ""
   elsif da=='debug'
     $show=true
     $debug=true
     return ""
   elsif da=='undebug'
     $show=false
     $debug=false
     return ""
   elsif da[0,8]=="isarray?"
     a=isarray?(da[8..-1],env).to_s
     puts a
     return a
   elsif da=='reset'
     env.reset
     return ""
   elsif da[0,4]=='keval'
     a = keval(da[5..-1],env)
     p a
     return a
   elsif da[0,5]=='reval'
     a = reval(da[6..-1])
     p a
     return a
   elsif da[0,6]=='$eopen'
     file =getfname da[6..-1]
     edit(file,geteditor(env))
     return ""
   elsif da[0,1]=='$'
     puts da[1..-1]
     system(da[1..-1])
     return ""
   elsif da[0,5]=="!load"
     loadf da[5..-1]
     return ""
     # puts "loaded \'#{file}\'."
   elsif da[0,2]=="!l"
     loadf da[2..-1]
     return ""
   elsif da[0,5]=="!save"
     file =getfname da[5..-1]
     open(file,"a"){|f| 
       env.hlist.each{|i| 
         f.puts i.to_s+"="+env.mem[env.assign[i]].to_s
       }
     }
     return "saved as \'#{file}\'."
   else
     a=calc(da,env)
     return a
   end
 end
end

def help
 puts "example: 'x=1','y=text','?'(list),'z=x*2+(5-x)','!save [file]'(file save),'!load [file]', '???'(internal hensu dump),'$dir'(exec system.command) etc."
end

# check whether this block is a single line
def blockok d
  flag = false
  a=d.gsub(/[^\{\}]/,'')
  a=a.gsub(/\{\}/,'')
  while $& ;a=a.gsub(/\{\}/,'') end
  #p "a=",a
  return false if a!="" 
  /puts *"((.|\n)*)/ =~ d
  if $&
    #p "qst:"+$1+".m:"+$&
    /"/ =~$1
    if !$&
      return false
    end
  end
  /print *"[^"]*$/ =~ d
  return false if $&
  true
end

def commentoff da
  /[ \t]*#.*/ =~da
  flag =false
  a =$&
  b =$`
  if a
    flag =true
    /^\{[^\}]+\}/ =~a
    flag =false if $&
    /\"/ =~a
    flag =false if $&
  end
  return b if flag
  da
end


def main da, env=$current
  line=$stack.pop 
  data=commentoff(da.chomp)
  ($stack.push(""); return "") if data=="" && line==""
  if line!=""
    /^[^\\]*\"[^\"]*$/ =~ line 
    if $&
      line = line +"\n" + da.chomp
    else
      line = line+";"+ data
    end
  else
    line = data
  end
  p "l:"+line if $debug
  $stack.push(line) 
  if blockok(line)
    p"blk:"+line if $debug
    an=mainloop(line,env)
    puts an if $show
    mainloop("??",env) if $debug
    showprompt if $mode!="load" || $show
    $stack.pop
    line=""
    $stack.push(line)
  else
    print $repprompt if $mode!="load" || $show
  end
end


def searchlabel label,lines=$lines
  n=0
  puts "label:"+label if $debug
  lines.each{|i|
    / *#{label.chomp}: */ =~ i
    return n if $&
    n+=1
  }
  false
end

def loadf fname
 $mode="load"
 file =getfname fname
 lines=[]
 open(file,"r"){|f|
   lines =f.readlines
 }
 $lines=lines
 lnum=0
 $stack.push("")
 len=lines.length
 while lnum<len
   print lnum.to_s+":",lines[lnum],"("+file +")" if $show
   /^ *goto *([^ ]+)/ =~lines[lnum]
   if $&
     lnum =searchlabel($1,lines)
     exit if !lnum
   end
   /^ *[0-9a-zA-Z]+: *$/ =~ lines[lnum]
   lnum+=1 if $&
   #p lines[lnum],file
   main(lines[lnum]) if lines[lnum]!=nil
   (lnum =searchlabel($glabel,lines);$gflag=false) if $gflag
   lnum+=1
 end
 $stack.pop
 $mode=""
end


### start ###

if ARGV==[]
  # dialog mode
  showprompt
  while gets
    main $_, $current
  end
else
  ag=ARGV
  if ag[0]=='-v'
    puts $version
    exit
  elsif ag[0]=='-debug'
    $debug=true
    ag[0]=ag[1]
  end
  # file load mode
  loadf ag[0]
end
トラックバック - http://rubyist.g.hatena.ne.jp/hatecha/20071220

12/19(水) 2007

めも

| めも - たばさの を含むブックマーク はてなブックマーク - めも - たばさの

http://golf.shinh.org/

http://www.darrenks.com/golfscript/index.html


スタックに積まれる。

入力はEOFまでスタックに積まれてからスクリプトが開始される。

 pipe使わなくてもいいけど、その場合はCtrl+Zしないと開始しないよ。

そして終了時にスタックにあるものすべてが出力される。


ということなので、echoはなにもしない。スタックだから逆順にしなきゃ駄目かとおもいきやそうではないようだ*1。そのた、簡単なものをとりあえず。

102:z;  # zを102と定義、;でスタックから取り除く。
z 1 -:z;  # z,1の順にスタックに積み、-でz-1を実行、それをzに入れ、;でスタックから取り除く。
{z 0 >}{z 1 -:z;z print " です。" puts}while; # z>0の間、ブロック(z=z-1、z表示)を繰り返す。

実行結果

(略)
8 です。
7 です。
6 です。
5 です。
4 です。
3 です。
2 です。
1 です。
0 です。

ちなみにz printの前の;を に変えると後ろにスタックに残った次のものが出力されるようですよ。

10099989796959493929190898887868584838281807978777675747372717069686766656463626
16059585756555453525150494847464544434241403938373635343332313029282726252423222
12019181716151413121110987654321

smileysをプリント。

| smileysをプリント。 - たばさの を含むブックマーク はてなブックマーク - smileysをプリント。 - たばさの

http://golf.shinh.org/p.rb?Smileys+Triangle

# smileys0.gs
':'puts
':-'puts
':-)':a;
0:i;
{i 32 <}{a . print; ['))'] i * '' * . print;i 1 +:i;n print;}while;

しかしスタックに積むだけでよい。

# smileys1.gs
':'n
':-'n
':-)':a;
0:i;
{i 32<}{a['))']i*''* i 1+:i;n}while

これも逆順じゃないんだな。なんかスタックっぽくないような。

電卓 続き 正規表現まわり

| 電卓 続き 正規表現まわり - たばさの を含むブックマーク はてなブックマーク - 電卓 続き 正規表現まわり - たばさの

履歴参照

# koneko-0.4.8.rb

$os="win"

require 'Win32API' if $os=="win"

$mode=""
$stack=[""]

$prompt=">"
$lprompt=">>"
$prprompt=":"
$repprompt="|>"
$show=false
$debug=false
$editor=""
$IOI="STDIN."

def keval(a,env)
  p a if $debug
  env.hlist.each{|v|
    a.gsub!(v,env.mem[env.assign[v]])
  }
  eval(a)
end

def reval a
  p a if $debug
  v=eval(a)
  p v
  v
end

def edit txt,editor=$editor
  if editor=="type"
    system("type #{txt}")
  elsif editor!=""
    `#{editor} #{txt}` 
  else
    browse txt
  end
end

def browse ur
  return if $os!="win"
  shellexecute = Win32API.new('shell32.dll','ShellExecuteA',%w(p p p p p i),'i')
  shellexecute.call(0, 'open', ur, 0, 0, 1)
end

class Env
 attr_accessor(:hlist,:assign,:mem,:his)
 def reset
   @mem=[]
   @hlist=[]
   @assign={}
   @his=[]
 end
end

$base = Env.new
$envs=["base"]
$base.reset
$current=$base
$currentname="base"
$hisfile="hensu-his.txt"

def showprompt
  print $currentname+$prompt
end

class Fv
 attr_accessor(:hlist,:assign,:name,:argv,:body)
end


def exist x,env
 env.hlist.member?(x)
end

def isarray? a,env
  / *(.*)/=~a
  a=$1
  env.hlist.each{|m|
    /#{calc(a,env)}\[/ =~ m
    # p m,$&
    return true if $&
  }
  false
end

def isstr? a,env
  exist a,env
end

def existusing x
 /(.*):(.*)/ =~ x
 return [false,nil,nil]if !$&
 $envs.each{|en|
   next if en!=$1
   env=eval("$"+en)
   return [true,env,$2] if exist($2,env)
   return [false,nil,nil]
 }
 [false,nil,nil]
end

def indmax ar,env
  i=0
  while exist(ar+"["+i.to_s+"]",env)
    i+=1
  end
  i
end

def existarray ar,env
  i=0
  exist(ar+"["+i.to_s+"]",env)
end

def arreset(ar,env)
  i=0
  while exist(ar+"["+i.to_s+"]",env)
    setvalstr(ar+"["+i.to_s+"]","",env)
    i+=1
  end
  i
end

def existf x,env
 /\(.*\)/ =~x
 return false if !$`
 name=$`
 env.hlist.each{|i|
  /\(.*\)/ =~i
  n=$`
 # p"exf",x,n,name,"$$"
  if $&
    if n==name
      return true
    end
  end
 }
 false
end

def getfunc x,env
 /\(([^\)]*)\)/ =~x
 vals=$1
 name=$`
 env.hlist.each{|i|
  /\(([^\)]*)\)/ =~i
  n=$`
  if $&
    if n==name
      arg =$1
      return [i,arg.split(','),vals.split(',')]
    end
  end
 }
 false
end

def set x,env
 n=0
 while 1
  (env.assign[x]=n ;env.mem[n]=""; break) if env.mem[n]==nil
  n+=1
 end
end

def argcalc arg,vals,a
  tmp=a.dup
  arg.length.times{|i|
    v=mainloop(vals[i])
    tmp.gsub!(arg[i],v)
  }
  mainloop(tmp)
end

# uhenchi
def calc d,env
 /^"([^"]*)"/ =~d
 str=$&
 mae=$`
 usr=$'
 if str
   tmp =$1.gsub("\\n","\n")
   /\#\{([^\}]*)\}/ =~ tmp
   if $&
     return calc(mae+"\""+$`+mainloop($1,env)+$'+"\""+usr,env)
   end
   return mae+tmp+usr if !$&
 end
 /^'([^']*)'/ =~d
 str=$&
 mae=$`
 usr=$'
 if str
   tmp =$1.gsub("\\n","\n")
   /\#\{([^\}]*)\}/ =~ tmp
   if $&
     return calc(mae+"\'"+$`+mainloop($1,env)+$'+"\'"+usr,env)
   end
   return mae+tmp+usr if !$&
 end
 /- *-[0-9]+/=~d
 d.gsub!(/- *-/,'+') if $&
 # func(..)
 /([a-zA-Z_][a-zA-Z_0-9]*\([^\)]+\))/ =~ d
 mae=$`
 usr=$'
 if $1
  if existf($1,env)
   f,arg,vals =getfunc($1,env)
   a = env.mem[env.assign[f]]
   a = argcalc(arg,vals,a)
   # p a,f,arg,vals,"$!$"
   return calc(mae+a.to_s+usr,env)
  else
   return calc(mae+usr,env)
  end
 end
 return calc($`+calc($1,env)+$',env) if $1
 # (...)
 /(.*)\(([^\)]+)\)(.*)/ =~ d
 return calc($1+calc($2,env)+$3,env) if $2
 # array
 /([a-zA-Z_0-9]+)\[([^\.])\.\.([^\.])\]/ =~d
 return calc($`+calc($1,env)[$2.to_i..$3.to_i]+$',env) if $&
 # ..*/..
 /([a-zA-Z_0-9\.\[\]]+ *[\*\/] *[a-zA-Z_0-9\.\[\]]+) *([+\/\*\-].+)/ =~ d
 return calc($`+calc($1,env)+$2,env) if $2
 # ..*/..
 /(.+[+\/\*\-]) *([a-zA-Z_0-9\.\[\]]+ *[\*\/] *[a-zA-Z_0-9\.\[\]]+)/ =~ d
 return calc($1+calc($2,env)+$',env) if $2
 # ..+-..
 /([a-zA-Z_0-9\.\[\]]+ *[+\-] *[a-zA-Z_0-9\.\[\]]+) *([+-].+)/ =~ d
 return calc($`+calc($1,env)+$2,env) if $2
 # p d
 /([a-zA-Z_0-9\.\[\]]+) *([+\*\-\/%]) *([a-zA-Z_0-9\.\[\]]+)/=~d
 a=$1
 si=$2
 c=$3
 if !a
  f,en,a = existusing(d)
  if f
   a =en.mem[en.assign[a]]
   return a.to_s
  elsif exist(d,env)
   a = env.mem[env.assign[d]]
   return a.to_s
  else 
   system(d[1..-1]) if d.class==String && d.length>0 && d[0,1]=="$"
   return d 
  end
 end
 if exist($1,env)
  a=env.mem[env.assign[$1]] 
 else
  a=$1
 end
 if exist($3,env)
  c=env.mem[env.assign[$3]] 
 else
  c=$3
 end
 /[^0-9e+\-\. ]/ =~ a.to_s
 f1=$&
 /[^0-9e+\-\. ]/ =~ c.to_s
 f2=$&
 return calc(a,env).to_s + calc(c,env).to_s if f2!=nil || f1!=nil
 return calc(eval(calc(a,env).to_s + si + calc(c,env).to_s ).to_s,env)
end

def getfname da
 / *(.+)/ =~ da
 file =$1
 if !$1
   file ="mylog.txt" 
 else
   /\./ =~file
   file =file+".ko" if !$&
 end
 file
end

def getstr da
 / *(.+)/ =~ da
 file =$1
 file ="" if !$1
 file
end

def memo env
 open($hisfile,'a'){|f|
  f.puts env.his
 }
end

def funccalc a,b,c
  fn=Fv.new
  fn.name=a
  fn.argv=b.split(',')
  fn.body=c
  fn
end

def setval a,b,env,eva=false
  (env.hlist<<a) if !exist a,env
  set a,env if env.assign[a]==nil 
  envfrom=env
  f,en,v =existusing(b)
  (envfrom=en;b=v) if f
  if eva
    v=b
  else
    v=calc(b,envfrom)
    v="nul" if v==nil
  end
  env.mem[env.assign[a]] =v
  return env.mem[env.assign[a]]
end

def setvalstr a,b,env
  setval a,b,env,true
end

def geteditor env
  return "" if !env.hlist.member?("editor")
  env.mem[env.assign["editor"]]
end

def mainloop da,env=$base
 env.his<<da
 p "m:"+da if $debug
 # comment
 # p
 / *p  *(.*)/ =~ da
 if $&
   p mainloop($1,env)
   return $` 
 end
 # regexp
 /\/[^\/]+\/ *=~.*/ =~ da
 eval($&) if $&
 eval("$match=$~") if $&
 if $1
   9.times{|i|
     p eval("$#{i+1}") if $debug
     eval("setval(\"$#{i+1}\",$#{i+1},env)") 
   }
   setval("$&",$&,env)
   setval("$`",$`,env)
   setval("$'",$',env)
 end
 # file :write array
 /file\(([^\)]+)\) *(=|<<) *(.*)/ =~ da
 f=$1
 op=$2
 a=$3
 if f
   /(.*),(.*)/ =~ f
   if $&
     f=$1
     mode=$2
   else
     mode='w' if op=='='
     mode='a' if op=='<<'
   end
   open(f,mode){|fo|
     if existarray(a,env)
       imax=ii=indmax(a,env)
       while ii>0
         line=calc(a+"["+(imax-ii).to_s+"]",env)
         fo.puts(line)
         ii-=1
       end
     elsif !exist(a,env)
       fo.puts(calc(a,env))
     else
       fo.puts(a)
     end
   }
   return ""
 end
 # function
 /([a-zA-Z_][a-zA-Z_0-9]*\((.*)\)) *=(.+)/ =~ da
 if $&
   a=funccalc $1,$2,$3
   # p a
   env.hlist<<a.name if !exist a.name,env
   set a.name,env if env.assign[a.name]==nil 
   env.mem[env.assign[a.name]]=$3 #calc($3,env)
   return a.name
 end
 # while
 /while  *([^><=]+)(!?[=><]+)(.+)  *\{([^\}]+)\}/ =~ da
 mae,usr,m1,m2,m3,body =$`,$',$1,$2,$3,$4
 if $1
  ans =calc($1,env)+$2+calc($3,env)
  if eval(ans)
    / *break */=~ mainloop(body,env)
    if $&
      return mainloop(mae+usr,env)
    end
    return mainloop(mae+"while "+m1+m2+m3+" {"+body+"}"+usr,env)
  else
    return mainloop(mae+usr,env)
  end
 end
 /while  *([^\{]+)  *\{([^\}]+)\}/ =~ da
 mae,usr,cond,body =$`,$',$1,$2
 if cond
  ans =mainloop(cond,env)
  if ans
    / *break */=~ mainloop(body,env)
    if $&
      return mainloop(mae+usr,env)
    end
    return mainloop(mae+"while "+cond+" {"+body+"}"+usr,env)
  else
    return mainloop(mae+usr,env)
  end
 end
 # num.times
 /([a-zA-Z_0-9]+)\.times *\{ *([^\}]+) *\}/ =~ da
 body=$2
 if $&
  num=calc($1,env).to_i
  return num.times{ |it|
    a=body.gsub("it", it.to_s)
    a=a.gsub("ti", (num-it).to_s)
    print "(#{a})",$repprompt if $debug
    / *break */=~ mainloop(a,env)
    break if $&
  }
 end
 # gets
 /gets(\([^\)]*\))?/ =~ da
 if $&
   inp=$IOI+$&
   a=eval(inp)
   setval("$_",$_,env)
   return a if $`=="" && $'==""
   a="" if a==nil
   return mainloop($`+a+$',env)
 end
 # multi
 /([^;]*);(.*)/ =~ da
 m1=$1
 m2=$2
 if $1
   ans =mainloop $1,env
   / *break */ =~ ans
   return "break" if $&
   return mainloop(m2,env)
 end
 /if  *(.+)([!=]=)(.+)  *then *(.+)/ =~ da
 mae,usr,m1,m2,m3,mtrue =$`,$',$1,$2,$3,$4
 if $1
  p $& if $debug
  /else  *(.*)/ =~ mtrue
  mfalse =$1
  mtrue =$` if $&
  p $& if $debug
  if m2=="=="
   if calc(m1,env)==calc(m3,env)
    return mainloop(mae +mtrue +usr,env) 
   else
    if mfalse
      return mainloop(mae+mfalse+usr,env)
    else
      return mainloop(mae+usr,env)
    end
   end
  else
   if calc(m1,env)!=calc(m3,env)
    return mainloop(mae+mtrue+usr,env)
   else
    if mfalse
      return mainloop(mae+mfalse+usr,env)
    else
      return mainloop(mae+usr,env)
    end
   end
  end
 end
 /if  *(.+)<(.+)  *then (.+)  *else  *(.+)/ =~ da
 if $1
  if calc($1,env)<calc($2,env)
    return mainloop($`+$3+$',env)
  else
    return mainloop($`+$4+$',env)
  end
 end
 /if  *(.+)>(.+)  *then (.+)  *else  *(.+)/ =~ da
 if $1
  if calc($1,env)>calc($2,env)
    return mainloop($`+$3+$',env)
  else
    return mainloop($`+$4+$',env)
  end
 end
 # print
 /print  *((.|\n)+)/ =~ da
 strs=$1
 if strs
   /(.*),(.*)/ =~ strs
   m1=$1
   m2=$2
   #/"/ =~ strs
   if m1 # !$& && m1
     return (mainloop("print #{m1}");mainloop("print #{m2}"))
   else
     a= calc(strs,env)
     print a
     return (mainloop($`.to_s+a+$'.to_s) )
   end
 end
 # puts
 /puts  *((.|\n)+)/ =~ da
 strs=$1
 if strs
   /(.*),(.*)/ =~ strs
   m1=$1
   m2=$2
   #/"/ =~ strs
   if m1
     return (mainloop("puts #{m1}");mainloop("puts #{m2}")) 
   else
     a= calc(strs,env)
     puts a
     return (mainloop($`.to_s+a+$'.to_s) )
   end
 end
 # browse
 /^http.*/ =~ da
 browse($&) if $&
 # browse
 /.*\.txt/ =~ da
 editor=""
 editor=geteditor(env) if exist("editor",env)
 edit($&,editor) if $&
 # reval
 /(([a-zA-Z_][a-zA-Z_0-9]*)(\[ *([0-9]+) *\])?) *= *([rk]eval.+)/ =~ da
 a=$1
 a=$2+"["+$3+"]" if $3
 rk=$5
 if a
   /keval\( *([^,]*)(, *.+)?\)/ =~rk
   rk="keval("+$1+",env)" if !$2 && $1
   return setval(a, eval(rk).to_s,env,true)
 end
 # file to Array
 /(([a-zA-Z_][a-zA-Z_0-9]*)(\[ *([0-9]+) *\])?) *(=|<<) *file\( *(.+) *\)/ =~ da
 a=$2
 ind=$4
 op=$5
 f=$6
 if a
   mode="r"
   /(.*) *, *(.*)/ =~ f
   if $&
     f=$1
     mode=$2
   end
   tmp=[]
   /^"(.*)"$/ =~ f
   f=$1 if $&
   open(f,mode){|fi|
     tmp=fi.readlines
   }
   #p tmp
   start=indmax(a,env)
   (arreset(a,env) ; start=0) if op=='=' && !ind
   start=ind.to_i if ind
   tmp.length.times{|i|
     puts a+"[#{i+start}]",tmp[i] if $debug
     setval(a+"[#{i+start}]",tmp[i],env,true)
   }
   return ""
 end
 # simple equation
 /([a-zA-Z_][a-zA-Z_0-9]*(\[[0-9]+\])?) *= *(.+)/ =~ da
 a=$1
 b=$3
 if a
   return setval(a,b,env)
 else
   if da=="??"
     env.hlist.each{|i| 
       puts $prprompt+i+"= '"+env.mem[env.assign[i]].to_s+"'"
     }
     return""
   elsif da=="?"
     puts env.hlist*","
     return ""
   elsif da=="???" || da=="?3"
     p env.mem,env.hlist,env.assign
     return ""
   elsif da=="his"
     p env.his
     return ""
   elsif da=="hiss"
     return memo(env)
   elsif da=="hisl"
     return mainloop("!load #{$hisfile}",env)
   elsif exist(da,env) 
     a=env.mem[env.assign[da]]
     system(a[1..-1]) if a.class==String && a[0..0]=="$"
     return a
   elsif da=="????" || da=="?4"
     print "hensuu:\t"
     p env.hlist
     print "assign:\t"
     p env.assign
     print "memory:\t"
     p env.mem
     print "env:\t"
     p $envs
     puts
     return ""
   elsif da=="?????" || da=="?5"
     $envs.each{|e|
       puts "env::"+":"*30+"("+e+")"
       mainloop("?",eval("$"+e))
     }
     puts
     return ""
   elsif da=="??????" || da=="?6"
     $envs.each{|e|
       puts "env:"+"."*30+" ("+e+")"
       mainloop("????",eval("$"+e))
     }
     return ""
   elsif da=="???????" || da=="?e"
     $envs.each{|e|
       p eval("$"+e)
     }
     return ""
   elsif da=='$'
     exit
   elsif da=='exit'
     memo env
     exit
   elsif da[0..9]=='@namespace' || da[0..2]=='@ns' 
     /[^ ]+ *(.*)/ =~ da
     if !$1
       p env
       return ""
     end
     envname=getstr $1
     (p $envs;return"") if envname==""
     if ! $envs.member?(envname)
       name="$#{envname}"
       eval(name+"=Env.new")
       $envs<<envname
       eval("$current="+name)
       $current.reset
     else
       eval("$current=$"+envname)
     end
     $currentname=envname
     mainloop("?",$current)
     return""
   elsif da=='help'
     help
     return ""
   elsif da=='show'
     $show=!$show
     return ""
   elsif da=='debug'
     $show=true
     $debug=true
     return ""
   elsif da=='undebug'
     $show=false
     $debug=false
     return ""
   elsif da[0,8]=="isarray?"
     a=isarray?(da[8..-1],env).to_s
     puts a
     return a
   elsif da=='reset'
     env.reset
     return ""
   elsif da[0,4]=='keval'
     p keval(da[5..-1],env)
     return ""
   elsif da[0,5]=='reval'
     a = reval(da[6..-1])
     p a
     return a
   elsif da[0,6]=='$eopen'
     file =getfname da[6..-1]
     edit(file,geteditor(env))
     return ""
   elsif da[0,1]=='$'
     puts da[1..-1]
     system(da[1..-1])
     return ""
   elsif da[0,5]=="!load"
     loadf da[5..-1]
     return ""
     # puts "loaded \'#{file}\'."
   elsif da[0,2]=="!l"
     loadf da[2..-1]
     return ""
   elsif da[0,5]=="!save"
     file =getfname da[5..-1]
     open(file,"a"){|f| 
       env.hlist.each{|i| 
         f.puts i.to_s+"="+env.mem[env.assign[i]].to_s
       }
     }
     return "saved as \'#{file}\'."
   else
     a=calc(da,env)
     return a
   end
 end
end

def help
 puts "example: 'x=1','y=text','?'(list),'z=x*2+(5-x)','!save [file]'(file save),'!load [file]', '???'(internal hensu dump),'$dir'(exec system.command) etc."
end

# check whether this block is a single line
def blockok d
  flag = false
  a=d.gsub(/[^\{\}]/,'')
  a=a.gsub(/\{\}/,'')
  while $& ;a=a.gsub(/\{\}/,'') end
  #p "a=",a
  return false if a!="" 
  /puts *"((.|\n)*)/ =~ d
  if $&
    #p "qst:"+$1+".m:"+$&
    /"/ =~$1
    if !$&
      return false
    end
  end
  /print *"[^"]*$/ =~ d
  return false if $&
  true
end

def commentoff da
  /[ \t]*#.*/ =~da
  flag =false
  a =$&
  b =$`
  if a
    flag =true
    /^\{[^\}]+\}/ =~a
    flag =false if $&
    /\"/ =~a
    flag =false if $&
  end
  return b if flag
  da
end


def main da, env=$current
  line=$stack.pop 
  data=commentoff(da.chomp)
  ($stack.push(""); return "") if data=="" && line==""
  if line!=""
    /^[^\\]*\"[^\"]*$/ =~ line 
    if $&
      line = line +"\n" + da.chomp
    else
      line = line+";"+ data
    end
  else
    line = data
  end
  p "l:"+line if $debug
  $stack.push(line) 
  if blockok(line)
    p"blk:"+line if $debug
    an=mainloop(line,env)
    puts an if $show
    mainloop("??",env) if $debug
    showprompt if $mode!="load" || $show
    $stack.pop
    line=""
    $stack.push(line)
  else
    print $repprompt if $mode!="load" || $show
  end
end


def loadf fname
 $mode="load"
 file =getfname fname
 open(file,"r"){|f|
   n=0
   $stack.push("")
   f.each{|dat|
     n+=1
     #p dat
     puts n.to_s+":"+dat+"("+fname +")" if $show
     main(dat)
   }
   $stack.pop
 }
 $mode=""
end


### start ###

if ARGV==[]
  # dialog mode
  showprompt
  while gets
    main $_, $current
  end
else
  # file load mode
  loadf ARGV[0]
end

*1:文字列がEOFまで1データとして積まれる

トラックバック - http://rubyist.g.hatena.ne.jp/hatecha/20071219

12/17(月) 2007

電卓 続き ファイル読み書き

| 電卓 続き ファイル読み書き - たばさの を含むブックマーク はてなブックマーク - 電卓 続き ファイル読み書き - たばさの

file(...)<<array
array<<file(...)

など。

履歴

いじってたらプリント文が一部おかしくなったけど。



# koneko-0.4.7.rb


$os="win"

require 'Win32API' if $os=="win"

$mode=""
$stack=[""]

$prompt=">"
$lprompt=">>"
$prprompt=":"
$repprompt="|>"
$show=false
$debug=false
$editor=""
$IOI="STDIN."

def edit txt,editor=$editor
  if editor=="type"
    system("type #{txt}")
  elsif editor!=""
    `#{editor} #{txt}` 
  else
    browse txt
  end
end

def browse ur
  return if $os!="win"
  shellexecute = Win32API.new('shell32.dll','ShellExecuteA',%w(p p p p p i),'i')
  shellexecute.call(0, 'open', ur, 0, 0, 1)
end

class Env
 attr_accessor(:hlist,:assign,:mem,:his)
 def reset
   @mem=[]
   @hlist=[]
   @assign={}
   @his=[]
 end
end

$base = Env.new
$envs=["base"]
$base.reset
$current=$base
$currentname="base"
$hisfile="hensu-his.txt"

def showprompt
  print $currentname+$prompt
end

class Fv
 attr_accessor(:hlist,:assign,:name,:argv,:body)
end


def exist x,env
 env.hlist.member?(x)
end


def existusing x
 /(.*):(.*)/ =~ x
 return [false,nil,nil]if !$&
 $envs.each{|en|
   next if en!=$1
   env=eval("$"+en)
   return [true,env,$2] if exist($2,env)
   return [false,nil,nil]
 }
 [false,nil,nil]
end

def indmax ar,env
  i=0
  while exist(ar+"["+i.to_s+"]",env)
    i+=1
  end
  i
end

def existarray ar,env
  i=0
  exist(ar+"["+i.to_s+"]",env)
end

def arreset(ar,env)
  i=0
  while exist(ar+"["+i.to_s+"]",env)
    setvalstr(ar+"["+i.to_s+"]","",env)
    i+=1
  end
  i
end

def existf x,env
 /\(.*\)/ =~x
 return false if !$`
 name=$`
 env.hlist.each{|i|
  /\(.*\)/ =~i
  n=$`
 # p"exf",x,n,name,"$$"
  if $&
    if n==name
      return true
    end
  end
 }
 false
end

def getfunc x,env
 /\(([^\)]*)\)/ =~x
 vals=$1
 name=$`
 env.hlist.each{|i|
  /\(([^\)]*)\)/ =~i
  n=$`
  if $&
    if n==name
      arg =$1
      return [i,arg.split(','),vals.split(',')]
    end
  end
 }
 false
end

def set x,env
 n=0
 while 1
  (env.assign[x]=n ;env.mem[n]=""; break) if env.mem[n]==nil
  n+=1
 end
end

def argcalc arg,vals,a
  tmp=a.dup
  arg.length.times{|i|
    v=mainloop(vals[i])
    tmp.gsub!(arg[i],v)
  }
  mainloop(tmp)
end

# uhenchi
def calc d,env
 /^\"([^\"]*)\"/ =~d
 str=$&
 mae=$`
 usr=$'
 if str
   tmp =$1.gsub("\\n","\n")
   /\#\{([^\}]*)\}/ =~ tmp
   if $&
     return calc(mae+"\""+$`+calc($1,env)+$'+"\""+usr,env)
   end
   return mae+tmp+usr if !$&
 end
 /- *-[0-9]+/=~d
 d.gsub!(/- *-/,'+') if $&
 # func(..)
 /([a-zA-Z_][a-zA-Z_0-9]*\([^\)]+\))/ =~ d
 mae=$`
 usr=$'
 if $1
  if existf($1,env)
   f,arg,vals =getfunc($1,env)
   a = env.mem[env.assign[f]]
   a = argcalc(arg,vals,a)
   # p a,f,arg,vals,"$!$"
   return calc(mae+a.to_s+usr,env)
  else
   return calc(mae+usr,env)
  end
 end
 return calc($`+calc($1,env)+$',env) if $1
 # (...)
 /(.*)\(([^\)]+)\)(.*)/ =~ d
 return calc($1+calc($2,env)+$3,env) if $2
 # array
 /([a-zA-Z_0-9]+)\[([^\.])\.\.([^\.])\]/ =~d
 return calc($`+calc($1,env)[$2.to_i..$3.to_i]+$',env) if $&
 # ..*/..
 /([a-zA-Z_0-9\.\[\]]+ *[\*\/] *[a-zA-Z_0-9\.\[\]]+) *([+\/\*\-].+)/ =~ d
 return calc($`+calc($1,env)+$2,env) if $2
 # ..*/..
 /(.+[+\/\*\-]) *([a-zA-Z_0-9\.\[\]]+ *[\*\/] *[a-zA-Z_0-9\.\[\]]+)/ =~ d
 return calc($1+calc($2,env)+$',env) if $2
 # ..+-..
 /([a-zA-Z_0-9\.\[\]]+ *[+\-] *[a-zA-Z_0-9\.\[\]]+) *([+-].+)/ =~ d
 return calc($`+calc($1,env)+$2,env) if $2
 # p d
 /([a-zA-Z_0-9\.\[\]]+) *([+\*\-\/%]) *([a-zA-Z_0-9\.\[\]]+)/=~d
 a=$1
 si=$2
 c=$3
 if !a
  f,en,a = existusing(d)
  if f
   a =en.mem[en.assign[a]]
   return a.to_s
  elsif exist(d,env)
   a = env.mem[env.assign[d]]
   return a.to_s
  else 
   system(d[1..-1]) if d.class==String && d.length>0 && d[0,1]=="$"
   return d 
  end
 end
 if exist($1,env)
  a=env.mem[env.assign[$1]] 
 else
  a=$1
 end
 if exist($3,env)
  c=env.mem[env.assign[$3]] 
 else
  c=$3
 end
 /[^0-9e+\-\. ]/ =~ a.to_s
 f1=$&
 /[^0-9e+\-\. ]/ =~ c.to_s
 f2=$&
 return calc(a,env).to_s + calc(c,env).to_s if f2!=nil || f1!=nil
 return calc(eval(calc(a,env).to_s + si + calc(c,env).to_s ).to_s,env)
end

def getfname da
 / *(.+)/ =~ da
 file =$1
 if !$1
   file ="mylog.txt" 
 else
   /\./ =~file
   file =file+".ko" if !$&
 end
 file
end

def getstr da
 / *(.+)/ =~ da
 file =$1
 file ="" if !$1
 file
end

def memo env
 open($hisfile,'a'){|f|
  f.puts env.his
 }
end

def funccalc a,b,c
  fn=Fv.new
  fn.name=a
  fn.argv=b.split(',')
  fn.body=c
  fn
end

def setval a,b,env,eva=false
  (env.hlist<<a) if !exist a,env
  set a,env if env.assign[a]==nil 
  envfrom=env
  f,en,v =existusing(b)
  (envfrom=en;b=v) if f
  if eva
    v=b
  else
    v=calc(b,envfrom)
    v="nul" if v==nil
  end
  env.mem[env.assign[a]] =v
  return env.mem[env.assign[a]]
end

def setvalstr a,b,env
  setval a,b,env,true
end

def geteditor env
  return "" if !env.hlist.member?("editor")
  env.mem[env.assign["editor"]]
end

def mainloop da,env=$base
 env.his<<da
 p "m:"+da if $debug
 # comment
 # p
 / *p  *(.*)/ =~ da
 if $&
   p mainloop($1,env)
   return $` 
 end
 # regexp
 /\/[^\/]+\/ *=~.*/ =~ da
 eval($&) if $&
 if $1
   9.times{|i|
     p eval("$#{i+1}") if $debug
     eval("setval(\"$#{i+1}\",$#{i+1},env)") 
   }
   setval("$&",$&,env)
   setval("$`",$`,env)
   setval("$'",$',env)
 end
 # file :write array
 /file\(([^\)]+)\) *(=|<<) *(.*)/ =~ da
 f=$1
 op=$2
 a=$3
 if f
   mode='w' if op=='='
   mode='a' if op=='<<'
   open(f,mode){|fo|
     if existarray(a,env)
       imax=ii=indmax(a,env)
       while ii>0
         line=calc(a+"["+(imax-ii).to_s+"]",env)
         fo.puts(line)
         ii-=1
       end
     elsif !exist(a,env)
       fo.puts(calc(a,env))
     else
       fo.puts(a)
     end
   }
   return ""
 end
 # function
 /([a-zA-Z_][a-zA-Z_0-9]*\((.*)\)) *=(.+)/ =~ da
 if $&
   a=funccalc $1,$2,$3
   # p a
   env.hlist<<a.name if !exist a.name,env
   set a.name,env if env.assign[a.name]==nil 
   env.mem[env.assign[a.name]]=$3 #calc($3,env)
   return a.name
 end
 # while
 /while  *([^><=]+)(!?[=><]+)(.+)  *\{([^\}]+)\}/ =~ da
 mae,usr,m1,m2,m3,body =$`,$',$1,$2,$3,$4
 if $1
  ans =calc($1,env)+$2+calc($3,env)
  if eval(ans)
    / *break */=~ mainloop(body,env)
    if $&
      return mainloop(mae+usr,env)
    end
    return mainloop(mae+"while "+m1+m2+m3+" {"+body+"}"+usr,env)
  else
    return mainloop(mae+usr,env)
  end
 end
 /while  *([^\{]+)  *\{([^\}]+)\}/ =~ da
 mae,usr,cond,body =$`,$',$1,$2
 if cond
  ans =mainloop(cond,env)
  if ans
    / *break */=~ mainloop(body,env)
    if $&
      return mainloop(mae+usr,env)
    end
    return mainloop(mae+"while "+cond+" {"+body+"}"+usr,env)
  else
    return mainloop(mae+usr,env)
  end
 end
 # num.times
 /([a-zA-Z_0-9]+)\.times *\{ *([^\}]+) *\}/ =~ da
 body=$2
 if $&
  num=calc($1,env).to_i
  return num.times{ |it|
    a=body.gsub("it", it.to_s)
    a=a.gsub("ti", (num-it).to_s)
    print "(#{a})",$repprompt if $debug
    / *break */=~ mainloop(a,env)
    break if $&
  }
 end
 # gets
 /gets(\([^\)]*\))?/ =~ da
 if $&
   inp=$IOI+$&
   a=eval(inp)
   setval("$_",$_,env)
   return a if $`=="" && $'==""
   a="" if a==nil
   return mainloop($`+a+$',env)
 end
 # multi
 /([^;]*);(.*)/ =~ da
 m1=$1
 m2=$2
 if $1
   ans =mainloop $1,env
   / *break */ =~ ans
   return "break" if $&
   return mainloop(m2,env)
 end
 /if  *(.+)([!=]=)(.+)  *then *(.+)/ =~ da
 mae,usr,m1,m2,m3,mtrue =$`,$',$1,$2,$3,$4
 if $1
  p $& if $debug
  /else  *(.*)/ =~ mtrue
  mfalse =$1
  mtrue =$` if $&
  p $& if $debug
  if m2=="=="
   if calc(m1,env)==calc(m3,env)
    return mainloop(mae +mtrue +usr,env) 
   else
    if mfalse
      return mainloop(mae+mfalse+usr,env)
    else
      return mainloop(mae+usr,env)
    end
   end
  else
   if calc(m1,env)!=calc(m3,env)
    return mainloop(mae+mtrue+usr,env)
   else
    if mfalse
      return mainloop(mae+mfalse+usr,env)
    else
      return mainloop(mae+usr,env)
    end
   end
  end
 end
 /if  *(.+)<(.+)  *then (.+)  *else  *(.+)/ =~ da
 if $1
  if calc($1,env)<calc($2,env)
    return mainloop($`+$3+$',env)
  else
    return mainloop($`+$4+$',env)
  end
 end
 /if  *(.+)>(.+)  *then (.+)  *else  *(.+)/ =~ da
 if $1
  if calc($1,env)>calc($2,env)
    return mainloop($`+$3+$',env)
  else
    return mainloop($`+$4+$',env)
  end
 end
 # print
 /print  *((.|\n)+)/ =~ da
 strs=$1
 if strs
   /(.*),(.*)/ =~ strs
   return (mainloop("print #{$1}");mainloop("print #{$2}")) if $&
 end
 ( a= calc(strs,env)
   print a
   return $`.to_s+a+$'.to_s ) if strs
 # puts
 /puts  *((.|\n)+)/ =~ da
 strs=$1
 if strs
   /(.*),(.*)/ =~ strs
   return (mainloop("puts #{$1}");mainloop("puts #{$2}")) if $&
 end
 ( a= calc(strs,env)
   puts a
   return $`.to_s+a+$'.to_s ) if strs
 # browse
 /^http.*/ =~ da
 browse($&) if $&
 # browse
 /.*\.txt/ =~ da
 editor=""
 editor=geteditor(env) if exist("editor",env)
 edit($&,editor) if $&
 # file to Array
 /([a-zA-Z_][a-zA-Z_0-9]*(\[[0-9]+\])?) *(=|<<) *file\((.+)\)/ =~ da
 a=$1
 op=$3
 f=$4
 if a
   tmp=[]
   /^"(.*)"$/ =~ f
   f=$1 if $&
   open(f){|fi|
     tmp=fi.readlines
   }
   #p tmp
   start=indmax(a,env)
   (arreset(a,env) ; start=0) if op=='='
   tmp.length.times{|i|
     puts a+"[#{i+start}]",tmp[i] if $debug
     setval(a+"[#{i+start}]",tmp[i],env,true)
   }
   return ""
 end
 # simple equation
 /([a-zA-Z_][a-zA-Z_0-9]*(\[[0-9]+\])?) *= *(.+)/ =~ da
 a=$1
 b=$3
 if a
   return setval(a,b,env)
 else
   if da=="??"
     env.hlist.each{|i| 
       puts $prprompt+i+"= '"+env.mem[env.assign[i]].to_s+"'"
     }
     return""
   elsif da=="?"
     puts env.hlist*","
     return ""
   elsif da=="???"
     p env.mem,env.hlist,env.assign
     return ""
   elsif da=="his"
     p env.his
     return ""
   elsif da=="hiss"
     return memo(env)
   elsif da=="hisl"
     return mainloop("!load #{$hisfile}",env)
   elsif exist(da,env) 
     a=env.mem[env.assign[da]]
     system(a[1..-1]) if a.class==String && a[0..0]=="$"
     return a
   elsif da=="????"
     print "hensuu:\t"
     p env.hlist
     print "assign:\t"
     p env.assign
     print "memory:\t"
     p env.mem
     print "env:\t"
     p $envs
     puts
     return ""
   elsif da=="?????"
     $envs.each{|e|
       puts "env::"+":"*30+"("+e+")"
       mainloop("?",eval("$"+e))
     }
     puts
     return ""
   elsif da=="??????"
     $envs.each{|e|
       puts "env:"+"."*30+" ("+e+")"
       mainloop("????",eval("$"+e))
     }
     return ""
   elsif da=='$'
     exit
   elsif da=='exit'
     memo env
     exit
   elsif da[0..9]=='@namespace'
     envname=getstr da[10..-1]
     (p $envs;return"") if envname==""
     if ! $envs.member?(envname)
       name="$#{envname}"
       eval(name+"=Env.new")
       $envs<<envname
       eval("$current="+name)
       $current.reset
     else
       eval("$current=$"+envname)
     end
     $currentname=envname
     mainloop("?",$current)
     return""
   elsif da=='help'
     help
     return ""
   elsif da=='show'
     $show=!$show
     return ""
   elsif da=='debug'
     $show=true
     $debug=true
     return ""
   elsif da=='undebug'
     $show=false
     $debug=false
     return ""
   elsif da=='reset'
     env.reset
     return ""
   elsif da[0,6]=='$eopen'
     file =getfname da[6..-1]
     edit(file,geteditor(env))
     return ""
   elsif da[0,1]=='$'
     puts da[1..-1]
     system(da[1..-1])
     return ""
   elsif da[0,5]=="!load"
     loadf da[5..-1]
     return ""
     # puts "loaded \'#{file}\'."
   elsif da[0,2]=="!l"
     loadf da[2..-1]
     return ""
   elsif da[0,5]=="!save"
     file =getfname da[5..-1]
     open(file,"a"){|f| 
       env.hlist.each{|i| 
         f.puts i.to_s+"="+env.mem[env.assign[i]].to_s
       }
     }
     return "saved as \'#{file}\'."
   else
     a=calc(da,env)
     return a
   end
 end
end

def help
 puts "example: 'x=1','y=text','?'(list),'z=x*2+(5-x)','!save [file]'(file save),'!load [file]', '???'(internal hensu dump),'$dir'(exec system.command) etc."
end

# check whether this block is a single line
def blockok d
  flag = false
  a=d.gsub(/[^\{\}]/,'')
  a=a.gsub(/\{\}/,'')
  while $& ;a=a.gsub(/\{\}/,'') end
  #p "a=",a
  return false if a!="" 
  /puts *"((.|\n)*)/ =~ d
  if $&
    #p "qst:"+$1+".m:"+$&
    /"/ =~$1
    if !$&
      return false
    end
  end
  /print *"[^"]*$/ =~ d
  return false if $&
  true
end

def commentoff da
  /[ \t]*#.*/ =~da
  flag =false
  a =$&
  b =$`
  if a
    flag =true
    /^\{[^\}]+\}/ =~a
    flag =false if $&
    /\"/ =~a
    flag =false if $&
  end
  return b if flag
  da
end


def main da, env=$current
  line=$stack.pop 
  data=commentoff(da.chomp)
  ($stack.push(""); return "") if data=="" && line==""
  if line!=""
    /^[^\\]*\"[^\"]*$/ =~ line 
    if $&
      line = line +"\n" + da.chomp
    else
      line = line+";"+ data
    end
  else
    line = data
  end
  p "l:"+line if $debug
  $stack.push(line) 
  if blockok(line)
    p"blk:"+line if $debug
    an=mainloop(line,env)
    puts an if $show
    mainloop("??",env) if $debug
    showprompt if $mode!="load" || $show
    $stack.pop
    line=""
    $stack.push(line)
  else
    print $repprompt if $mode!="load" || $show
  end
end


def loadf fname
 $mode="load"
 file =getfname fname
 open(file,"r"){|f|
   n=0
   $stack.push("")
   f.each{|dat|
     n+=1
     #p dat
     puts n.to_s+":"+dat+"("+fname +")" if $show
     main(dat)
   }
   $stack.pop
 }
 $mode=""
end


### start ###

if ARGV==[]
  # dialog mode
  showprompt
  while gets
    main $_, $current
  end
else
  # file load mode
  loadf ARGV[0]
end

トラックバック - http://rubyist.g.hatena.ne.jp/hatecha/20071217

12/15(土) 2007

最強の

最強の - たばさの を含むブックマーク はてなブックマーク - 最強の - たばさの

golf言語ならおらもちょっと考えた。あまりおもしろくないけど。

1でhello,world,2でecho,3で99hamaji...

というふうに問題にあわせて作る。

というのはあんまりなので、すべての言語を呼び出せて、一文字目で言語指定、二文字目からその言語でのソース。すべての問題でトップ+1バイト。*1

自動的に自分以外のトップの言語に決まるというのもいいかな。

どう?つまらないでしょ。

電卓 続き ファイル実行モード

| 電卓 続き ファイル実行モード - たばさの を含むブックマーク はてなブックマーク - 電卓 続き ファイル実行モード - たばさの

対話モードでなくてもいいようにした。

実行モードで終了時に余分に改行してしまうのはなぜだ。んー。

あとは複数行プリント文の調整などをした。

つぎはファイルopen,readか。クラス、インスタンスは難しそうだな。


# koneko.rb  ver.0.4.5


$os="win"

require 'Win32API' if $os=="win"

$mode=""
$stack=[""]

$prompt=">"
$lprompt=">>"
$prprompt=":"
$repprompt="|>"
$show=false
$debug=false
$editor=""
$IOI="STDIN."

def edit txt,editor=$editor
  if editor=="type"
    system("type #{txt}")
  elsif editor!=""
    `#{editor} #{txt}` 
  else
    browse txt
  end
end

def browse ur
  return if $os!="win"
  shellexecute = Win32API.new('shell32.dll','ShellExecuteA',%w(p p p p p i),'i')
  shellexecute.call(0, 'open', ur, 0, 0, 1)
end

class Env
 attr_accessor(:hlist,:assign,:mem,:his)
 def reset
   @mem=[]
   @hlist=[]
   @assign={}
   @his=[]
 end
end

$base = Env.new
$envs=["base"]
$base.reset
$current=$base
$currentname="base"
$hisfile="hensu-his.txt"

def showprompt
  print $currentname+$prompt
end

class Fv
 attr_accessor(:hlist,:assign,:name,:argv,:body)
end


def exist x,env
 env.hlist.member?(x)
end


def existusing x
 /(.*):(.*)/ =~ x
 return [false,nil,nil]if !$&
 $envs.each{|en|
   next if en!=$1
   env=eval("$"+en)
   return [true,env,$2] if exist($2,env)
   return [false,nil,nil]
 }
 [false,nil,nil]
end


def existf x,env
 /\(.*\)/ =~x
 return false if !$`
 name=$`
 env.hlist.each{|i|
  /\(.*\)/ =~i
  n=$`
 # p"exf",x,n,name,"$$"
  if $&
    if n==name
      return true
    end
  end
 }
 false
end

def getfunc x,env
 /\(([^\)]*)\)/ =~x
 vals=$1
 name=$`
 env.hlist.each{|i|
  /\(([^\)]*)\)/ =~i
  n=$`
  if $&
    if n==name
      arg =$1
      return [i,arg.split(','),vals.split(',')]
    end
  end
 }
 false
end

def set x,env
 n=0
 while 1
  (env.assign[x]=n ;env.mem[n]=""; break) if env.mem[n]==nil
  n+=1
 end
end

def argcalc arg,vals,a
  tmp=a.dup
  arg.length.times{|i|
    v=mainloop(vals[i])
    tmp.gsub!(arg[i],v)
  }
  mainloop(tmp)
end

# uhenchi
def calc d,env
 /^\"([^\"]*)\"/ =~d
 str=$&
 mae=$`
 usr=$'
 if str
   tmp =$1.gsub("\\n","\n")
   /\#\{([^\}]*)\}/ =~ tmp
   if $&
     return calc(mae+"\""+$`+calc($1,env)+$'+"\""+usr,env)
   end
   return mae+tmp+usr if !$&
 end
 /- *-[0-9]+/=~d
 d.gsub!(/- *-/,'+') if $&
 # func(..)
 /([a-zA-Z_][a-zA-Z_0-9]*\([^\)]+\))/ =~ d
 mae=$`
 usr=$'
 if $1
  if existf($1,env)
   f,arg,vals =getfunc($1,env)
   a = env.mem[env.assign[f]]
   a = argcalc(arg,vals,a)
   # p a,f,arg,vals,"$!$"
   return calc(mae+a.to_s+usr,env)
  else
   return calc(mae+usr,env)
  end
 end
 return calc($`+calc($1,env)+$',env) if $1
 # (...)
 /(.*)\(([^\)]+)\)(.*)/ =~ d
 return calc($1+calc($2,env)+$3,env) if $2
 # array
 /([a-zA-Z_0-9]+)\[([^\.])\.\.([^\.])\]/ =~d
 return calc($`+calc($1,env)[$2.to_i..$3.to_i]+$',env) if $&
 # ..*/..
 /([a-zA-Z_0-9\.\[\]]+ *[\*\/] *[a-zA-Z_0-9\.\[\]]+) *([+\/\*\-].+)/ =~ d
 return calc($`+calc($1,env)+$2,env) if $2
 # ..*/..
 /(.+[+\/\*\-]) *([a-zA-Z_0-9\.\[\]]+ *[\*\/] *[a-zA-Z_0-9\.\[\]]+)/ =~ d
 return calc($1+calc($2,env)+$',env) if $2
 # ..+-..
 /([a-zA-Z_0-9\.\[\]]+ *[+\-] *[a-zA-Z_0-9\.\[\]]+) *([+-].+)/ =~ d
 return calc($`+calc($1,env)+$2,env) if $2
 # p d
 /([a-zA-Z_0-9\.\[\]]+) *([+\*\-\/%]) *([a-zA-Z_0-9\.\[\]]+)/=~d
 a=$1
 si=$2
 c=$3
 if !a
  f,en,a = existusing(d)
  if f
   a =en.mem[en.assign[a]]
   return a.to_s
  elsif exist(d,env)
   a = env.mem[env.assign[d]]
   return a.to_s
  else 
   system(d[1..-1]) if d.class==String && d.length>0 && d[0,1]=="$"
   return d 
  end
 end
 if exist($1,env)
  a=env.mem[env.assign[$1]] 
 else
  a=$1
 end
 if exist($3,env)
  c=env.mem[env.assign[$3]] 
 else
  c=$3
 end
 /[^0-9e+\-\. ]/ =~ a.to_s
 f1=$&
 /[^0-9e+\-\. ]/ =~ c.to_s
 f2=$&
 return calc(a,env).to_s + calc(c,env).to_s if f2!=nil || f1!=nil
 return calc(eval(calc(a,env).to_s + si + calc(c,env).to_s ).to_s,env)
end

def getfname da
 / *(.+)/ =~ da
 file =$1
 if !$1
   file ="mylog.txt" 
 else
   /\./ =~file
   file =file+".ko" if !$&
 end
 file
end

def getstr da
 / *(.+)/ =~ da
 file =$1
 file ="" if !$1
 file
end

def memo env
 open($hisfile,'a'){|f|
  f.puts env.his
 }
end

def funccalc a,b,c
  fn=Fv.new
  fn.name=a
  fn.argv=b.split(',')
  fn.body=c
  fn
end

def setval a,b,env
  (env.hlist<<a) if !exist a,env
  set a,env if env.assign[a]==nil 
  envfrom=env
  f,en,v =existusing(b)
  (envfrom=en;b=v) if f
  env.mem[env.assign[a]] =calc(b,envfrom)
  return env.mem[env.assign[a]]
end

def geteditor env
  return "" if !env.hlist.member?("editor")
  env.mem[env.assign["editor"]]
end

def mainloop da,env=$base
 env.his<<da
 p "m:"+da if $debug
 # comment
 # p
 / *p  *(.*)/ =~ da
 if $&
   p mainloop($1,env)
   return $` 
 end
 # regexp
 /\/[^\/]+\/ *=~.*/ =~ da
 eval($&) if $&
# p $&,$1
 setval("$1",$1,env) if $1
 setval("$&",$&,env) if $1
 # function
 /([a-zA-Z_][a-zA-Z_0-9]*\((.*)\)) *=(.+)/ =~ da
 if $&
   a=funccalc $1,$2,$3
   # p a
   env.hlist<<a.name if !exist a.name,env
   set a.name,env if env.assign[a.name]==nil 
   env.mem[env.assign[a.name]]=$3 #calc($3,env)
   return a.name
 end
 # while
 /while  *([^><=]+)(!?[=><]+)(.+)  *\{([^\}]+)\}/ =~ da
 mae,usr,m1,m2,m3,body =$`,$',$1,$2,$3,$4
 if $1
  ans =calc($1,env)+$2+calc($3,env)
  if eval(ans)
    / *break */=~ mainloop(body,env)
    if $&
      return mainloop(mae+usr,env)
    end
    return mainloop(mae+"while "+m1+m2+m3+" {"+body+"}"+usr,env)
  else
    return mainloop(mae+usr,env)
  end
 end
 /while  *([^\{]+)  *\{([^\}]+)\}/ =~ da
 mae,usr,cond,body =$`,$',$1,$2
 if cond
  ans =mainloop(cond,env)
  if ans
    / *break */=~ mainloop(body,env)
    if $&
      return mainloop(mae+usr,env)
    end
    return mainloop(mae+"while "+cond+" {"+body+"}"+usr,env)
  else
    return mainloop(mae+usr,env)
  end
 end
 # num.times
 /([a-zA-Z_0-9]+)\.times *\{ *([^\}]+) *\}/ =~ da
 body=$2
 if $&
  return calc($1,env).to_i.times{ |it|
    a=body.gsub("it", it.to_s)
    print "(#{a})",$repprompt if $debug
    / *break */=~ mainloop(a,env)
    break if $&
  }
 end
 # gets
 /gets(\([^\)]*\))?/ =~ da
 if $&
   inp=$IOI+$&
   a=eval(inp)
   setval("$_",$_,env)
   return a if $`=="" && $'==""
   a="" if a==nil
   return mainloop($`+a+$',env)
 end
 # multi
 /([^;]*);(.*)/ =~ da
 m1=$1
 m2=$2
 if $1
   ans =mainloop $1,env
   / *break */ =~ ans
   return "break" if $&
   return mainloop(m2,env)
 end
 /if  *(.+)([!=]=)(.+)  *then *(.+)/ =~ da
 mae,usr,m1,m2,m3,mtrue =$`,$',$1,$2,$3,$4
 if $1
  p $& if $debug
  /else  *(.*)/ =~ mtrue
  mfalse =$1
  mtrue =$` if $&
  p $& if $debug
  if m2=="=="
   if calc(m1,env)==calc(m3,env)
    return mainloop(mae +mtrue +usr,env) 
   else
    if mfalse
      return mainloop(mae+mfalse+usr,env)
    else
      return mainloop(mae+usr,env)
    end
   end
  else
   if calc(m1,env)!=calc(m3,env)
    return mainloop(mae+mtrue+usr,env)
   else
    if mfalse
      return mainloop(mae+mfalse+usr,env)
    else
      return mainloop(mae+usr,env)
    end
   end
  end
 end
 /if  *(.+)<(.+)  *then (.+)  *else  *(.+)/ =~ da
 if $1
  if calc($1,env)<calc($2,env)
    return mainloop($`+$3+$',env)
  else
    return mainloop($`+$4+$',env)
  end
 end
 /if  *(.+)>(.+)  *then (.+)  *else  *(.+)/ =~ da
 if $1
  if calc($1,env)>calc($2,env)
    return mainloop($`+$3+$',env)
  else
    return mainloop($`+$4+$',env)
  end
 end
 # print
 /print  *((.|\n)+)/ =~ da
 strs=$1
 if strs
   /(".*"),(".*")/ =~ strs
   return (mainloop("print #{$1}");mainloop("print #{$2}")) if $&
 end
 ( a= calc(strs,env)
   print a
   return $`.to_s+a+$'.to_s ) if strs
 # puts
 /puts  *((.|\n)+)/ =~ da
 strs=$1
 if strs
   /(".*"),(".*")/ =~ strs
   return (mainloop("puts #{$1}");mainloop("puts #{$2}")) if $&
 end
 ( a= calc(strs,env)
   puts a
   return $`.to_s+a+$'.to_s ) if strs
 # browse
 /^http.*/ =~ da
 browse($&) if $&
 # browse
 /.*\.txt/ =~ da
 editor=""
 editor=geteditor(env) if exist("editor",env)
 edit($&,editor) if $&
 # simple equation
 /([a-zA-Z_][a-zA-Z_0-9]*(\[[0-9]+\])?) *= *(.+)/ =~ da
 a=$1
 b=$3
 if a
   return setval(a,b,env)
 else
   if da=="??"
     env.hlist.each{|i| 
       puts $prprompt+i+" = "+env.mem[env.assign[i]].to_s
     }
     return""
   elsif da=="?"
     puts env.hlist*","
     return ""
   elsif da=="???"
     p env.mem,env.hlist,env.assign
     return ""
   elsif da=="his"
     p env.his
     return ""
   elsif da=="hiss"
     return memo(env)
   elsif da=="hisl"
     return mainloop("!load #{$hisfile}",env)
   elsif exist(da,env) 
     a=env.mem[env.assign[da]]
     system(a[1..-1]) if a.class==String && a[0..0]=="$"
     return a
   elsif da=="????"
     print "hensuu:\t"
     p env.hlist
     print "assign:\t"
     p env.assign
     print "memory:\t"
     p env.mem
     print "env:\t"
     p $envs
     puts
     return ""
   elsif da=="?????"
     $envs.each{|e|
       puts "env::"+":"*30+"("+e+")"
       mainloop("?",eval("$"+e))
     }
     puts
     return ""
   elsif da=="??????"
     $envs.each{|e|
       puts "env:"+"."*30+" ("+e+")"
       mainloop("????",eval("$"+e))
     }
     return ""
   elsif da=='$'
     exit
   elsif da=='exit'
     memo env
     exit
   elsif da[0..9]=='@namespace'
     envname=getstr da[10..-1]
     (p $envs;return"") if envname==""
     if ! $envs.member?(envname)
       name="$#{envname}"
       eval(name+"=Env.new")
       $envs<<envname
       eval("$current="+name)
       $current.reset
     else
       eval("$current=$"+envname)
     end
     $currentname=envname
     mainloop("?",$current)
     return""
   elsif da=='help'
     help
     return ""
   elsif da=='show'
     $show=!$show
     return ""
   elsif da=='debug'
     $show=true
     $debug=true
     return ""
   elsif da=='undebug'
     $show=false
     $debug=false
     return ""
   elsif da=='reset'
     env.reset
     return ""
   elsif da[0,6]=='$eopen'
     file =getfname da[6..-1]
     edit(file,geteditor(env))
     return ""
   elsif da[0,1]=='$'
     puts da[1..-1]
     system(da[1..-1])
     return ""
   elsif da[0,5]=="!load"
     loadf da[5..-1]
     return ""
     # puts "loaded \'#{file}\'."
   elsif da[0,2]=="!l"
     loadf da[2..-1]
     return ""
   elsif da[0,5]=="!save"
     file =getfname da[5..-1]
     open(file,"a"){|f| 
       env.hlist.each{|i| 
         f.puts i.to_s+"="+env.mem[env.assign[i]].to_s
       }
     }
     return "saved as \'#{file}\'."
   else
     a=calc(da,env)
     return a
   end
 end
end

def help
 puts "example: 'x=1','y=text','?'(list),'z=x*2+(5-x)','!save [file]'(file save),'!load [file]', '???'(internal hensu dump),'$dir'(exec system.command) etc."
end

# check whether this block is a single line
def blockok d
  flag = false
  a=d.gsub(/[^\{\}]/,'')
  a=a.gsub(/\{\}/,'')
  while $& ;a=a.gsub(/\{\}/,'') end
  #p "a=",a
  return false if a!="" 
  /puts *"((.|\n)*)/ =~ d
  if $&
    #p "qst:"+$1+".m:"+$&
    /"/ =~$1
    if !$&
      return false
    end
  end
  /print *"[^"]*$/ =~ d
  return false if $&
  true
end

def commentoff da
  /[ \t]*#.*/ =~da
  flag =false
  a =$&
  b =$`
  if a
    flag =true
    /^\{[^\}]+\}/ =~a
    flag =false if $&
    /\"/ =~a
    flag =false if $&
  end
  return b if flag
  da
end


def main da, env=$current
  line=$stack.pop 
  data=commentoff(da.chomp)
  ($stack.push(""); return "") if data=="" && line==""
  if line!=""
    /[^\\]\"[^\"]*$/ =~ line 
    if $&
      line = line +"\n" + da.chomp
    else
      line = line+";"+ data
    end
  else
    line = data
  end
  p "l:"+line if $debug
  $stack.push(line) 
  if blockok(line)
    p"blk:"+line if $debug
    an=mainloop(line,env)
    puts an if $show
    mainloop("??",env) if $debug
    showprompt if $mode!="load" || $show
    $stack.pop
    line=""
    $stack.push(line)
  else
    print $repprompt if $mode!="load" || $show
  end
end


def loadf fname
 $mode="load"
 file =getfname fname
 open(file,"r"){|f|
   n=0
   $stack.push("")
   f.each{|dat|
     n+=1
     #p dat
     puts n.to_s+":"+dat+"("+fname +")" if $show
     main(dat)
   }
   $stack.pop
 }
 $mode=""
end


### start ###

if ARGV==[]
  # dialog mode
  showprompt
  while gets
    main $_, $current
  end
else
  # file load mode
  loadf ARGV[0]
end

# hello.ko
print "Hello, world!"
# echo.ko
while gets {puts $_}
# kaigyo.ko

puts "test1
test2
test3

test4 after blank line.
end.
"

puts "ok?"
# apri.ko

http://d.hatena.ne.jp/hatecha/

電卓、historyはここにしようか

| 電卓、historyはここにしようか - たばさの を含むブックマーク はてなブックマーク - 電卓、historyはここにしようか - たばさの

# koneko-his
script language? koneko 
history

2007/12/01  v.0.0
       whirl かなにかやってて、メモリシミュレーション用に始める。
       なので割り当ての部分で無駄な処理をしている
2007/12/11  v.0.4
2007/12/12 v.0.41
            array[1..3] 。>文字列の判定しないと。
            /asd(fg)/=~data => set $&,$1。
            testhen.txt(テスト用読み込みファイル)。
            
            [コマンドなど現状]
            だいたいrubyに準じて。節操なく。
            ?,??,???,???? => 状態表示。
            $ =>終了。
            exit => his保存、終了。
            debug => 行実行ごとに変数状態表示。
            undebug
            show => 行実行ごとに戻り値表示、on-off。
            reset => 全状態の初期化(変数消去)。
            $dir など => $を取り除いてシステムコマンドとして実行。
            !load [file] => ファイル読み込み実行。
            !save [file] => 変数状態をファイルに保存。
            文字列は""括りなしで(多分変える)。
            変数は宣言要らず。代入時になければ作られる。
             それ以外では現状は文字列として扱われる。
            
            @namespace name => 名前空間というのか、丸ごと入れ替え。
             まだ単独(継承なし)。
            name:hensu で名前空間名付きで変数呼び出し。 
            (行頭)http... =>ブラウザで開く
            (行頭)...txt  =>エディタで開く,
              editor=...で設定してあればそれで。editor=typeならtypeする。
            # のあとはコメント
            $eopen [file] =>エディタで開く、など。
            名前はnekoにしようか。koneko nuko?
            なんでもありの柔軟性というか雑食性。
            特殊命令は$,@で始めようかと思ったが入力面倒なので途中でやめた。
            
            break 導入
            
            
2007/12/15 v.0.4.5
            複数行読み込み、調整中。
            引数にファイル名で実行モード、なければ対話モード(今までのもの)。
            puts "..",".." (コンマ区切り。)
            全部evalで出来るような。でもそれだとおもしろくなかったり。
            
            n.timesループのなかでit,ti。(xtal参照)
            a=file(name) => a[0],a[1]...に、行ごとに読み込む。
            
2007/12/17 v.0.4.7
            ファイル操作。まずテキスト。配列<=>行
             file(name)=a => a[0],a[1]... をファイルに書き込む。
             a=file(name) => a[0],a[1]... にファイルから読み込む。
             file(name)<<a => a[0],a[1]... をファイルに追加モードで書き込む。
             a<<file(name) => a[max],a[max+1]... にファイルから読み込む(追加)。
             =はいいだろうか。>だと比較みたいだし。
            配列は現在はそれっぽい変数名にしてあるだけで型を作っているわけではない。
            正規表現、$9 までセット。
            
            puts a,b,c... => puts a;puts b;puts c...
            とやったら、puts "... , ..."がおかしくなった。なるほどー。
            
            a[9]<<file(name) => 読み込む配列の開始位置を指定できるように。
            a=reval(...) => ruby eval
            a=keval(...[,$env]) => koneko.env eval then reval
              i=4 を koneko script で定義してある場合
              reval("1+2") => 3
              reval("1+2+i") => error
              keval("1+2+i") => 7
              これである程度のことは無理やりできるようになっただろうか。
              あとエラーですぐ落ちるのをなんとかすれば。
              
            ネストの類は多分うまくいかない。
             「 , " ; ( ) 」 での分割処理が適当なため。
            file(..., rb) =>binary mode など。モード指定。
            
2007/12/19
            todo> label->jump (goto) 入れたい。なんとなく。<done
             program counter? 。ロードの仕方変えないとかな。
            todo> alias別名。多重代入。
            @ns => @namespace。
            ''囲いの文字列( '...' )を追加。
            正規表現の結果、$~ をとりあえず 内部変数 $match に入れてみる。
             a=reval("$match[11]") などとやって使える。( =>$~[11] )
             当面文字列しか変数に入れられないため、とりあえず。
             ファイルも同様、openじゃなくて文字列にすぐにいれた。どうなんでしょう。
              nuko,あるいはkoneko2では型も増えるでしょう。?
            puts ".. , ..." は、文字列を変数に入れればいいようだ、
            現状ほかで「,」をチェックしてないから。それもどうなんだか。
            正規表現とevalで結構出来るもんだなあと、しかしそのせいで
             クラスなどを作る気が起きない。
             
             
2007/12/20 v 0.4.83
            goto label  と
            label: 追加。
             ファイルロードの場合のみ行頭のみ単文で。
              (のみじゃなかった、同じの使ってた)
             ラベル名はアルファベットか数字の文字列。
             実装のためファイルを最初にすべて読み込むようにしたら速くなった。
             そうなんだ。知らなかった。
             テストしたら300行おきに軽く止まる、なぜだろう。
             読み込んだからやろうと思えば自己書換えもできるかな。
            if .. goto .. 追加。現状ではラベルは空白以外。
            
            a=reval("$last") => 直前の代入の値を参照。$lastは内部変数。
              ちょっと変わったことをやってみたかった。使い道は特に思いつかないけど。
              

2007/12/21 v 0.4.93
            case .. { 
             .. : .. ;;
             .. : .. ;;
              .... 
             }
             => bash 風の case。
            case .. {
             /regex/: .. ;;
             /regex/: .. ;;
              .... 
             }
             => おなじく、正規表現も使える。
             改行処理は不完全。
            loop{...} ループ。
            _1_ => 1行目をコピー、マクロ。
            alias .. ....... => 読み込み時に置換。
            a,b,c=1,2,3 => a=1;b=2;c=3;  単純な多重代入。
            __END__ => 以降はコメント扱い。
            keval(a==y) => y=>aのときtrueを返すようにした。
              aが変数で定義されていなくても文字列として。
            browse http://... , http://.. , http://...
            browse { .. [ 改行 .. 改行 .. ] } 
            koneko -e '...' => '...' をtmp.koに保存して実行。
            $l => 実行中のスクリプトファイル名。
            exit => 終了。
            $ => メモして終了。 (逆にした)
            
            現在一部(kevalなど)の置き換えは単語チェックなどしてないので
              i=9 のあと keval( ...times )  => ...t9mes  などとなってしまう。

2007/12/23 0.4.93.1+
            if文書き換えで行き詰まり。判定を一ヶ所にまとめようとして。
            rb 3.times{|i|
               p i
               }
            rb
               => rubyコード。行頭にrbで挟む。
               
            forget a => 変数 a を未定義にする。


*1:当然すべての言語のトップレベルのマスターが必要。

トラックバック - http://rubyist.g.hatena.ne.jp/hatecha/20071215

12/13(木) 2007

電卓 続き , 正規表現

| 電卓 続き , 正規表現 - たばさの を含むブックマーク はてなブックマーク - 電卓 続き , 正規表現 - たばさの

判定の順番入れ替えたり。入れ替えるだけでうまくいくのかも良く分かっていない。

基本は、一行読み込んで、優先順の高いものからチマチマと変換して前後と繋いでまたメインループに投げる、の繰り返しでやっています。該当するものが一個ずつ減っていくので最後には「x=...」など単純な形になるはず。再帰関数も無限ループにならなければいつかは終わる。前のほうに書いたものから変換するかは良く分からない部分も。ひょっとしてやり方変えないと駄目なとこもあるかも。短いものならいまのところ不都合は見当たらないと思う。

ちょっと言語っぽくなったかなあとおもい、golfをやってみる。Hello, world!はまあOK。echoで早くもつまずく。Ctrl+Zの扱い変えてどうにかOK。gets("7")などもrubyに丸投げしてみるもいまいちうまくいかず。while gets("7"){..}でループ抜けられない。保留。


入れたもの

array[1..3],

/asd(fg)/=~data => set $&,$1。でも変数判定変えてないのでまだ利用できない、意味なし。

{ と } の数が合わない場合次の行を読む、複数行処理。

testhen.txt 作成



# hensu.rb

prompt=">"
$lprompt=">>"
$prprompt=":"
$repprompt="|>"

$mem=[]
$hlist=[]
$assign={}
$his=[]

$hisfile="hensu-his.txt"

class Fv
 attr_accessor(:hlist,:assign,:name,:argv,:body)
end

def exist x
 $hlist.each{|i|
  return true if i==x
 }
 false
end

def existf x
 /\(.*\)/ =~x
 return false if !$`
 name=$`
 $hlist.each{|i|
  /\(.*\)/ =~i
  n=$`
 # p"exf",x,n,name,"$$"
  if $&
    if n==name
      return true
    end
  end
 }
 false
end

def getfunc x
 /\(([^\)]*)\)/ =~x
 vals=$1
 name=$`
 $hlist.each{|i|
  /\(([^\)]*)\)/ =~i
  n=$`
  if $&
    if n==name
      arg =$1
      return [i,arg.split(','),vals.split(',')]
    end
  end
 }
 false
end

def set x
 n=0
 while 1
  ($assign[x]=n ;$mem[n]=""; break) if $mem[n]==nil
  n+=1
 end
end

def argcalc arg,vals,a
  tmp=a.dup
  arg.length.times{|i|
    v=mainloop(vals[i])
    tmp.gsub!(arg[i],v)
  }
  mainloop(tmp)
end

# uhenchi
def calc d
 # p d
 /- *-[0-9]+/=~d
 d.gsub!(/- *-/,'+') if $&
 # func(..)
 /([a-zA-Z_][a-zA-Z_0-9]*\([^\)]+\))/ =~ d
 mae=$`
 usr=$'
 if $1
  if existf($1)
   f,arg,vals =getfunc($1)
   a = $mem[$assign[f]]
   a = argcalc(arg,vals,a)
   # p a,f,arg,vals,"$!$"
   return calc(mae+a.to_s+usr)
  else
   return calc(mae+usr)
  end
 end
 return calc($`+calc($1)+$') if $1
 # (...)
 /(.*)\(([^\)]+)\)(.*)/ =~ d
 return calc($1+calc($2)+$3) if $2
 # array
 /([a-zA-Z_0-9]+)\[([^\.])\.\.([^\.])\]/ =~d
 return calc($`+calc($1)[$2.to_i..$3.to_i]+$') if $&
 # ..*/..
 /([a-zA-Z_0-9\.\[\]]+ *[\*\/] *[a-zA-Z_0-9\.\[\]]+) *([+\/\*\-].+)/ =~ d
 return calc($`+calc($1)+$2) if $2
 # ..*/..
 /(.+[+\/\*\-]) *([a-zA-Z_0-9\.\[\]]+ *[\*\/] *[a-zA-Z_0-9\.\[\]]+)/ =~ d
 return calc($1+calc($2)+$') if $2
 # ..+-..
 /([a-zA-Z_0-9\.\[\]]+ *[+\-] *[a-zA-Z_0-9\.\[\]]+) *([+-].+)/ =~ d
 return calc($`+calc($1)+$2) if $2
 # p d
 /([a-zA-Z_0-9\.\[\]]+) *([+\*\-\/%]) *([a-zA-Z_0-9\.\[\]]+)/=~d
 a=$1
 si=$2
 c=$3
 if !a
  if exist(d)
   a = $mem[$assign[d]]
   return a.to_s
  else 
   system(d[1..-1]) if d.class==String && d.length>0 && d[0,1]=="$"
   return d 
  end
 end
 if exist($1)
  a=$mem[$assign[$1]] 
 else
  a=$1
 end
 if exist($3)
  c=$mem[$assign[$3]] 
 else
  c=$3
 end
 /[^0-9e+\-\. ]/ =~ a.to_s
 f1=$&
 /[^0-9e+\-\. ]/ =~ c.to_s
 f2=$&
 return calc(a).to_s + calc(c).to_s if f2!=nil || f1!=nil
 return calc(eval(calc(a).to_s + si + calc(c).to_s ).to_s)
end

def getfname da
 / *(.+)/ =~ da
 file =$1
 file ="mylog.txt" if !$1
 file
end

def memo
 open($hisfile,'a'){|f|
  f.puts $his
 }
end

def funccalc a,b,c
  fn=Fv.new
  fn.name=a
  fn.argv=b.split(',')
  fn.body=c
  fn
end

def setval a,b
  ($hlist<<a) if !exist a
   set a if $assign[a]==nil 
   $mem[$assign[a]]=calc(b)
   return $mem[$assign[a]]
end


def mainloop da
 $his<<da
 # regexp
 /\/[^\/]+\/ *=~.*/ =~ da
 eval($&) if $&
# p $&,$1
 setval("$1",$1) if $1
 setval("$&",$&) if $1
 # function
 /([a-zA-Z_][a-zA-Z_0-9]*\((.*)\)) *=(.+)/ =~ da
 if $&
   a=funccalc $1,$2,$3
   # p a
   $hlist<<a.name if !exist a.name
   set a.name if $assign[a.name]==nil 
   $mem[$assign[a.name]]=$3
   return a.name
 end
 # while
 /while  *([^><=]+)([=><]+)(.+)  *\{([^\}]+)\}/ =~ da
 body=$4
 if $1
  an =calc($1)+$2+calc($3)
  if eval(an)
    mainloop(body)
    return mainloop($`+"while "+$1+$2+$3+" {"+body+"}"+$')
  else
    return mainloop($`+$')
  end
 end
 /while  *([^\{]+)  *\{([^\}]+)\}/ =~ da
 body=$2
 if $1
  an =mainloop($1)
  if an
    mainloop(body)
    return mainloop($`+"while "+$1+" {"+body+"}"+$')
  else
    return mainloop($`+$')
  end
 end
 # num.times
 /([a-zA-Z_0-9]+)\.times *\{ *([^\}]+) *\}/ =~ da
 body=$2
 if $&
  return calc($1).to_i.times{ |it|
    a=body.gsub("it", it.to_s)
    # print "(#{a})",$repprompt;
    mainloop a
  }
 end
 # gets
 /gets(\([^\)]*\))?/ =~ da
 if $&
   a=eval($&)
   setval("$_",$_)
   return a if $`=="" && $'==""
   a="" if a==nil
   return mainloop($`+a+$')
 end
 # multi
 /([^;]*);(.*)/ =~ da
 if $1
   mainloop $1
   return mainloop($2)
 end
 /if  *(.+)==(.+)  *then (.+)  *else  *(.+)/ =~ da
 mae=$`
 usr=$'
 if $1
  if calc($1)==calc($2)
    return mainloop(mae+$3+usr)
  else
    return mainloop(mae+$4+usr)
  end
 end
 /if  *(.+)<(.+)  *then (.+)  *else  *(.+)/ =~ da
 if $1
  if calc($1)<calc($2)
    return mainloop($`+$3+$')
  else
    return mainloop($`+$4+$')
  end
 end
 /if  *(.+)>(.+)  *then (.+)  *else  *(.+)/ =~ da
 if $1
  if calc($1)>calc($2)
    return mainloop($`+$3+$')
  else
    return mainloop($`+$4+$')
  end
 end
 # print
 /print  *(.+)/ =~ da
 ( a= calc($1)
   print a
   return $`+a+$' ) if $1
 # puts
 /puts  *(.+)/ =~ da
 ( a= calc($1)
   puts a
   return $`+a+$' ) if $1
 # simple equation
 /([a-zA-Z_][a-zA-Z_0-9]*(\[[0-9]+\])?) *= *(.+)/ =~ da
 a=$1
 b=$3
 if a
   return setval(a,b)
 else
   if da=="??"
     $hlist.each{|i| 
       puts $prprompt+i+" = "+$mem[$assign[i]].to_s
     }
     return""
   elsif da=="?"
     puts $hlist*","
     return ""
   elsif da=="???"
     p $mem,$hlist,$assign
     return ""
   elsif da=="his"
     p $his
     return ""
   elsif da=="hiss"
     return memo
   elsif da=="hisl"
     return mainloop("!load #{$hisfile}")
   elsif exist(da) 
     a=$mem[$assign[da]]
     system(a[1..-1]) if a.class==String && a[0..0]=="$"
     return a
   elsif da=="????"
     p "hensuu:",$hlist,"wariate:",$assign,"memory:",$mem
     return ""
   elsif da=='exit'
     memo
     exit
   elsif da=='help'
     help
     return ""
   elsif da[0,1]=='$'
     puts da[1..-1]
     system(da[1..-1])
     return ""
   elsif da[0,5]=="!load"
     file =getfname da[5..-1]
     open(file,"r"){|f|
       n=0
       f.each{|data|
         n+=1
         puts ':'+$lprompt+data
         puts mainloop(data.chomp)
       }
     }
     return ""
     # puts "loaded \'#{file}\'."
   elsif da[0,5]=="!save"
     file =getfname da[5..-1]
     open(file,"a"){|f| 
       $hlist.each{|i| 
         f.puts i.to_s+"="+$mem[$assign[i]].to_s
       }
     }
     return "saved as \'#{file}\'."
   else
     a=calc(da)
     return a
   end
 end
end

def help
 puts "example: 'x=1','y=text','?'(list),'z=x*2+(5-x)','!save [file]'(file save),'!load [file]', '???'(internal hensu dump),'$dir'(exec system.command) etc."
end

help
print prompt

# check whether this block is a single line
def blockok d
  a=d.gsub(/[^\{\}]/,'').gsub(/\{\}/,'')
  while $& ;a=a.gsub(/\{\}/,'') end
  return true if a==""
  false
end

a=""
while gets
  if a!=""
    a = a+";"+$_.chomp 
  else
    a = $_.chomp 
  end
  if blockok(a)
    mainloop(a)
    # puts a
    print prompt
    a=""
  else
    print $repprompt
  end
end


testhen.txt , test


$type testhen.txt
$dir his*
$dir *his*
x=12.6
x=x*x
x=x*x
x=x*x
x=x*10.1
x=x*10.1
x=x*10.1
x=x*10.1
x=x*10.1
x=123456
x=x*x
x=x*x
x=x*x
x=x*x
x=x*x
x=x*x
x=5
y=3
zz=6
f(x,y)=12*x+y+23+zz
?
??
z=f(4,5)
??
s=qwertyuiop
z=s[1..4]+s[3..5]
fact(x)=if x==0 then 1 else x*fact(x-1)

fct=fact(100)
if fct==93326215443944152681699238856266700490715968264381621468592963895217599993229915608941463976156518286253697920827223758251185210916864000000000000000000000000 then puts ok else puts bad!
if z==wertrty then puts ok else puts bad!

テスト結果の一部

>!load testhen.txt
...(略)

:28>>s=qwertyuiop
qwertyuiop
:29>>z=s[1..4]+s[3..5]
wertrty
:30>>fact(x)=if x==0 then 1 else x*fact(x-1)
fact(x)
:31>>

:32>>fct=fact(100)
93326215443944152681699238856266700490715968264381621468592963895217599993229915
608941463976156518286253697920827223758251185210916864000000000000000000000000
:33>>if fct==9332621544394415268169923885626670049071596826438162146859296389521
75999932299156089414639761565182862536979208272237582511852109168640000000000000
00000000000 then puts ok else puts bad!
ok
ok
:34>>if z==wertrty then puts ok else puts bad!
ok
ok
>

今日のgolfusr-language pop

| 今日のgolfusr-language pop  - たばさの を含むブックマーク はてなブックマーク - 今日のgolfusr-language pop  - たばさの

z80が。


lang (entry,persons): id,,,
-------------------------
Ruby           (1174,283): ,	flagitious(oops other solution is embed, but this one uses mathn :),666,AtoMa,Brian Adkins,Brian with Ben,Charles,Chuck Vose,Ciaran,Daniel Butler,DarkDust,Duane Bailey,Florian,GOROman,George Bush,GooGoo+.,Grant Hutchins,Habitue,Hector Vergara,Hexa,Hyperair,JaeSharp,JohnDough,KEN3,Kihara,Mark Byers,Mark Byers (symbol),Mark Byers 2 (symbol),Matthew,Milly,Myrd,Phill Kenoyer,RiSK,Robert,Rozza,Scott,Servo,Slartibartfast,Sohum,Spug,SuperFrankie,Takagi,Tay,Tomy,YAA,Zauberer,_,_N,_N(rand),___,a,ab,ageldama,akausagi,altair,ammmm,apeiros,ar,arikui,as,atheye,b2ox,bascule,bert,brad,brik,chucker,comp.lang.ruby,crazyjimbo,dai,dan,dan5,diddle,drunk guy from ohio,dux,dw,eban,eban(cheat),eban(noexec),eban(regexp),eban(require),eban(sym),eil,elb,ema,fkm,flagitious,flagitious(0sym),flagitious(alnum),flagitious(alt),flagitious(embed),flagitious(mathn),flagitious(oops alnum),flagitious(oops other solution is embed, but this one uses mathn :),flagitious(req),flagitious(semi embed),flagitious(sym 4),flagitious(sym),flagitious(unembeded),flagitious(zlib),fmonkey,foo,fsystem,fuji,fuu,g5n,geir,geir_again,german,gomis,greenpenguin,gtheoret,ha-tan,hermi,hi,hirose,hirose(sym),hrkw,irori,irori(alt),irori(mathn),isrc,iwadon,j,jacknero,javara,jj,jj-jrun,jrun,jrun1,junathecca,juno,kaki,kanagawa,kep,kermi,kik,killy971,kinaba,knu,kodera,konn,konn (embed &amp; not algorithmic),krokofant,ksk,ksk (mathn),ksk (sym),ksk(cheat),ksk(sym),ksk(sym+3B),kstn,kt3k,kt3k(sym),kt3k(sym_),kurimura,ky,lazymage,leonid,leonid (alnum),leonid (no brain &amp; alnum),leonid (pack),leonid (sym),leonid (sym) 2,leonid (symbol),leonid(sym),leonid(sym)2,letter,lifthrasiir,lokiju,m.ukai,ma,maki,mamamoto,masadoi,mather,megun,mgoss,minke,moriB,mskzzz,mskzzzz,murky-satyr,nakahira,naruse,nattow,nawa,nazo,neko,niha,niha(majime),niha(mathn),niha(zurui!),niwa-tori,nmk,notmatt,nozuru,nullpo,octech,ombra,oto-oto-oto,oto-oto-oto(),oza,ozy4dm,ozy4dm(inchiki),pnomolos,pooq,poqute,primo,probablycorey,puzzles,qwejkl,r,raspberry lemon,rawwell,rickrickrick,roflcopter,s,satoru,shinak,shinh,shinh (C C++ Ruby Python PHP Perl),shinh (C C++ Ruby Python PHP),shinh (mathn),shinh(alpha),shinh(cheatless),shinh(embed),shinh(other),shinh(sym),shinh(symbol),shrapnel,shuyo,siru,sourcek,spelunker,sshi,suko,sumim,t_issie,tabasa,tad,takaaki,takase,takatoh,tamubun,tapasa,tar0_t,te,tell,test,th,tocken,tokiwa,tpope,tsukkee,ttsy,tututu,tyos,umasika,unno,usa,usa(alnum),usa(cheat),usa(embed),usa(mathn),usa(rehabilitation),usa(symbol),usa(t0),wara,wedge,wookay,wow,xfy,ySas,yasuhito,yhara,youchan,yowa,yowa(e),yowa(no pack),yunyun,yvl,znz,zraii
C              (818,275): ,18kb,51b,51b ,51b(calc),51b(cheat),51b(embed),51b(no exec),51b(not bin),51b(not embed),51b(竊粗mbed),666,7gyou,7gyou(after),7gyou(cheat),AKrotkov,Adam,Al Dimond,Amnesiasoft,Ancient123,Andrei,Anon,Arturion,BAR,Blayne,Bongo Bill,Brute Force Man,CD,CScppig1995,DS,Dan,Dashiva,DiDi,Doster,DrFlibble,EarOwl,Faust,Frane,Free Bird,GauHelldragon,Gizzle,Gus,Harkonnen,Inky,Inside,Itamotsu,Kee,Kei,Ki,Kibi,MagicBobert,Magnus Jonsson,Mark Byers,Myrd,Natu,Negitoro,Okiesmokie,Patrick,Reed1,Reed2,Reed3,RiSK,Robert,Sarav,Sasha Slutsker,Skrud,SocialSecurity,Spliznork,TENDON,TenBin,TestingSomething,TheEconomist,TimO,Yuuki--;,Zauberer,_,a,abobo,adonai,afarmer,ahoudori,akihiro,albert,alex,alex2,alexmdac,alofalt,ancient123,angpoo,aoi,ark,bascule,blueblimp,boo,breadbox,dai,daira,dm,doubleukay,dud,eban,educa,egashira,emaland,endu,entragian,examiner,fkino,flagitious,foo,gaus,ggg,goh,green,h013,h0shu,havehave,hilite250,hina,hinoe,hinoe(another),hinoe(hidoi),hinoe(sorry),hiraku,hirose,how,hyoroku,i708,irori,ishiguro,jackpalance,joe,jojo,kamekozo321,katsu,kazuki,kcha,keigo,kenz,kikou,kinaba,kios,koedo,koge,kohei,kohei2,kohy,kotetu,kozima,krait,kt3k,kurimura,kyasu,lame attempt,letter,lifthrasiir,m.ukai,ma,maa,main(){system(&quot;cat&quot;);},main(){system(&quot;dd&quot;);},mamedaifuku,masashi,mayarero,melonhead,mendo1099,mezashi,mi,moge,mori,moriA,mskzzz,mskzzzz,murky-satyr,mushi,naka,naoya,nazo,negi,neocat,neologic,niha,nobody,not embed. leftmost? see http://shinh.skr.jp/m/?date=20070213#c12,notogawa,notogawa(cheat),ntabe,nullpo,obvious troll,oichang,ombra,oto-oto-oto,ozy4dm,ozy4dm(inchiki),paleman,papicon,pascal,peterx,pf,phoenix,pi8027,pneuma,ps,qebab,restday2,rgb_yoshijima,rickrickrick,ryoakg,s,s0upa,s_fox,sa,sabupot,sadakiyo,sargon,scottg,sentium,sgr,sh0u,sheerbird,shiena,shinh,shinh (C C++ Ruby Python PHP Perl),shinh (C C++ Ruby Python PHP),shinh(cheat),somebear,sourcek,sugarfree,sunsuron,suzume,t_issie,tabasa,takashi4233,tako,tanzaku,tapooh,ten,tensaix2j,test,tlwlvmtm,tmf,tokiwa,ttsy,tututu,tyoro,tyos,unco,unnonouno,usa,viznut,wiseler,wow,x0d,xenocide,yamada,yatchan,yhara,yoshijima,yowa,yshl,yshl(C, PostScript(bin)),yshl(C, PostScript),yshl(polyglot C and PostScript(bin)),yshl(polyglot C and PostScript),ysn,yt123,yu,yuizumi,yuta,yzx,zaki,znz,zybler,zyblerair,↑hinoeさんのコードを弄ってみた(by Ozy)
Python         (772,163): ,Adam Blinkinsop,AdamG,Aglet,Alexs,Amadeo Bellotti,Arafangion,Berengal,BioGeek,Dashiva,Defenestrator,Defenestrator (cheat),Ephphatha,Frane,HzFalcon,Jacob Rus,Jay,Jean-Louis,JohnStalcup,JonAllie,KUN,Ksero and #python,Lanzaa.,Mark Byers,Mark Byers (no binary),Michael,Milly,Patrick,RiSK,Richard Loveland,Robert,Ropo,Sasa,Sasa Petrovic,Sasa Petrovic2,Sasa Petrovic3,Sean,SeeNoEvil,SeeNoEvil (haha),SeeNoEvil(embed),Simple Solution,Stupid1,Thomas Geeee Willis,TsXc,U1A,__nb__,ac,accurrent,adbachman_01,adbachman_02,adbachman_03,ap,blueblimp,boo,chobo,darked,dinomite,doo,dplusplus,drigz,eban,ek,elb,elb(no compression),emaland,flagitious,flagitious and Mark Byers,flatline,fredrik,fuji,gee,go,hiro.suzuki,hiro.suzuki (zip),hiro.suzuki縲€,hiro.suzuki縲€(no load file),hirose,hirose(sym),houeland,itsme,jijixi,jj,jk,junya,kamezou,kashifkhan,ksk,kt3k,kt3k(...,kt3k(another,kt3k(no bin),kt3k(sym),letter,lifthrasiir,lifthrasiir (no cheat),lyx,mft,mho,mkszzz,morchin,moriA,mozi codo,mskzzz,mskzzzz,musicinmybrain,nack,nazo,neger,neger2,neger3,neger5,neger6,neger7,neger8,nob,nobody,notme,notogawa,octech,oqre,ozy4dm,pachiki,pbx,pp,primo,py2,qebab,qebaba,quietgolfer,rawwell,ryo,sakaki,sdfsd,sdkay,shaurz,shbird,sheerbird,shimizu,shinh,shinh (C C++ Ruby Python PHP Perl),shinh (C C++ Ruby Python PHP),siru,skrzynka,stesch,strank,superneger1,superneger7,superneger8,tabasa,tahai,tenkoma,test,thor,tokiwa,tyr,usa,wer,wow,zak,zakj,zeek,zetamatta,znz
Perl           (584,165): ,324324,Aglet,Bhaskar,CD,Ciaran,Eric Elinow,Eric Elinow2,Fotios,Hテ・kan,Io_fan,Leonardo Herrera,Mark Byers,Milly,Mithran,RayQ,RiSK,Robert,Sarav,Sarav(not my code),Skrud,SocialSecurity,Spencer Schumann,TAKESAKO,Tadman,TakashiYamaoka,Terje K,YAA,Yagi,ace,alp,another,ar,blazar,brad,bran,breadbox,dacci,dankogai,dankogai (cheat?),davidad,deq,dinomite,drmz,eban,eban(cheat),emaland,entragian,erics84,fkm,flagitious,foo,fotios,fujiwara,gamehaus,gomis,haru,hassy,hassylin,havana,hiroaki,hirose,hotaru,hs,initself,intangible1,intangible2,intangible_not_cheat,jg,jimr,jls,junathecca,k12u,kf,kinaba,kohei,komondorok,konbu,kounoike,kozima,ksk,kt3k,letter,m.ukai,maa,mauke,melonhead,mho,momo,moriA,morimasa,morita,moritan,mskzzz,mskzzzz,mwb,nazo,negi,neocat,nh33,niha,nnn,nohat,noname,nonstrict,nuko,nullpo,odz,op,osa,ott,ott(cheat),ott(embed),ott(nocheat),ott(noembed),ozy4dm,paperhat,pascal,ph,ph2,pp,prakash,sa,sabupot,safii,saitoma,scottg,shinh,shinh (C C++ Ruby Python PHP Perl),shinh (sym),shinh(symbol),shmem,sma,sma1,sugarfree,sunsuron,t4652f85e,t_issie,tabasa,tacky,teengenerate,tete,theducks,ti,tripa,ttt,tybalt89,umasika,unau,usa,uu,whitebell,wow,xhl,ySas,ySas (cheat),ySas(embed),ySas(inspired by kinaba),yoortje,yuki,yuki_neko_nyan,yzx,zetamatta,znz,・儡as
Haskell        (510,78): ,.[1..100]&gt;&gt;=pen,2nd sample output is wrong!,7gyou,80,Ben,Defenestrator,Gus,Kee,Magnus,Magnus Jonsson,NMSpaz,This is test code.,[1..100]&gt;&gt;=pen,[1..100]&gt;&gt;=pen (not golf),[1..100]&gt;&gt;=pen(MushaKushaShiteYatta),[1..100]&gt;&gt;=pen. leftmost? see http://shinh.skr.jp/m/?date=20070213#c12,_,_(embed),a,aljee,b2ox,b2ox(embed),b2ox(invalid),b2ox; un=b2ox,blue,blueblimp,breadbox,davidad,emoken,flagitious,glguy,halt,irori,katsu,kinaba,konn,konn(ERAT),konn(FER),konn(MR),kt3k,kurimura,kuwashima,lazard,m,mgsloan,moriA,moriA(exec),moriB,mskzzzz,nazo,notogawa,notogawa(cheat),notogawa(embed),notogawa(exec),notsmack,oxy,ozy4dm,pbx,r-west,rulerofutumno,sakai,scottg,seasons,shaurz,shinh,smly,sshi,sss,tabasa,takatoh,tanakh,tanakh; un=tanakh,tanzaku,test,testprogram,tex,ttsy
PHP            (491,207): ,#suidroot,(given integer &lt; 111) [1..100]&gt;&gt;=pen,.[1..100]&gt;&gt;=pen,18kb,Andrew,Eddie,Eduardo,Emanuel,EmoJimbo,EricSmith,FalconNL,FlatLine,GotMex?,HotRod,HzFalcon,HzFalcon(symbol),Inoue,JohnStalcup,Jose,Justin,K_TAKAGI,Kevin Francis,Kevin G Francis,Kim...,LatinoHeat,LatinoThunder,Loadx,Mark Byers,Marz,Mearn,Mighty,Mike Alexander,Mike Alexander2,Milly,Newave Designs,Paul,Paul Wilkins,PeePeeFace,RiSK,RichieC,Robert,Sasha Slutsker,Sean,SeeN,Simon Lim,SirFartsAlot,Slick,Stupid1,T,T-bag,TENDON,TrueJournals,VatoLoco,Vraylle,WillieGollino,YungSang,ZARU,Zach,Zack,[1..100]&gt;&gt;=pen,a,abobo,acp,adachi,afarmer,ajkirwin,akkun_choi,alex,altair,anonymous,apalan,apo,ar,ar(cheat),ast,beton,blaat,blaat2,blaat3,bluejean,bluejean(symbol),bluejean(symbol_),bumbumface,charly,chatii,chucker,codetester,con,daira,daze,deanWombourne,decama,demonicus,devidos,doraenator,eban,eil,elb,emaland,enSige,ensige,entragian,eviljim,fal,flagitious,forte,ha1t,hamori,hamori縲€,hh,hi-poko,hilde,hisapoko,hogera,hohe(given integer &lt; 111) [1..100]&gt;&gt;=pen,honestnaoko,hs,iatz,ideo,igooo,imoto,intangible,iphoting,itochin,j4,jazzanova,jln,juno,kaska,kiba@kei-3,kinaba,konbu,koyuki,ksk,kt3k,l-tama,letter,mastercheap,mechaong,megun,mikechml,mitsu-,mogesura,momo,msk,mskzzz,mskzzzz,nazo,neko,nic,noah,nob,nuko,nullpo,ozy4dm,patches,persilian,php is for fools,pistoriusp,poopdawg,pop,pw,r28,rawwell,razor.crusade,rgb_yoshijima,rpatel10,shadow,shimooka,shinh,shinh (C C++ Ruby Python PHP Perl),shinh (C C++ Ruby Python PHP),siru,skyrc,smeghead,soushi,submatt,sunsuron,t_issie,tabasa,tanakh,tazyamah,te,test 1,testmn,thefizzbuzzthug,thetrve,tyoro,umasika,unau,usa,w,webvictim,wow,xebu,xroric,yae,yoshijima,yowa,yuki,yzx,yzx(cheat),yzx(exec),znz,zybler,竊薙≠縺サ縺・
JavaScript     (326,50): ,51b,7gyou,AtoMa,Dashiva,FalconNL,JohnStalcup,Mark Byers,Milly,Patrick,RiSK,YAA,YungSang,boring,dsl,eban,eil,emaland,hirose,hogehoge,junathecca,kaki,kemco,kinaba,kt3k,kweg,letter,mi,motemen,mskzzzz,murky-satyr,murky-satyr (cheese),murky-satyr (emb),nanto_vi,nanto_vi (cheat),nanto_vi(cheat),nattow,nawa,nazo,nuko,ofk,ozy4dm,pooq,shinh,t4652f85e,tabasa,wow,xyzzy,yowa,znz
Postscript     (323,40): &lt;&lt;/The{}/answer 42/anser 42/to{}/life?{=}/universe?{=}/everything?{=}&gt;&gt;begin{(%stdin)(r)file token not{exit}if exec}loop,Mark Byers,Mark Byers (no binary),Troy Howard,konbu,kt3k,makoto-k,makoto-k(symbol),moriA,mskzzzz,shinh,tabasa,ySas,ySas (embed),ySas (not bin),ySas(bin),ySas(embed),ySas(not bin),ySas;,ySa・・yshl,yshl (alnum),yshl((%stdin) (r) file read {2 idiv =} if quit),yshl(C, PostScript(bin)),yshl(C, PostScript),yshl(a few bin),yshl(alnum),yshl(bin),yshl(bin)(cheat),yshl(bin)(embed),yshl(bin)(perl shinh 1174511406),yshl(cheat),yshl(compress),yshl(embed),yshl(embed)(bin),yshl(no bin),yshl(not bin),yshl(perl shinh 1174511406),yshl(polyglot C and PostScript(bin)),yshl(polyglot C and PostScript)
OCaml          (299,53): ,Adam Blinkinsop,Robert,SugarSun,airobo,airobo(noexec),blueblimp,bungee,elb,flagitious,hat,hrkw,jijixi,jijixi(noexec),kinaba,kizz,kozima,ksk,ksk (MD),ksk(Num),ksk(bin),ksk(cheat),ksk(embed),ksk(noexec),kt3k,kuwashima,letter,m.ukai,m.ukai(Num),m.ukai(embed),m.ukai(exec),m.ukai(noexec),moriA,mskzzzz,nazo,phoenix,pooq,s,samvid,shinh,smly,soutaro,sshi,suiginto,suiginto(bin),suiginto(embed),suiginto(embed)	,tabasa,tapooh,unnonouno,xhl,ysn,ysn(noexec)
Java           (284,144): ,7gyou,ACCELE,AfzalB,AfzalB Recursive,Ankur,Anonymous does not forgive,Arjun Comar,Bobo,Brian S,Brian Yi,Chris Drost,Dab,Dashiva,David Chan,Glimt,Gu,Gus,Imran,Ineffable3000,Isaac @ Programming,Joe,Joe(symbol),JohnStalcup,Jose,Kee,Keih,Mark Byers,Matt,Notch,PrestonP,RyanL,SIS,Sam,Sasha Slutsker,Spug,Stu Coates,TENDON,Tom,Undermined,Yoshiori,aaaaa,abatkin,abc,baxter,bchic869,bleis,breadbox,breadbox is a gay faggot,btcqg,bungee,cep,champkind,coke,craigus,csjunker,dEp,daira,degei,ds,eeb,elb,elb_cheat,enk,fs,fuddy,fune,georgia,geronimo,hoge,javara,jj,joe,joeBob,kemco,kenz,kibi,kik,kinaba,kra,krokofant,kt3k,kurimura,kweg,leatherboundbooks,letter,letter(embed),mark,masa,megun,mn,moe,moe2,mskzzz,mskzzzz,murky-satyr,n8theGr8,nack,namamekashi-banchou,nattow,nayamashi-banchou,nazo,nielsc,niwa-tori,notogawa,notogawa(cheat),okamotok,orrc,ozy4dm,perisy,phoenix,planete2303,pw,rawwell,richmahogany,roki,s0upa,sasaking,scottg,shiena,shinh,shr3kst3r,siokoshou,ste_mcleod,sug,swac,t_issie,tabasa,takashima,test,tnk,toshi,tyrn,usa,usaoya,warriorness,wow,yhara,yooskeh,you said you wouldn't kiss&amp;tell!,yuhei,zcrar70,zen,znz
AWK            (248,46): ,Mark Byers,Regiomontanus,_N,breadbox,eban,eban(cheat),eban(embed),eban(exec),emoken,gami,hi_saito,hrkw,jijixi,kjana,krokofant,ksk,kt3k,letter,m,ma,moe,morimasa,mskzzz,mskzzzz,naoya_t,nazo,odz,okamotok,pooq,s0upa,shinh,sulky,tabasa,test,trebir,unau,usa,usa(cheat),usa(embed),wow,yamaya,ysn,yunyun,zetamatta,znz
Bash           (240,69): ,51b,666,Al Dimond,David Rainsford,Frane,Gus,KEN3,Kee,Mark Byers,RiSK,Robert,alexmdac,amedama,bizzfuzz,blue,blueblimp,breadbox,bungee,daira,eban,eban(alt),eban(bash),eban(cheat),elb,emoken,flagitious,flatline,gami,hansode,hat,hibi,hirose,kazuho,ksk,kt3k,kurimura,kuwashima,lifthrasiir,lurker,ma,mokotan,moriA,moriB,mskzz,mskzzz,mskzzzz,nazo,notogawa,pla,pneuma,rawwell,sgr,shaurz,shinh,smly,tabasa,trebir,unau,usa,ush,xhl,yamaya,yhara,ym,ysn,yuizumi,zetamatta,znz
sed            (236,37): 51b,Ciaran,Mark Byers,_N,breadbox,drigz,eban,eban(cheat),eban(embed),eban(exec),eban-,emoken,emoken(embed),goto,hirose,hrkw,irori,jg,kerebron,kt3k,m,moe,momo,moriA,morimasa,mskzzz,mskzzzz,ott,s0upa,shinh,tabasa,taka,usa,yamaya,ysn,yuizumi,znz
Common LISP    (223,41): 	Defenestrator (read file),Defenestrator,Grue,Gus,Magnus Jonsson,Mark Byers,RiSK,Robert,___,breadbox,cm(exec),ddickison,ddickison(format),ddickison(loop),fkm,foo,kozima,kozima	,kozima(embed),kt3k,m,ma,ma(2),mskzzzz,nazo,negi,notany,ozy4dm,plh,pooq,rogersm,shimizu,shinh,siru,sn,tabasa,tokiwa,winstonsmith,wow,yhara,znz
Scheme         (222,64): ,EthanB,JonPhilpott,Milly,O,RiSK,Robert,_,astecp,blue,fkm,foo,gnome,guybrush,haya,hirofummy,hirofummy(embed),hirofummy/exec,hirose,juli,kaki,kazuya_a,kkishi,konbu,konn,kozima,kt3k,kuwashima,kyle,letter,m,ma,ma(embed),ma(no_cheat),ma(this_problem_sucks),maeda,masa.edw,motemen,mskzzz,mskzzzz,mushi,nazo,pla,pla(no exec),pla_cheat,pooq,ranekov,scm,shinh,sn,sshi,tabasa,tanakh,tanzaku,theoria,thori,tokiwa,troter,unno,wow,yhara,yuichi,yuki_neko_nyan,znz
C#             (212,88): 666,@,AncientCodeslinger,Belligerent,Bongo Bill,Craig,Ehsan,FalconNL,Inoue,J,JohnStalcup,Josh Harris,Justin Bozonier,KaZoo,Kokuma,Mark Byers,Matt,Mikkun,Nikes,Patrik,RiSK; un=RiSK,Seb1499,SiroKuro,Tim,Vandra Akos,YokoKen,Your_Persona,a,aDodo,abobo,abortjesus.com,aschazaar1001,aschazaar1002,atlas,axos88,cat-walk,daze,drawk,drawk2,drawk3,drawk4,drawk5,drawk6,drawk7,ehe,elb,ginga,gth,haichi,joe,jrun,kazuki,kenz,kihon,krokofant,kt3k,kurimura,lynng,matarillo,mei,mho,mskzzzz,nattow,nazo,notogawa,noxpert,pg9,raj,raj2,rulerofutumno,saiya,sentium,shinh,siokoshou,siokoshou(NoCheat),siokoshou(dd),siokoshou(unfair),siokoshou+matarillo,snFB,sside,tabasa,unnonouno,usa,wit,xebu,ysn,yuizumi,zcrar70
Brainfuck      (193,40): ,Mark Byers,REM(VIPPER),REM_VIPPER,RiSK,SeeNoEvil,Zauberer,_,_(embed),breadbox,f,flagitious,hirose,hirose(cheat),jreiffers,kaki,kinaba,ksk,kt3k,kt3k(cheat),kt3k_,kurimura,m,mskzzz,mskzzzz,nazo,niha,notogawa,nuko,ozy4dm,pascal,pi8027,shinh,shinh(cheat),shinh(tetraglot),shuyo,smly,tabasa,yowa,yzx
C++            (182,108): ,&amp;#1605;&amp;#1581;&amp;#1605;&amp;#1583;&amp;nbsp;&amp;#1576;&amp;#1606;&amp;nbsp;&amp;#1605;&amp;#1608;&amp;#1587;&amp;#1575;&amp;nbsp;&amp;#1575;&amp;#1604;&amp;#1582;&amp;#1608;&amp;#1585;&amp;#1586;&amp;#1605;&amp;#1610;,666,7gyou,Andrew,Anon,Arturion,Arturion (recursive),Azumanga,CScppig1995,Chris,Chronos111,DS,Dan,FalconNL,Gus,IceManXp,Jonathan,Karu!,Kee,Kronos111,LoRRy,Lorentzen,NickP,NickP.,Okiesmokie,OvermindDL1,RiSK,RiSK; un=RiSK,Ricardo,Runtime,SOL,Siddhartha Gandhi,Smasher,Standard,Stupid1,Sumudu,Tay Kaijun,TheEconomist,afarmer,ahoudori,alexmdac,alofalt,blueblimp,bluefox,breadbox,bumSki,eban,egashira,ema,erosuke,fryman,h0shu,humpty,humptyOther,hyoroku,hyperair,iwadon,j.hzr,jhon.hzr,joe,katsu,kenz,kibi,ksk,kt3k,kurimura,kus,letter,lifthrasiir,lokko,m.ukai,me22,mi,mibuna,mintman,moriA,mskzzzz,n,nazo,neologic,niha,noah,notogawa,nyock,ozy4dm,passworder,pbe,roflcopter,s,sabupot,scottg,sgr,shinh,shinh (C C++ Ruby Python PHP Perl),shinh (C C++ Ruby Python PHP),shinynew,t_issie,tabasa,toki,trebir,usa,usaoya,xenocide,ysn,znz,zybler_hyperair,zyblerair
BASIC          (154,22): ,FalconNL,Kee,Tekgno,abb,breadbox,h0shu,kt3k,mskzzz,mskzzzz,poop,pooq,scottg,shinh,siru,tabasa,tokiwa,usa,xebu,yt,yt(cheat),yt(straightforward)
D              (151,27): ,51b,51b ,51b(embed),51b(no exec),Negitoro,ON,YT,breadbox,enk,kinaba,kt3k,kurimura,kurimura(no exec),letter,mskzzzz,nazo,niha,notogawa,ntabe,nyo,ozy4dm,qebab,rawwell,shinh,tabasa,yt
Lua            (147,30): ,Nexuapex,RiSK,Spencer Schumann,SpencerSchumann,blueblimp,breadbox,c031,eban,hammm,konn,kt3k,letter,letter(embed),mike,mskzzz,mskzzzz,nazo,planque,planque(cheat),planque(embed),rickrickrick,rickrickrick(no-load-file),roflcopter,tabasa,tokiwa,usa,yhara,yowa,znz
Befunge        (138,29): 51b,51b ,Mark Byers,Mark Byers (no stderr),Mark Byers (symbol),breadbox,eban,emoken,flagitious,hirose,hirose(sym),kaki,kik,kt3k,m,mskzzzz,nazo,niha,pla,shinh,shinh(tetraglot),tabasa,wiz,ySas,ySas(cheatless),ySas(ref),yhara,yowa,yzx
Smalltalk      (129,15): hirose,jijixi,kt3k,mskzzz,mskzzzz,murky-satyr,murky-satyr(%),nazo,poop,pooq,ralf,shinh,sumim,tabasa,usa
Ada            (128,20): ,Boost,D,Hakrabi,YT,hirose,kiste,kt3k,m.ukai,mskzzzz,nazo,shinh,tabasa,tokiwa,usa,yhara,yt,yt&amp;D,yt(bit op),yt(cheat)
Erlang         (124,19): 51b,51b(cheat),51b(computed),51b(embed),51b(no exec),51b(not embed),blueblimp,jijixi,jijixi(computed),konn,kt3k,moriA,mskzzzz,pooq,shinh,shuyo,sshi,tabasa,wookay
J              (118,13): eban,flagitious,irori,kinaba,kinaba(cheat),kt3k,lifthrasiir,mskzzzz,poop,pooq,pooq(exec),shinh,tabasa
Prolog         (113,19): ,Mikevil,Robert,breadbox,elb,elb(bin),hirose,kazuki,kt3k,mskzzzz,nazo,okina,pooq,sakai,shinh,tabasa,tanzaku,yooskeh,リァル・・・ァル・
Whitespace     (111,17): ,Kee,Mark Byers,breadbox,flagitious,hirose,kt3k,mskzzzz,phoenix,pla,shinh,shinh(tetraglot),shinh__,tabasa,tokiwa,toshi,yowa
z80            (99,15): GOROman,SeeNoEvil,eban,hiro.suzuki,hirose,kodera,kt3k,m.ukai,mokehehe,nyasu3w,nyasu3w(symbol),ozy4dm,shinh,tabasa,ySas
Xtal           (88,8): eban,kt3k,murky-satyr,nazo,ozy4dm,pooq,shinh,tabasa
Pascal         (84,26): 1-2-3,666,7gyou,Gaby,Herbert Sitz,breadbox,foo,hirose,hsitz,ksk,kt3k,mskzzzz,nazo,ozy4dm,planque,rawwell,sample implementation,scottg,sigle,tabasa,tokiwa,uru,usa,yhara,yt,yt(cheat)
Forth          (81,19): ,51b,51b ,51b(sh),Michael,breadbox,eban,fizz,kt3k,mskzzzz,nazo,no22,pbx,pooq,shaurz,shinh,tabasa,usa,yt
Io             (76,17): Io_fan,RiSK,ageldama,eban,fukkatsu otsu!,konn,kt3k,leonid,mskzzzz,nazo,pbx,poop,pooq,shinh,tabasa,usa,wow
Tcl            (75,19): RiSK,Sean,Zigs,breadbox,eban,ether,kt3k,mskzzz,mskzzzz,nazo,tabasa,tensaix2j,tensaix2j2,test,unau,usa,user,usk,ysk
Minus          (59,12): 51b,Mark Byers,breadbox,flagitious,flagitious(embed),hirose,kt3k,mskzzzz,shinh,tabasa,yowa,yowa(c)
Mind           (58,10): RiSK,eban,kt3k,maa,mskzzzz,poop,pooq,shinh,tabasa,yuizumi
xgawk          (45,14): 51b,Mark Byers,Robert,breadbox,eban,emoken,hi_saito,ksk,kt3k,mskzzzz,shinh,tabasa,usa,yamaya
COBOL          (41,13): Enigma,amginE,breadbox,hirose,kinaba,kt3k,masa_jade,mskzzzz,nazo,shinh,tabasa,uenoB,uenoB(no_cheat)
VHDL           (39,12): boon,educa,hirose,kt3k,mayarero,mskzzzz,natsutan,shinh,ta_bo__,tabasa,tori,yt
m4             (38,10): &lt;a href=&quot;#m4&quot;&gt;m4&lt;/a&gt;,51b,breadbox,eban,kt3k,lifthrasiir,mskzzzz,shinh,tabasa,yamaya
Curry          (35,7): breadbox,kt3k,m,mskzzzz,sakai,shinh,tabasa
Fortran        (30,16): 51b,RiSK,Simon Geard,breadbox,bungee,eban,hermi,kt3k,mskzzzz,nazo,scottg,tabasa,tokiwa,usa,yhara,yuizumi
gas            (28,14): 7gyou,CD,breadbox,eban,kik,kt3k,kurimura,lifthrasiir,mskzzz,mskzzzz,nazo,shinh,tabasa,wow
D-compile-time (24,8): breadbox,kt3k,kurimura,mskzzzz,nazo,niha,shinh,tabasa
x86            (23,10): 51b,breadbox,kt3k,maki,mskzzzz,nazo,shinh,shinh(tetraglot),tabasa,viznut
Lazy-K         (22,9): 51b,eban,hirose,irori,kt3k,niha,shinh,tabasa,yowa
Pefunge        (19,7): Mark Byers,flagitious,hirose,kik,kt3k,shinh,tabasa
Whirl          (17,8): 51b,atheye,hirose,kt3k,shinh,tabasa,yowa,yowa(o)

http://golf.shinh.org/

トラックバック - http://rubyist.g.hatena.ne.jp/hatecha/20071213

12/12(水) 2007

電卓 続き - 階乗

| 電卓 続き - 階乗 - たばさの を含むブックマーク はてなブックマーク - 電卓 続き - 階乗 - たばさの

関数定義、とりあえず文字列で保存してみた。f(x)=本体

ほかにいれたのは

while..{ ...},

if..then ..else..,

gets ..,

puts ..

次は複数行にわたる定義とかかな。


実行例


>fact(x)=if x==1 then 1 else x*fact(x-1)
fact(x)
>fact(99)
93326215443944152681699238856266700490715968264381621468592963895217599993229915
6089414639761565182862536979208272237582511852109168640000000000000000000000
>x=gets
5
5
>fact(x)
if x==1 then 1 else x*fact(x-1)
>y=gets
5
5
>fact(y)
120
>



ソース


# hensu.rb

prompt=">"
$lprompt=">>"
$prprompt=":"
$repprompt="|>"

$mem=[]
$hlist=[]
$assign={}
$his=[]

$hisfile="hensu-his.txt"

class Fv
 attr_accessor(:hlist,:assign,:name,:argv,:body)
end

def exist x
 $hlist.each{|i|
  return true if i==x
 }
 false
end

def existf x
 /\(.*\)/ =~x
 return false if !$`
 name=$`
 $hlist.each{|i|
  /\(.*\)/ =~i
  n=$`
 # p"exf",x,n,name,"$$"
  if $&
    if n==name
      return true
    end
  end
 }
 false
end

def getfunc x
 /\(([^\)]*)\)/ =~x
 vals=$1
 name=$`
 $hlist.each{|i|
  /\(([^\)]*)\)/ =~i
  n=$`
  if $&
    if n==name
      arg =$1
      return [i,arg.split(','),vals.split(',')]
    end
  end
 }
 false
end

def set x
 n=0
 while 1
  ($assign[x]=n ;$mem[n]=""; break) if $mem[n]==nil
  n+=1
 end
end

def argcalc arg,vals,a
  tmp=a.dup
  arg.length.times{|i|
    v=mainloop(vals[i])
    tmp.gsub!(arg[i],v)
  }
  mainloop(tmp)
end

# uhenchi
def calc d
 /--[0-9]+/=~d
 d.gsub!('--','+') if $&
 # func(..)
 /([a-zA-Z][a-zA-Z0-9]*\([^\)]+\))/ =~ d
 mae=$`
 usr=$'
 if $1
  if existf($1)
   f,arg,vals =getfunc($1)
   a = $mem[$assign[f]]
   a = argcalc(arg,vals,a)
   # p a,f,arg,vals,"$!$"
   return calc(mae+a.to_s+usr)
  else
   return calc(mae+usr)
  end
 end
 return calc($`+calc($1)+$') if $1
 # (...)
 /(.*)\(([^\)]+)\)(.*)/ =~ d
 return calc($1+calc($2)+$3) if $2
 # ..*/..
 /([a-zA-Z0-9\.]+ *[\*\/] *[a-zA-Z0-9\.]+) *([+\/\*\-].+)/ =~ d
 return calc($`+calc($1)+$2) if $2
 # ..*/..
 /(.+[+\/\*\-]) *([a-zA-Z0-9\.]+ *[\*\/] *[a-zA-Z0-9\.]+)/ =~ d
 return calc($1+calc($2)+$') if $2
 # ..+-..
 /([a-zA-Z0-9\.]+ *[+\-] *[a-zA-Z0-9\.]+) *([+-].+)/ =~ d
 return calc($`+calc($1)+$2) if $2
 # p d
 /([a-zA-Z0-9\.]+) *([+\*\-\/%]) *([a-zA-Z0-9\.]+)/=~d
 a=$1
 si=$2
 c=$3
 if !a
  if exist(d)
   a = $mem[$assign[d]]
   return a.to_s
  else 
   system(d[1..-1]) if d.length>0 && d[0,1]=="$"
   return d 
  end
 end
 if exist($1)
  a=$mem[$assign[$1]] 
 else
  a=$1
 end
 if exist($3)
  c=$mem[$assign[$3]] 
 else
  c=$3
 end
 /[^0-9e+\-\. ]/ =~ a.to_s
 f1=$&
 /[^0-9e+\-\. ]/ =~ c.to_s
 f2=$&
 return a.to_s + c.to_s if f2!=nil || f1!=nil
 return calc(eval(a.to_s + si + c.to_s ).to_s)
end

def getfname da
 / *(.+)/ =~ da
 file =$1
 file ="mylog.txt" if !$1
 file
end

def memo
 open($hisfile,'a'){|f|
  f.puts $his
 }
end

def funccalc a,b,c
  fn=Fv.new
  fn.name=a
  fn.argv=b.split(',')
  fn.body=c
  fn
end

def mainloop da
 $his<<da
 # function
 /([a-zA-Z][a-zA-Z0-9]*\((.*)\)) *=(.+)/ =~ da
 if $&
   a=funccalc $1,$2,$3
   # p a
   $hlist<<a.name if !exist a.name
   set a.name if $assign[a.name]==nil 
   $mem[$assign[a.name]]=$3
   return a.name
 end
 # gets
 /gets/ =~ da
 if $&
   a=gets.chomp
   return mainloop($`+a+$')
 end
 # while
 /while  *([^><=]+)([=><]+)(.+)  *\{([^\}]+)\}/ =~ da
 body=$4
 if $1
  an =calc($1)+$2+calc($3)
  if eval(an)
    mainloop(body)
    return mainloop($`+"while "+$1+$2+$3+" {"+body+"}"+$')
  else
    return mainloop($`+$')
  end
 end
 # multi
 /([^;]*);(.*)/ =~ da
 if $1
   mainloop $1
   return mainloop($2)
 end
 /if  *(.+)==(.+)  *then (.+)  *else  *(.+)/ =~ da
 mae=$`
 usr=$'
 if $1
  if calc($1)==calc($2)
    return mainloop(mae+$3+usr)
  else
    return mainloop(mae+$4+usr)
  end
 end
 /if  *(.+)<(.+)  *then (.+)  *else  *(.+)/ =~ da
 if $1
  if calc($1)<calc($2)
    return mainloop($`+$3+$')
  else
    return mainloop($`+$4+$')
  end
 end
 /if  *(.+)>(.+)  *then (.+)  *else  *(.+)/ =~ da
 if $1
  if calc($1)>alc($2)
    return mainloop($`+$3+$')
  else
    return mainloop($`+$4+$')
  end
 end
 # num.times
 /([0-9]+)\.times *\{ *([^\}]+) *\}/ =~ da
 body=$2
 if $&
  return $1.to_i.times{ |it|
    a=body.gsub("it", it.to_s)
    print "(#{a})",$repprompt;
    mainloop a
  }
 end
 # puts
 /puts  *(.+)/ =~ da
 (puts calc($1)
 return $`+calc($1)+$' ) if $1
 # simple equation
 /([a-zA-Z][a-zA-Z0-9]*(\[[0-9]+\])?) *= *(.+)/ =~ da
 a=$1
 b=$3
 if a
   ($hlist<<a) if !exist a
   set a if $assign[a]==nil 
   $mem[$assign[a]]=calc(b)
   return $mem[$assign[a]]
 else
   if da=="??"
     $hlist.each{|i| 
       puts $prprompt+i+" = "+$mem[$assign[i]].to_s
     }
     return""
   elsif da=="?"
     return $hlist*","
   elsif da=="???"
     p $mem,$hlist,$assign
     return ""
   elsif da=="his"
     p $his
     return ""
   elsif da=="hiss"
     return memo
   elsif da=="hisl"
     return mainloop("!load #{$hisfile}")
   elsif exist(da) 
     a=$mem[$assign[da]]
     system(a[1..-1]) if a.class==String && a[0..0]=="$"
     return a
   elsif da=="????"
     p "hensuu:",$hlist,"wariate:",$assign,"memory:",$mem
     return ""
   elsif da=='exit'
     memo
     exit
   elsif da=='help'
     help
     return ""
   elsif da[0,1]=='$'
     puts da[1..-1]
     system(da[1..-1])
     return ""
   elsif da[0,5]=="!load"
     file =getfname da[5..-1]
     open(file,"r"){|f|
       n=0
       f.each{|data|
         n+=1
         puts file+':'+"#{n}"+$lprompt+data
         puts mainloop(data)
       }
     }
     return ""
     # puts "loaded \'#{file}\'."
   elsif da[0,5]=="!save"
     file =getfname da[5..-1]
     open(file,"a"){|f| 
       $hlist.each{|i| 
         f.puts i.to_s+"="+$mem[$assign[i]].to_s
       }
     }
     return "saved as \'#{file}\'."
   else
     a=calc(da)
     return a
   end
 end
end

def help
 puts "example: 'x=1','y=text','?'(list),'z=x*2+(5-x)','!save [file]'(file save),'!load [file]', '???'(internal hensu dump),'$dir'(exec system.command) etc."
end

help
print prompt

while gets
  puts mainloop($_.chomp)
  print prompt
end

関数型むつかしい

関数型むつかしい - たばさの を含むブックマーク はてなブックマーク - 関数型むつかしい - たばさの

さっぱり。

トラックバック - http://rubyist.g.hatena.ne.jp/hatecha/20071212

12/11(火) 2007

電卓 続き

| 電卓 続き - たばさの を含むブックマーク はてなブックマーク - 電卓 続き - たばさの

f(x,y)=x+3*y とか。一文字変数なら何とかいけるはず。

単純に置換してるだけなのでそれ以上はまだ。ローカル変数の扱いでクラス使わないと駄目だなあと思いクラス作った。使ってない。「;」区切りで複文も可。

次はwhile,if文かな。


# hensu.rb

prompt=">"
$lprompt=">>"
$prprompt=":"
$repprompt="|>"
$mem=[]
$hlist=[]
$assign={}
$his=[]
$hisfile="hensu-his.txt"

class Fv
 attr_accessor(:hlist,:assign,:name,:argv,:body)
end

def exist x
 $hlist.each{|i|
  return true if i==x
 }
 false
end

def existf x
 /\(.*\)/ =~x
 return false if !$`
 name=$`
 $hlist.each{|i|
  /\(.*\)/ =~i
  n=$`
 # p"exf",x,n,name,"$$"
  if $&
    if n==name
      return true
    end
  end
 }
 false
end

def getfunc x
 /\(([^\)]*)\)/ =~x
 vals=$1
 name=$`
 $hlist.each{|i|
  /\(([^\)]*)\)/ =~i
  n=$`
  if $&
    if n==name
      arg =$1
      return [i,arg.split(','),vals.split(',')]
    end
  end
 }
 false
end

def set x
 n=0
 while 1
  ($assign[x]=n ;$mem[n]=""; break) if $mem[n]==nil
  n+=1
 end
end

def argcalc arg,vals,a
  tmp=a.dup
  arg.length.times{|i|
    tmp.gsub!(arg[i],vals[i])
    # p tmp
  }
  # p tmp,a
  tmp
end

# uhenchi
def calc d
 /--[0-9]+/=~d
 d.gsub!('--','+') if $&
 # func(..)
 /([a-zA-Z][a-zA-Z0-9]*\([^\)]+\))/ =~ d
 if existf($1)
   f,arg,vals =getfunc($1)
   a = $mem[$assign[f]]
   # p a,f,arg,vals,"$!$"
   a = argcalc(arg,vals,a)
   return calc($`+a.to_s+$')
 end
 return calc($`+calc($1)+$') if $1
 # (...)
 /(.*)\(([^\)]+)\)(.*)/ =~ d
 return calc($1+calc($2)+$3) if $2
 # ..*/..
 /([a-zA-Z0-9\.]+ *[\*\/] *[a-zA-Z0-9\.]+) *([+\/\*\-].+)/ =~ d
 return calc($`+calc($1)+$2) if $2
 # ..*/..
 /(.+[+\/\*\-]) *([a-zA-Z0-9\.]+ *[\*\/] *[a-zA-Z0-9\.]+)/ =~ d
 return calc($1+calc($2)+$') if $2
 # ..+-..
 /([a-zA-Z0-9\.]+ *[+\-] *[a-zA-Z0-9\.]+) *([+-].+)/ =~ d
 return calc($`+calc($1)+$2) if $2
 # p d
 /([a-zA-Z0-9\.]+) *([+\*\-\/%]) *([a-zA-Z0-9\.]+)/=~d
 a=$1
 si=$2
 c=$3
 if !a
  if exist(d)
   a = $mem[$assign[d]]
   return a.to_s
  else 
   system(d[1..-1]) if d[0,1]=="$"
   return d 
  end
 end
 if exist($1)
  a=$mem[$assign[$1]] 
 else
  a=$1
 end
 if exist($3)
  c=$mem[$assign[$3]] 
 else
  c=$3
 end
 /[^0-9e+\-\. ]/ =~ a.to_s
 f1=$&
 /[^0-9e+\-\. ]/ =~ c.to_s
 f2=$&
 return a.to_s + c.to_s if f2!=nil || f1!=nil
 return calc(eval(a.to_s + si + c.to_s ).to_s)
end

def getfname da
 / *(.+)/ =~ da
 file =$1
 file ="mylog.txt" if !$1
 file
end

def memo
 open($hisfile,'a'){|f|
  f.puts $his
 }
end

def funccalc a,b,c
  fn=Fv.new
  fn.name=a
  fn.argv=b.split(',')
  fn.body=c
  fn
end

def mainloop da
 /([^;]*);(.*)/ =~ da
 if $1
   mainloop $1
   return mainloop $2
 end
 $his<<da
 # num.times
 /([0-9]+)\.times *\{ *([^\}]+) *\}/ =~ da
 body=$2
 if $&
  return $1.to_i.times{ |it|
    a=body.gsub("it", it.to_s)
    print "(#{a})",$repprompt;
    mainloop a
  }
 end
 # function
 /([a-zA-Z][a-zA-Z0-9]*\((.*)\)) *=(.+)/ =~ da
 if $&
   a=funccalc $1,$2,$3
   p a
   $hlist<<a.name if !exist a.name
   set a.name if $assign[a.name]==nil 
   p $mem[$assign[a.name]]=$3
   return a.name
 end
 # simple equation
 /([a-zA-Z][a-zA-Z0-9]*(\[[0-9]+\])?) *= *(.+)/ =~ da
 a=$1
 b=$3
 if a
   ($hlist<<a) if !exist a
   set a if $assign[a]==nil 
   p $mem[$assign[a]]=calc(b)
 else
   if da=="??"
     $hlist.each{|i| 
       puts $prprompt+i+" = "+$mem[$assign[i]].to_s
     }
   elsif da=="?"
     puts $hlist*","
   elsif da=="???"
     p $mem,$hlist,$assign
   elsif da=="his"
     p $his
   elsif da=="hiss"
     memo
   elsif da=="hisl"
     mainloop "!load #{$hisfile}"
   elsif exist(da) 
     a=$mem[$assign[da]]
     p a
     system(a[1..-1]) if a.class==String && a[0..0]=="$"
   elsif da=="????"
     p "hensuu:",$hlist,"wariate:",$assign,"memory:",$mem
   elsif da=='exit'
     memo
     exit
   elsif da=='help'
     help
   elsif da[0,1]=='$'
     system(da[1..-1])
     puts
   elsif da[0,5]=="!load"
     file =getfname da[5..-1]
     open(file,"r"){|f|
       n=0
       f.each{|data|
         n+=1
         puts file+':'+"#{n}"+$lprompt+data
         mainloop data
       }
     }
     # puts "loaded \'#{file}\'."
   elsif da[0,5]=="!save"
     file =getfname da[5..-1]
     open(file,"a"){|f| 
       $hlist.each{|i| 
         f.puts i.to_s+"="+$mem[$assign[i]].to_s
       }
     }
     puts "saved as \'#{file}\'."
   else
     puts calc(da)
   end
 end
end

def help
 puts "example: 'x=1','y=text','?'(list),'z=x*2+(5-x)','!save [file]'(file save),'!load [file]', '???'(internal hensu dump),'$dir'(exec system.command) etc."
end

help
print prompt

while gets
  mainloop $_.chomp
  print prompt
end

トラックバック - http://rubyist.g.hatena.ne.jp/hatecha/20071211

12/10(月) 2007

google

| google - たばさの を含むブックマーク はてなブックマーク - google - たばさの

問題 http://golf.shinh.org/p.rb?google

アセンブル http://www.mokehehe.com/z80golf/test.html

環境 http://www.mokehehe.com/z80golf/


EOFでCaryy Flagが立つということなので #GETCHAR のあとにJR C,** とかRET C,**とかRET NC,**とか使って分岐します。EOFのときは変わりにバッファに(FFH)を入れておきます。INCでゼロ判定するため。ほかにいい方法あるかも。

CALC」(数値に変換ループ)では2倍と8倍を足して10倍、それに次の桁を足す、のループで。(足す前に文字ASCIIコードから30Hを引いて数値にしておく。)255までは使えるでしょう。それ以上だったらどうするのか。

しかしあと三倍か。



; sample: google
#PUTCHAR EQU 8000H
#GETCHAR EQU 8003H
@CR equ 0AH

 LD HL,WORD
 LD A,(HL)
 CALL #PUTCHAR
 LD HL,BUF
 CALL GET
 LD HL,WORD
 INC HL
 LD A,B
LOOP:
 LD B,A
 LD A,(HL)
 CALL #PUTCHAR
 LD A,B
 SUB 1
 JR NZ,LOOP

 INC HL
 LD A,(HL)
 CALL #PUTCHAR
 INC HL
 LD A,(HL)
 CALL #PUTCHAR
 INC HL
 LD A,(HL)
 CALL #PUTCHAR
 HALT
GET:
 CALL #GETCHAR
 JR C,CAR
 LD (HL),A
 INC HL
 JR GET
NEX:
 LD HL,BUF
 LD A,0
 LD B,0
CALC:
 LD A,(HL)
 INC A
 RET Z
 LD A,B
 RLCA
 LD B,A
 RLCA
 RLCA
 ADD A,B
 LD B,A
 LD A,(HL)
 SUB 030H
 ADD A,B

 LD B,A
 INC HL
 JR CALC
 
CAR:
 LD (HL),0FFH
 JR NEX
WORD:
 DB 'gogle'
BUF:
 DB '    '

;;

トラックバック - http://rubyist.g.hatena.ne.jp/hatecha/20071210

12/09(日) 2007

電卓 続き

| 電卓 続き - たばさの を含むブックマーク はてなブックマーク - 電卓 続き - たばさの

実数の処理。

xtal風に n.times{x=x*2+it}。itは => n.times{|it|x=x*2+it}

正規表現のとこにはとくにバグはあるかも。

つぎは関数定義あたりやってみたいがどうかな。ごちゃごちゃしてきた。


# hensu.rb
#ver.'071209

prompt=">"
$lprompt=">>"
$repprompt="|>"
$mem=[]
$hlist=[]
$assign={}
$his=[]
$hisfile="hensu-his.txt"

def exist x
 $hlist.each{|i|
  return true if i==x
 }
 false
end

def set x
 n=0
 while 1
  ($assign[x]=n ;$mem[n]=""; break) if $mem[n]==nil
  n+=1
 end
end

# uhenchi
def calc d
 # (...)
 /(.*)\(([^\)]+)\)(.*)/ =~ d
 return calc($1+calc($2)+$3) if $2
 # ..*/..
 /([a-zA-Z0-9\.]+ *[\*\/] *[a-zA-Z0-9\.]+) *([+\/\*\-].+)/ =~ d
 return calc($`+calc($1)+$2) if $2
 # ..*/..
 /(.+[+\/\*\-]) *([a-zA-Z0-9\.]+ *[\*\/] *[a-zA-Z0-9\.]+)/ =~ d
 return calc($1+calc($2)+$') if $2
 # ..+-..
 /([a-zA-Z0-9\.]+ *[+\-] *[a-zA-Z0-9\.]+) *([+-].+)/ =~ d
 return calc($`+calc($1)+$2) if $2
 # p d
 /([a-zA-Z0-9\.]+) *([+\*\-\/%]) *([a-zA-Z0-9\.]+)/=~d
 a=$1
 si=$2
 c=$3
 if !a
  if exist(d)
   a = $mem[$assign[d]]
   return a.to_s
  else 
   system(d[1..-1]) if d[0,1]=="$"
   return d 
  end
 end
 if exist($1)
  a=$mem[$assign[$1]] 
 else
  a=$1
 end
 if exist($3)
  c=$mem[$assign[$3]] 
 else
  c=$3
 end
 /[^0-9e+\-\. ]/ =~ a.to_s
 f1=$&
 /[^0-9e+\-\. ]/ =~ c.to_s
 f2=$&
 return a.to_s + c.to_s if f2!=nil || f1!=nil
 return eval(a.to_s + si + c.to_s ).to_s
end

def getfname da
 / *(.+)/ =~ da
 file =$1
 file ="mylog.txt" if !$1
 file
end

def memo his
 open($hisfile,'a'){|f|
  f.puts $his
 }
end


def mainloop da
 $his<<da
 # num.times
 /([0-9]+)\.times *\{ *([^\}]+) *\}/ =~ da
 body=$2
 return $1.to_i.times{ |it|
   a=body.gsub("it", it.to_s)
   mainloop a
   print $repprompt,"(#{a})";
 } if $&
 /([a-zA-Z][a-zA-Z0-9]*(\[[0-9]+\])?) *= *(.+)/ =~ da
 a=$1
 b=$3
 if a
   ($hlist<<a) if !exist a
   set a if $assign[a]==nil 
   p $mem[$assign[a]]=calc(b)
 else
   if da=="??"
     $hlist.each{|i| puts $assign[i].to_s+":"+i+" => "+$mem[$assign[i]].to_s}
   elsif da=="?"
     puts $hlist*","
   elsif da=="???"
     p $mem,$hlist,$assign
   elsif da=="his"
     p $his
   elsif da=="hiss"
     memo da
   elsif da=="hisl"
     mainloop "!load #{$hisfile}"
   elsif exist(da) 
     a=$mem[$assign[da]]
     p a
     system(a[1..-1]) if a.class==String && a[0..0]=="$"
   elsif da=="??"
     p "hensuu:",$hlist,"wariate:",$assign,"memory:",$mem
   elsif da=='exit'
     exit
   elsif da=='help'
     help
   elsif da[0,1]=='$'
     system(da[1..-1])
     puts
   elsif da[0,5]=="!load"
     file =getfname da[5..-1]
     open(file,"r"){|f|
       n=0
       f.each{|data|
         n+=1
         puts file+':'+"#{n}"+$lprompt+data
         mainloop data
       }
     }
     # puts "loaded \'#{file}\'."
   elsif da[0,5]=="!save"
     file =getfname da[5..-1]
     open(file,"a"){|f| 
       $hlist.each{|i| 
         f.puts i.to_s+"="+$mem[$assign[i]].to_s
       }
     }
     puts "saved as \'#{file}\'."
   else
     puts calc(da)
   end
 end
end

def help
 puts "example: 'x=1','y=text','?'(list),'z=x*2+(5-x)','!save [file]'(file save),'!load [file]', '???'(internal hensu dump),'$dir'(exec system.command) etc."
end

help
print prompt

while gets
  mainloop $_.chomp
  print prompt
end

トラックバック - http://rubyist.g.hatena.ne.jp/hatecha/20071209

12/07(金) 2007

電卓+α

| 電卓+α - たばさの を含むブックマーク はてなブックマーク - 電卓+α - たばさの

メモリ割り当て参照などの練習

x=Time.nowとやると時間が入る

のはrubyのせい。エラー処理はまだなし。



# hensu.rb

prompt=">"
$lprompt=">>"
$mem=[]
$hlist=[]
$assign={}

def exist x
 $hlist.each{|i|
  return true if i==x
 }
 false
end

def set x
 n=0
 while 1
  ($assign[x]=n ;$mem[n]=""; break) if $mem[n]==nil
  n+=1
 end
end

def calc d
 /([a-zA-Z0-9]+) *([+*-\/%]) *([a-zA-Z0-9]+)/=~d
 a=$1
 b=$2
 c=$3
 if !a
  if exist(d)
   return $mem[$assign[d]] 
  else 
   return d 
  end
 end
 if exist($1)
  a=$mem[$assign[$1]] 
 else
  a=$1
 end
 if exist($3)
  c=$mem[$assign[$3]] 
 else
  c=$3
 end
 # p eval($mem[$assign[$1]].to_s + $2 + $mem[$assign[$3]].to_s )
 eval(a.to_s + $2 + c.to_s )
end

def getfname da
 / *(.+)/ =~ da
 file =$1
 file ="mylog.txt" if !$1
 file
end

def mainloop da
 /([a-zA-Z][a-zA-Z0-9]*(\[[0-9]+\])?) *= *(.+)/ =~ da
 a=$1
 b=$3
 if a
   ($hlist<<a) if !exist a
   set a if $assign[a]==nil 
   #p "!",$hlist,$assign,$mem,"/"
   p $mem[$assign[a]]=calc(b)
   #p $hlist,$assign,$mem
 else
   if da=="?"
     $hlist.each{|i| puts $assign[i].to_s+":"+i+" => "+$mem[$assign[i]].to_s}
   elsif da=="?dump"
     p $mem,$hlist,$assign
   elsif exist(da) 
     p $mem[$assign[da]]
   elsif da=="??"
     p "hensuu:",$hlist,"wariate:",$assign,"memory:",$mem
   elsif da=='exit'
     exit
   elsif da=='help'
     help
   elsif da[0,1]=='$'
     system(da[1..-1])
     puts
   elsif da[0,5]=="!load"
     file =getfname da[5..-1]
     open(file,"r"){|f|
       f.each{|data|
         puts $lprompt+data
         mainloop data
       }
     }
     puts "loaded \'#{file}\'."
   elsif da[0,5]=="!save"
     file =getfname da[5..-1]
     open(file,"a"){|f| 
       $hlist.each{|i| 
         f.puts i.to_s+"="+$mem[$assign[i]].to_s
       }
     }
     puts "saved as \'#{file}\'."
   else
     puts calc(da)
   end
 end
end

def help
 puts "command : 'x=12','y=text','?'(list),'z=x*2'(simple only),'!save [file]'(file save),'!load [file]', '?dump'(internal hensu dump),'$com'(exec system.command) etc."
end

help
print prompt

while gets
  mainloop $_.chomp
  print prompt
end


電卓 続き

電卓 続き - たばさの を含むブックマーク はてなブックマーク - 電卓 続き - たばさの

まだ

>x=1

>y=-3

>x+y

-2

>x+(1+y)

1+-2

などというバグあり



# hensu.rb
# ver.0.2

prompt=">"
$lprompt=">>"
$mem=[]
$hlist=[]
$assign={}

def exist x
 $hlist.each{|i|
  return true if i==x
 }
 false
end

def set x
 n=0
 while 1
  ($assign[x]=n ;$mem[n]=""; break) if $mem[n]==nil
  n+=1
 end
end

# uhenchi
def calc d
 /(.*)\(([^\)]+)\)(.*)/ =~ d
 return calc($1+calc($2)+$3) if $2
 /([a-zA-Z0-9]+ *[\*\/] *[a-zA-Z0-9]+) *([+\/*-].+)/ =~ d
 return calc($`+calc($1)+$2) if $2
 /(.+[+\/*-]) *([a-zA-Z0-9]+ *[\*\/] *[a-zA-Z0-9]+)/ =~ d
 return calc($1+calc($2)+$') if $2
 /([a-zA-Z0-9]+ *[\+-] *[a-zA-Z0-9]+) *([+-].+)/ =~ d
 return calc($`+calc($1)+$2) if $2
 # p d
 /([a-zA-Z0-9]+) *([+*-\/%]) *([a-zA-Z0-9]+)/=~d
 a=$1
 b=$2
 c=$3
 if !a
  if exist(d)
   a = $mem[$assign[d]]
   return a.to_s
  else 
   system(d[1..-1]) if d[0,1]=="$"
   return d 
  end
 end
 if exist($1)
  a=$mem[$assign[$1]] 
 else
  a=$1
 end
 if exist($3)
  c=$mem[$assign[$3]] 
 else
  c=$3
 end
 # p eval($mem[$assign[$1]].to_s + $2 + $mem[$assign[$3]].to_s )
 return eval(a.to_s + $2 + c.to_s ).to_s
end

def getfname da
 / *(.+)/ =~ da
 file =$1
 file ="mylog.txt" if !$1
 file
end

def mainloop da
 /([a-zA-Z][a-zA-Z0-9]*(\[[0-9]+\])?) *= *(.+)/ =~ da
 a=$1
 b=$3
 if a
   ($hlist<<a) if !exist a
   set a if $assign[a]==nil 
   p $mem[$assign[a]]=calc(b)
 else
   if da=="?"
     $hlist.each{|i| puts $assign[i].to_s+":"+i+" => "+$mem[$assign[i]].to_s}
   elsif da=="?dump"
     p $mem,$hlist,$assign
   elsif exist(da) 
     a=$mem[$assign[da]]
     p a
     system(a[1..-1]) if a.class==String && a[0..0]=="$"
   elsif da=="??"
     p "hensuu:",$hlist,"wariate:",$assign,"memory:",$mem
   elsif da=='exit'
     exit
   elsif da=='help'
     help
   elsif da[0,1]=='$'
     system(da[1..-1])
     puts
   elsif da[0,5]=="!load"
     file =getfname da[5..-1]
     open(file,"r"){|f|
       n=0
       f.each{|data|
         n+=1
         puts file+':'+"#{n}"+$lprompt+data
         mainloop data
       }
     }
     # puts "loaded \'#{file}\'."
   elsif da[0,5]=="!save"
     file =getfname da[5..-1]
     open(file,"a"){|f| 
       $hlist.each{|i| 
         f.puts i.to_s+"="+$mem[$assign[i]].to_s
       }
     }
     puts "saved as \'#{file}\'."
   else
     puts calc(da)
   end
 end
end

def help
 puts "example: 'x=1','y=text','?'(list),'z=x*2+(5-x)','!save [file]'(file save),'!load [file]', '?dump'(internal hensu dump),'$com'(exec system.command) etc."
end

help
print prompt

while gets
  mainloop $_.chomp
  print prompt
end

トラックバック - http://rubyist.g.hatena.ne.jp/hatecha/20071207

12/03(月) 2007

anarchy golf 人気言語

anarchy golf 人気言語 - たばさの を含むブックマーク はてなブックマーク - anarchy golf 人気言語 - たばさの

エントリー数で評価。


lang (entry,persons): id,,,
-------------------------
Ruby           (1160,277): ,	flagitious(oops other solution is embed, but this one uses mathn :),666,AtoMa,Brian Adkins,Brian with Ben,Charles,Chuck Vose,Ciaran,Daniel Butler,DarkDust,Duane Bailey,Florian,GOROman,George Bush,GooGoo+.,Grant Hutchins,Habitue,Hector Vergara,Hexa,Hyperair,JaeSharp,JohnDough,KEN3,Kihara,Mark Byers,Mark Byers (symbol),Mark Byers 2 (symbol),Matthew,Milly,Myrd,Phill Kenoyer,RiSK,Robert,Rozza,Scott,Servo,Slartibartfast,Sohum,Spug,SuperFrankie,Takagi,Tay,Tomy,YAA,_,_N,_N(rand),___,a,ab,ageldama,akausagi,altair,ammmm,apeiros,ar,arikui,as,atheye,b2ox,bascule,bert,brad,brik,chucker,comp.lang.ruby,crazyjimbo,dai,dan,dan5,diddle,drunk guy from ohio,dux,dw,eban,eban(cheat),eban(noexec),eban(regexp),eban(require),eban(sym),eil,elb,ema,fkm,flagitious,flagitious(alnum),flagitious(alt),flagitious(embed),flagitious(mathn),flagitious(oops alnum),flagitious(oops other solution is embed, but this one uses mathn :),flagitious(req),flagitious(semi embed),flagitious(sym 4),flagitious(sym),flagitious(unembeded),flagitious(zlib),fmonkey,foo,fsystem,fuji,fuu,g5n,geir,geir_again,german,gomis,greenpenguin,gtheoret,ha-tan,hermi,hi,hirose,hirose(sym),hrkw,irori,irori(alt),irori(mathn),isrc,iwadon,j,javara,jj,jj-jrun,jrun,jrun1,junathecca,juno,kaki,kanagawa,kep,kermi,kik,killy971,kinaba,knu,kodera,konn,konn (embed &amp; not algorithmic),krokofant,ksk,ksk (mathn),ksk (sym),ksk(cheat),ksk(sym),ksk(sym+3B),kstn,kt3k,kt3k(sym),kt3k(sym_),kurimura,ky,lazymage,leonid,leonid (alnum),leonid (sym),leonid (sym) 2,leonid (symbol),leonid(sym),leonid(sym)2,letter,lifthrasiir,lokiju,m.ukai,ma,maki,mamamoto,masadoi,mather,megun,mgoss,minke,moriB,mskzzz,mskzzzz,murky-satyr,nakahira,naruse,nattow,nawa,nazo,neko,niha,niha(majime),niha(mathn),niha(zurui!),niwa-tori,nmk,notmatt,nozuru,nullpo,octech,ombra,oto-oto-oto,oto-oto-oto(),oza,ozy4dm,ozy4dm(inchiki),pnomolos,pooq,poqute,primo,probablycorey,puzzles,qwejkl,r,raspberry lemon,rawwell,rickrickrick,roflcopter,s,satoru,shinak,shinh,shinh (C C++ Ruby Python PHP Perl),shinh (C C++ Ruby Python PHP),shinh (mathn),shinh(alpha),shinh(cheatless),shinh(embed),shinh(other),shinh(sym),shinh(symbol),shrapnel,shuyo,siru,sourcek,spelunker,sshi,sumim,t_issie,tabasa,tad,takaaki,takase,takatoh,tamubun,tapasa,tar0_t,te,tell,test,th,tocken,tokiwa,tpope,tsukkee,ttsy,tututu,tyos,umasika,unno,usa,usa(alnum),usa(cheat),usa(embed),usa(mathn),usa(rehabilitation),usa(symbol),usa(t0),wara,wedge,wookay,wow,xfy,ySas,yasuhito,yhara,youchan,yowa,yowa(e),yowa(no pack),yunyun,yvl,znz,zraii
C              (808,272): ,18kb,51b,51b ,51b(calc),51b(cheat),51b(embed),51b(no exec),51b(not bin),51b(not embed),51b(竊粗mbed),666,7gyou,7gyou(after),7gyou(cheat),AKrotkov,Adam,Al Dimond,Amnesiasoft,Ancient123,Andrei,Anon,Arturion,BAR,Blayne,Bongo Bill,Brute Force Man,CD,DS,Dan,Dashiva,DiDi,Doster,DrFlibble,EarOwl,Frane,Free Bird,GauHelldragon,Gizzle,Gus,Harkonnen,Inky,Inside,Itamotsu,Kee,Ki,Kibi,MagicBobert,Magnus Jonsson,Mark Byers,Myrd,Natu,Negitoro,Okiesmokie,Patrick,Reed1,Reed2,Reed3,RiSK,Robert,Sarav,Sasha Slutsker,Skrud,SocialSecurity,Spliznork,TENDON,TenBin,TestingSomething,TheEconomist,TimO,Yuuki--;,Zauberer,_,a,abobo,adonai,afarmer,ahoudori,akihiro,albert,alex,alex2,alexmdac,alofalt,ancient123,angpoo,aoi,ark,bascule,blueblimp,boo,breadbox,dai,daira,dm,doubleukay,dud,eban,educa,egashira,emaland,endu,entragian,examiner,fkino,flagitious,foo,gaus,ggg,goh,green,h013,h0shu,havehave,hilite250,hina,hinoe,hinoe(another),hinoe(hidoi),hinoe(sorry),hiraku,hirose,how,hyoroku,i708,irori,ishiguro,jackpalance,joe,jojo,kamekozo321,katsu,kazuki,kcha,keigo,kenz,kikou,kinaba,kios,koedo,koge,kohei,kohei2,kohy,kotetu,kozima,krait,kt3k,kurimura,kyasu,lame attempt,letter,lifthrasiir,m.ukai,ma,maa,main(){system(&quot;cat&quot;);},main(){system(&quot;dd&quot;);},mamedaifuku,masashi,mayarero,melonhead,mendo1099,mezashi,mi,moge,mori,moriA,mskzzz,mskzzzz,murky-satyr,mushi,naka,naoya,nazo,negi,neocat,neologic,niha,nobody,not embed. leftmost? see http://shinh.skr.jp/m/?date=20070213#c12,notogawa,notogawa(cheat),ntabe,nullpo,obvious troll,oichang,ombra,oto-oto-oto,ozy4dm,ozy4dm(inchiki),paleman,papicon,pascal,peterx,pf,phoenix,pi8027,pneuma,ps,qebab,restday2,rgb_yoshijima,rickrickrick,ryoakg,s,s0upa,s_fox,sa,sabupot,sadakiyo,sargon,scottg,sentium,sgr,sh0u,sheerbird,shiena,shinh,shinh (C C++ Ruby Python PHP Perl),shinh (C C++ Ruby Python PHP),shinh(cheat),somebear,sourcek,sugarfree,sunsuron,suzume,t_issie,tabasa,takashi4233,tako,tanzaku,tapooh,ten,tensaix2j,test,tlwlvmtm,tmf,tokiwa,ttsy,tututu,tyoro,tyos,unco,unnonouno,usa,viznut,wiseler,wow,x0d,xenocide,yamada,yatchan,yhara,yoshijima,yowa,yshl,yshl(C, PostScript(bin)),yshl(C, PostScript),yshl(polyglot C and PostScript(bin)),yshl(polyglot C and PostScript),ysn,yt123,yu,yuizumi,yuta,yzx,zaki,znz,zybler,zyblerair,↑hinoeさんのコードを弄ってみた(by Ozy)
Python         (766,162): ,Adam Blinkinsop,AdamG,Aglet,Alexs,Amadeo Bellotti,Arafangion,Berengal,BioGeek,Dashiva,Defenestrator,Defenestrator (cheat),Ephphatha,Frane,HzFalcon,Jacob Rus,Jay,Jean-Louis,JohnStalcup,JonAllie,KUN,Ksero and #python,Lanzaa.,Mark Byers,Mark Byers (no binary),Michael,Milly,Patrick,RiSK,Richard Loveland,Robert,Ropo,Sasa,Sasa Petrovic,Sasa Petrovic2,Sasa Petrovic3,Sean,SeeNoEvil,SeeNoEvil (haha),SeeNoEvil(embed),Simple Solution,Stupid1,Thomas Geeee Willis,TsXc,U1A,__nb__,ac,accurrent,adbachman_01,adbachman_02,adbachman_03,ap,blueblimp,boo,chobo,darked,dinomite,doo,dplusplus,drigz,eban,ek,elb,elb(no compression),emaland,flagitious,flagitious and Mark Byers,flatline,fredrik,fuji,gee,go,hiro.suzuki,hiro.suzuki (zip),hiro.suzuki縲€,hiro.suzuki縲€(no load file),hirose,hirose(sym),houeland,itsme,jijixi,jj,jk,junya,kamezou,kashifkhan,ksk,kt3k,kt3k(...,kt3k(another,kt3k(no bin),kt3k(sym),letter,lifthrasiir,lifthrasiir (no cheat),lyx,mft,mho,mkszzz,morchin,moriA,mozi codo,mskzzz,mskzzzz,musicinmybrain,nack,nazo,neger,neger2,neger3,neger5,neger6,neger7,neger8,nob,nobody,notme,notogawa,octech,oqre,ozy4dm,pbx,pp,primo,py2,qebab,qebaba,quietgolfer,rawwell,ryo,sakaki,sdfsd,sdkay,shaurz,shbird,sheerbird,shimizu,shinh,shinh (C C++ Ruby Python PHP Perl),shinh (C C++ Ruby Python PHP),siru,skrzynka,stesch,strank,superneger1,superneger7,superneger8,tabasa,tahai,tenkoma,test,thor,tokiwa,tyr,usa,wer,wow,zak,zakj,zeek,zetamatta,znz
Perl           (580,165): ,324324,Aglet,Bhaskar,CD,Ciaran,Eric Elinow,Eric Elinow2,Fotios,Hテ・kan,Io_fan,Leonardo Herrera,Mark Byers,Milly,Mithran,RayQ,RiSK,Robert,Sarav,Sarav(not my code),Skrud,SocialSecurity,Spencer Schumann,TAKESAKO,Tadman,TakashiYamaoka,Terje K,YAA,Yagi,ace,alp,another,ar,blazar,brad,bran,breadbox,dacci,dankogai,dankogai (cheat?),davidad,deq,dinomite,drmz,eban,eban(cheat),emaland,entragian,erics84,fkm,flagitious,foo,fotios,fujiwara,gamehaus,gomis,haru,hassy,hassylin,havana,hiroaki,hirose,hotaru,hs,initself,intangible1,intangible2,intangible_not_cheat,jg,jimr,jls,junathecca,k12u,kf,kinaba,kohei,komondorok,konbu,kounoike,kozima,ksk,kt3k,letter,m.ukai,maa,mauke,melonhead,mho,momo,moriA,morimasa,morita,moritan,mskzzz,mskzzzz,mwb,nazo,negi,neocat,nh33,niha,nnn,nohat,noname,nonstrict,nuko,nullpo,odz,op,osa,ott,ott(cheat),ott(embed),ott(nocheat),ott(noembed),ozy4dm,paperhat,pascal,ph,ph2,pp,prakash,sa,sabupot,safii,saitoma,scottg,shinh,shinh (C C++ Ruby Python PHP Perl),shinh (sym),shinh(symbol),shmem,sma,sma1,sugarfree,sunsuron,t4652f85e,t_issie,tabasa,tacky,teengenerate,tete,theducks,ti,tripa,ttt,tybalt89,umasika,unau,usa,uu,whitebell,wow,xhl,ySas,ySas (cheat),ySas(embed),ySas(inspired by kinaba),yoortje,yuki,yuki_neko_nyan,yzx,zetamatta,znz,・儡as
Haskell        (510,78): ,.[1..100]&gt;&gt;=pen,2nd sample output is wrong!,7gyou,80,Ben,Defenestrator,Gus,Kee,Magnus,Magnus Jonsson,NMSpaz,This is test code.,[1..100]&gt;&gt;=pen,[1..100]&gt;&gt;=pen (not golf),[1..100]&gt;&gt;=pen(MushaKushaShiteYatta),[1..100]&gt;&gt;=pen. leftmost? see http://shinh.skr.jp/m/?date=20070213#c12,_,_(embed),a,aljee,b2ox,b2ox(embed),b2ox(invalid),b2ox; un=b2ox,blue,blueblimp,breadbox,davidad,emoken,flagitious,glguy,halt,irori,katsu,kinaba,konn,konn(ERAT),konn(FER),konn(MR),kt3k,kurimura,kuwashima,lazard,m,mgsloan,moriA,moriA(exec),moriB,mskzzzz,nazo,notogawa,notogawa(cheat),notogawa(embed),notogawa(exec),notsmack,oxy,ozy4dm,pbx,r-west,rulerofutumno,sakai,scottg,seasons,shaurz,shinh,smly,sshi,sss,tabasa,takatoh,tanakh,tanakh; un=tanakh,tanzaku,test,testprogram,tex,ttsy
PHP            (490,206): ,#suidroot,(given integer &lt; 111) [1..100]&gt;&gt;=pen,.[1..100]&gt;&gt;=pen,18kb,Andrew,Eddie,Eduardo,Emanuel,EmoJimbo,EricSmith,FalconNL,FlatLine,GotMex?,HotRod,HzFalcon,HzFalcon(symbol),Inoue,JohnStalcup,Jose,Justin,K_TAKAGI,Kevin Francis,Kevin G Francis,Kim...,LatinoHeat,LatinoThunder,Loadx,Mark Byers,Marz,Mearn,Mighty,Mike Alexander,Mike Alexander2,Milly,Newave Designs,Paul,Paul Wilkins,PeePeeFace,RiSK,RichieC,Robert,Sasha Slutsker,Sean,SeeN,Simon Lim,SirFartsAlot,Slick,Stupid1,T,T-bag,TENDON,TrueJournals,VatoLoco,Vraylle,WillieGollino,YungSang,ZARU,Zach,Zack,[1..100]&gt;&gt;=pen,a,abobo,acp,adachi,afarmer,ajkirwin,akkun_choi,alex,altair,anonymous,apalan,apo,ar,ar(cheat),ast,beton,blaat,blaat2,blaat3,bluejean,bluejean(symbol),bluejean(symbol_),bumbumface,charly,chatii,chucker,codetester,con,daira,daze,deanWombourne,decama,demonicus,devidos,doraenator,eban,eil,elb,emaland,enSige,ensige,entragian,eviljim,fal,flagitious,forte,ha1t,hamori,hamori縲€,hh,hi-poko,hilde,hisapoko,hogera,hohe(given integer &lt; 111) [1..100]&gt;&gt;=pen,honestnaoko,hs,iatz,ideo,igooo,imoto,intangible,iphoting,itochin,j4,jazzanova,jln,juno,kaska,kiba@kei-3,kinaba,konbu,koyuki,ksk,kt3k,l-tama,letter,mastercheap,mechaong,megun,mikechml,mitsu-,mogesura,momo,msk,mskzzz,mskzzzz,nazo,neko,nic,noah,nob,nuko,nullpo,ozy4dm,patches,persilian,php is for fools,pistoriusp,poopdawg,pop,pw,r28,rawwell,razor.crusade,rgb_yoshijima,rpatel10,shadow,shimooka,shinh,shinh (C C++ Ruby Python PHP Perl),shinh (C C++ Ruby Python PHP),siru,skyrc,smeghead,soushi,submatt,sunsuron,t_issie,tabasa,tanakh,tazyamah,te,test 1,testmn,thefizzbuzzthug,thetrve,tyoro,umasika,unau,usa,w,wow,xebu,xroric,yae,yoshijima,yowa,yuki,yzx,yzx(cheat),yzx(exec),znz,zybler,竊薙≠縺サ縺・
Postscript     (322,40): &lt;&lt;/The{}/answer 42/anser 42/to{}/life?{=}/universe?{=}/everything?{=}&gt;&gt;begin{(%stdin)(r)file token not{exit}if exec}loop,Mark Byers,Mark Byers (no binary),Troy Howard,konbu,kt3k,makoto-k,makoto-k(symbol),moriA,mskzzzz,shinh,tabasa,ySas,ySas (embed),ySas (not bin),ySas(bin),ySas(embed),ySas(not bin),ySas;,ySa・・yshl,yshl (alnum),yshl((%stdin) (r) file read {2 idiv =} if quit),yshl(C, PostScript(bin)),yshl(C, PostScript),yshl(a few bin),yshl(alnum),yshl(bin),yshl(bin)(cheat),yshl(bin)(embed),yshl(bin)(perl shinh 1174511406),yshl(cheat),yshl(compress),yshl(embed),yshl(embed)(bin),yshl(no bin),yshl(not bin),yshl(perl shinh 1174511406),yshl(polyglot C and PostScript(bin)),yshl(polyglot C and PostScript)
JavaScript     (320,50): ,51b,7gyou,AtoMa,Dashiva,FalconNL,JohnStalcup,Mark Byers,Milly,Patrick,RiSK,YAA,YungSang,boring,dsl,eban,eil,emaland,hirose,hogehoge,junathecca,kaki,kemco,kinaba,kt3k,kweg,letter,mi,motemen,mskzzzz,murky-satyr,murky-satyr (cheese),murky-satyr (emb),nanto_vi,nanto_vi (cheat),nanto_vi(cheat),nattow,nawa,nazo,nuko,ofk,ozy4dm,pooq,shinh,t4652f85e,tabasa,wow,xyzzy,yowa,znz
OCaml          (296,53): ,Adam Blinkinsop,Robert,SugarSun,airobo,airobo(noexec),blueblimp,bungee,elb,flagitious,hat,hrkw,jijixi,jijixi(noexec),kinaba,kizz,kozima,ksk,ksk (MD),ksk(Num),ksk(bin),ksk(cheat),ksk(embed),ksk(noexec),kt3k,kuwashima,letter,m.ukai,m.ukai(Num),m.ukai(embed),m.ukai(exec),m.ukai(noexec),moriA,mskzzzz,nazo,phoenix,pooq,s,samvid,shinh,smly,soutaro,sshi,suiginto,suiginto(bin),suiginto(embed),suiginto(embed)	,tabasa,tapooh,unnonouno,xhl,ysn,ysn(noexec)
Java           (284,144): ,7gyou,ACCELE,AfzalB,AfzalB Recursive,Ankur,Anonymous does not forgive,Arjun Comar,Bobo,Brian S,Brian Yi,Chris Drost,Dab,Dashiva,David Chan,Glimt,Gu,Gus,Imran,Ineffable3000,Isaac @ Programming,Joe,Joe(symbol),JohnStalcup,Jose,Kee,Keih,Mark Byers,Matt,Notch,PrestonP,RyanL,SIS,Sam,Sasha Slutsker,Spug,Stu Coates,TENDON,Tom,Undermined,Yoshiori,aaaaa,abatkin,abc,baxter,bchic869,bleis,breadbox,breadbox is a gay faggot,btcqg,bungee,cep,champkind,coke,craigus,csjunker,dEp,daira,degei,ds,eeb,elb,elb_cheat,enk,fs,fuddy,fune,georgia,geronimo,hoge,javara,jj,joe,joeBob,kemco,kenz,kibi,kik,kinaba,kra,krokofant,kt3k,kurimura,kweg,leatherboundbooks,letter,letter(embed),mark,masa,megun,mn,moe,moe2,mskzzz,mskzzzz,murky-satyr,n8theGr8,nack,namamekashi-banchou,nattow,nayamashi-banchou,nazo,nielsc,niwa-tori,notogawa,notogawa(cheat),okamotok,orrc,ozy4dm,perisy,phoenix,planete2303,pw,rawwell,richmahogany,roki,s0upa,sasaking,scottg,shiena,shinh,shr3kst3r,siokoshou,ste_mcleod,sug,swac,t_issie,tabasa,takashima,test,tnk,toshi,tyrn,usa,usaoya,warriorness,wow,yhara,yooskeh,you said you wouldn't kiss&amp;tell!,yuhei,zcrar70,zen,znz
AWK            (247,46): ,Mark Byers,Regiomontanus,_N,breadbox,eban,eban(cheat),eban(embed),eban(exec),emoken,gami,hi_saito,hrkw,jijixi,kjana,krokofant,ksk,kt3k,letter,m,ma,moe,morimasa,mskzzz,mskzzzz,naoya_t,nazo,odz,okamotok,pooq,s0upa,shinh,sulky,tabasa,test,trebir,unau,usa,usa(cheat),usa(embed),wow,yamaya,ysn,yunyun,zetamatta,znz
Bash           (238,69): ,51b,666,Al Dimond,David Rainsford,Frane,Gus,KEN3,Kee,Mark Byers,RiSK,Robert,alexmdac,amedama,bizzfuzz,blue,blueblimp,breadbox,bungee,daira,eban,eban(alt),eban(bash),eban(cheat),elb,emoken,flagitious,flatline,gami,hansode,hat,hibi,hirose,kazuho,ksk,kt3k,kurimura,kuwashima,lifthrasiir,lurker,ma,mokotan,moriA,moriB,mskzz,mskzzz,mskzzzz,nazo,notogawa,pla,pneuma,rawwell,sgr,shaurz,shinh,smly,tabasa,trebir,unau,usa,ush,xhl,yamaya,yhara,ym,ysn,yuizumi,zetamatta,znz
sed            (236,37): 51b,Ciaran,Mark Byers,_N,breadbox,drigz,eban,eban(cheat),eban(embed),eban(exec),eban-,emoken,emoken(embed),goto,hirose,hrkw,irori,jg,kerebron,kt3k,m,moe,momo,moriA,morimasa,mskzzz,mskzzzz,ott,s0upa,shinh,tabasa,taka,usa,yamaya,ysn,yuizumi,znz
Common LISP    (223,41): 	Defenestrator (read file),Defenestrator,Grue,Gus,Magnus Jonsson,Mark Byers,RiSK,Robert,___,breadbox,cm(exec),ddickison,ddickison(format),ddickison(loop),fkm,foo,kozima,kozima	,kozima(embed),kt3k,m,ma,ma(2),mskzzzz,nazo,negi,notany,ozy4dm,plh,pooq,rogersm,shimizu,shinh,siru,sn,tabasa,tokiwa,winstonsmith,wow,yhara,znz
Scheme         (211,62): ,EthanB,JonPhilpott,Milly,O,RiSK,Robert,_,astecp,blue,fkm,foo,gnome,guybrush,haya,hirofummy,hirofummy(embed),hirofummy/exec,hirose,juli,kazuya_a,kkishi,konbu,konn,kozima,kt3k,kuwashima,kyle,letter,m,ma,ma(embed),ma(no_cheat),ma(this_problem_sucks),maeda,masa.edw,motemen,mskzzz,mskzzzz,nazo,pla,pla(no exec),pla_cheat,pooq,ranekov,scm,shinh,sn,sshi,tabasa,tanakh,tanzaku,theoria,thori,tokiwa,troter,unno,wow,yhara,yuichi,yuki_neko_nyan,znz
Brainfuck      (191,39): ,Mark Byers,REM(VIPPER),REM_VIPPER,RiSK,SeeNoEvil,_,_(embed),breadbox,f,flagitious,hirose,hirose(cheat),jreiffers,kaki,kinaba,ksk,kt3k,kt3k(cheat),kt3k_,kurimura,m,mskzzz,mskzzzz,nazo,niha,notogawa,nuko,ozy4dm,pascal,pi8027,shinh,shinh(cheat),shinh(tetraglot),shuyo,smly,tabasa,yowa,yzx
C++            (181,107): ,&amp;#1605;&amp;#1581;&amp;#1605;&amp;#1583;&amp;nbsp;&amp;#1576;&amp;#1606;&amp;nbsp;&amp;#1605;&amp;#1608;&amp;#1587;&amp;#1575;&amp;nbsp;&amp;#1575;&amp;#1604;&amp;#1582;&amp;#1608;&amp;#1585;&amp;#1586;&amp;#1605;&amp;#1610;,666,7gyou,Andrew,Anon,Arturion,Arturion (recursive),Azumanga,Chris,Chronos111,DS,Dan,FalconNL,Gus,IceManXp,Jonathan,Karu!,Kee,Kronos111,LoRRy,Lorentzen,NickP,NickP.,Okiesmokie,OvermindDL1,RiSK,RiSK; un=RiSK,Ricardo,Runtime,SOL,Siddhartha Gandhi,Smasher,Standard,Stupid1,Sumudu,Tay Kaijun,TheEconomist,afarmer,ahoudori,alexmdac,alofalt,blueblimp,bluefox,breadbox,bumSki,eban,egashira,ema,erosuke,fryman,h0shu,humpty,humptyOther,hyoroku,hyperair,iwadon,j.hzr,jhon.hzr,joe,katsu,kenz,kibi,ksk,kt3k,kurimura,kus,letter,lifthrasiir,lokko,m.ukai,me22,mi,mibuna,mintman,moriA,mskzzzz,n,nazo,neologic,niha,noah,notogawa,nyock,ozy4dm,passworder,pbe,roflcopter,s,sabupot,scottg,sgr,shinh,shinh (C C++ Ruby Python PHP Perl),shinh (C C++ Ruby Python PHP),shinynew,t_issie,tabasa,toki,trebir,usa,usaoya,xenocide,ysn,znz,zybler_hyperair,zyblerair
BASIC          (152,22): ,FalconNL,Kee,Tekgno,abb,breadbox,h0shu,kt3k,mskzzz,mskzzzz,poop,pooq,scottg,shinh,siru,tabasa,tokiwa,usa,xebu,yt,yt(cheat),yt(straightforward)
Lua            (147,30): ,Nexuapex,RiSK,Spencer Schumann,SpencerSchumann,blueblimp,breadbox,c031,eban,hammm,konn,kt3k,letter,letter(embed),mike,mskzzz,mskzzzz,nazo,planque,planque(cheat),planque(embed),rickrickrick,rickrickrick(no-load-file),roflcopter,tabasa,tokiwa,usa,yhara,yowa,znz
D              (145,26): ,51b,51b(embed),51b(no exec),Negitoro,ON,YT,breadbox,enk,kinaba,kt3k,kurimura,kurimura(no exec),letter,mskzzzz,nazo,niha,notogawa,ntabe,nyo,ozy4dm,qebab,rawwell,shinh,tabasa,yt
Befunge        (138,29): 51b,51b ,Mark Byers,Mark Byers (no stderr),Mark Byers (symbol),breadbox,eban,emoken,flagitious,hirose,hirose(sym),kaki,kik,kt3k,m,mskzzzz,nazo,niha,pla,shinh,shinh(tetraglot),tabasa,wiz,ySas,ySas(cheatless),ySas(ref),yhara,yowa,yzx
Ada            (125,20): ,Boost,D,Hakrabi,YT,hirose,kiste,kt3k,m.ukai,mskzzzz,nazo,shinh,tabasa,tokiwa,usa,yhara,yt,yt&amp;D,yt(bit op),yt(cheat)
J              (117,13): eban,flagitious,irori,kinaba,kinaba(cheat),kt3k,lifthrasiir,mskzzzz,poop,pooq,pooq(exec),shinh,tabasa
Erlang         (116,19): 51b,51b(cheat),51b(computed),51b(embed),51b(no exec),51b(not embed),blueblimp,jijixi,jijixi(computed),konn,kt3k,moriA,mskzzzz,pooq,shinh,shuyo,sshi,tabasa,wookay
Prolog         (113,19): ,Mikevil,Robert,breadbox,elb,elb(bin),hirose,kazuki,kt3k,mskzzzz,nazo,okina,pooq,sakai,shinh,tabasa,tanzaku,yooskeh,リァル・・・ァル・
Smalltalk      (110,14): hirose,jijixi,kt3k,mskzzz,mskzzzz,murky-satyr,nazo,poop,pooq,ralf,shinh,sumim,tabasa,usa
Whitespace     (104,17): ,Kee,Mark Byers,breadbox,flagitious,hirose,kt3k,mskzzzz,phoenix,pla,shinh,shinh(tetraglot),shinh__,tabasa,tokiwa,toshi,yowa
Unlambda       (99,15): Mark Byers,_,hayamizu,hirose,irori,irori(symbol),konn,kozima,kt3k,kurimura,m,mskzzzz,shinh,tabasa,yowa
Xtal           (84,8): eban,kt3k,murky-satyr,nazo,ozy4dm,pooq,shinh,tabasa
Io             (76,17): Io_fan,RiSK,ageldama,eban,fukkatsu otsu!,konn,kt3k,leonid,mskzzzz,nazo,pbx,poop,pooq,shinh,tabasa,usa,wow
Forth          (74,19): ,51b,51b ,51b(sh),Michael,breadbox,eban,fizz,kt3k,mskzzzz,nazo,no22,pbx,pooq,shaurz,shinh,tabasa,usa,yt
Tcl            (72,18): RiSK,Sean,Zigs,breadbox,eban,ether,kt3k,mskzzz,mskzzzz,nazo,tabasa,tensaix2j,test,unau,usa,user,usk,ysk
Minus          (59,12): 51b,Mark Byers,breadbox,flagitious,flagitious(embed),hirose,kt3k,mskzzzz,shinh,tabasa,yowa,yowa(c)
Mind           (58,10): RiSK,eban,kt3k,maa,mskzzzz,poop,pooq,shinh,tabasa,yuizumi
xgawk          (45,14): 51b,Mark Byers,Robert,breadbox,eban,emoken,hi_saito,ksk,kt3k,mskzzzz,shinh,tabasa,usa,yamaya
COBOL          (41,13): Enigma,amginE,breadbox,hirose,kinaba,kt3k,masa_jade,mskzzzz,nazo,shinh,tabasa,uenoB,uenoB(no_cheat)
VHDL           (39,12): boon,educa,hirose,kt3k,mayarero,mskzzzz,natsutan,shinh,ta_bo__,tabasa,tori,yt
m4             (37,10): &lt;a href=&quot;#m4&quot;&gt;m4&lt;/a&gt;,51b,breadbox,eban,kt3k,lifthrasiir,mskzzzz,shinh,tabasa,yamaya
Curry          (33,7): breadbox,kt3k,m,mskzzzz,sakai,shinh,tabasa
Fortran        (30,16): 51b,RiSK,Simon Geard,breadbox,bungee,eban,hermi,kt3k,mskzzzz,nazo,scottg,tabasa,tokiwa,usa,yhara,yuizumi
A+             (28,5): kt3k,mskzzzz,mskzzzz(ascii),shinh,tabasa
gas            (26,14): 7gyou,CD,breadbox,eban,kik,kt3k,kurimura,lifthrasiir,mskzzz,mskzzzz,nazo,shinh,tabasa,wow
D-compile-time (24,8): breadbox,kt3k,kurimura,mskzzzz,nazo,niha,shinh,tabasa
ObjC           (23,12): Anon,Frane,blueblimp,emaland,jijixi,kt3k,mskzzzz,nazo,pooq,tabasa,usa,yhara
x86            (22,10): 51b,breadbox,kt3k,maki,mskzzzz,nazo,shinh,shinh(tetraglot),tabasa,viznut
Lazy-K         (21,9): 51b,eban,hirose,irori,kt3k,niha,shinh,tabasa,yowa
Pefunge        (19,7): Mark Byers,flagitious,hirose,kik,kt3k,shinh,tabasa
Whirl          (17,8): 51b,atheye,hirose,kt3k,shinh,tabasa,yowa,yowa(o)

anarchy golf 日別 entry グラフ

anarchy golf 日別 entry グラフ - たばさの を含むブックマーク はてなブックマーク - anarchy golf 日別 entry グラフ - たばさの


07/01/29 **********
07/01/30 *************************************************
07/01/31 ******************************
07/02/01 ****************************************
07/02/02 *********************************************************************************************
07/02/03 ******************************************************
07/02/04 ************************************************************************************
07/02/05 ***********************************************************
07/02/06 ***********************************************
07/02/07 *******************************************************************************
07/02/08 ***************************************************************************************************
07/02/09 ************************************************************************
07/02/10 **************************************************
07/02/11 ***************
07/02/12 ************************************************************
07/02/13 ************************************************************************
07/02/14 ***********************************************
07/02/15 ***********************************************************************
07/02/16 ***************************************************
07/02/17 ***********************************************************************************************************
07/02/18 *********************************************************************
07/02/19 ************************************************************
07/02/20 *******************************************************
07/02/21 *******************************************************************************************************************************
07/02/22 ***************************************************************************************
07/02/23 ****************************************************************
07/02/24 *****************************************************************
07/02/25 ****************************************************
07/02/26 *************************************************************
07/02/27 ******************************************
07/02/28 *********************************************************************************************************************************************************************************************************************************
07/03/01 **********************************************************************************************************************************************************
07/03/02 *****************************************************************
07/03/03 *****************************************
07/03/04 **************************************************
07/03/05 *******************************************************************************************
07/03/06 ****************************************************************************************************
07/03/07 ***********************************************************************************************************************
07/03/08 **************************************************************************************************************************
07/03/09 *************************************************
07/03/10 *****************************************
07/03/11 ******************************
07/03/12 *******************************
07/03/13 **********************
07/03/14 ******************************************
07/03/15 ****************************************
07/03/16 **********************************************************
07/03/17 ******************
07/03/18 **************************
07/03/19 **********************
07/03/20 ************************************************
07/03/21 *****************************************************************
07/03/22 ************************************************
07/03/23 ********************************
07/03/24 ***************************
07/03/25 ***************************
07/03/26 ************************
07/03/27 *******************************
07/03/28 *****************************************
07/03/29 ********************************************
07/03/30 **********************************
07/03/31 ********************
07/04/01 **********************************************************
07/04/02 ****************************************************************
07/04/03 **********************************
07/04/04 *************
07/04/05 *************
07/04/06 *************************************
07/04/07 ************************************
07/04/08 *********
07/04/09 **************************
07/04/10 ***********************************************************************
07/04/11 **************************
07/04/12 **********************
07/04/13 *********
07/04/14 ******************
07/04/15 ********************
07/04/16 *********************
07/04/17 *********************
07/04/18 ****************
07/04/19 *
07/04/20 **********************************************
07/04/21 *******************
07/04/22 **********************
07/04/23 *********************
07/04/24 **********
07/04/25 *********************
07/04/26 ***************
07/04/27 **************
07/04/28 ******************
07/04/29 *************
07/04/30 ********
07/05/01 **************************************
07/05/02 ********
07/05/03 ******************************
07/05/04 ****************************
07/05/05 ****************************
07/05/06 *************************
07/05/07 *************
07/05/08 ************************************
07/05/09 **********************************************************
07/05/10 *****************************************************************
07/05/11 **************************************
07/05/12 ****************************************
07/05/13 *****************************************
07/05/14 *************************
07/05/15 ********************************
07/05/16 ********************
07/05/17 *****************
07/05/18 **************************************
07/05/19 ************************************
07/05/20 ***********************
07/05/21 ******************************
07/05/22 ******************************
07/05/23 **********************************************************************
07/05/24 ********************************************
07/05/25 ****************
07/05/26 *************************
07/05/27 **************************
07/05/28 ***************************************************
07/05/29 **************************
07/05/30 ********************
07/05/31 *********************
07/06/01 *****************************************
07/06/02 *****************************
07/06/03 ****************
07/06/04 **********************
07/06/05 *************************
07/06/06 **********************************************
07/06/07 ****************************************
07/06/08 *****************************************************
07/06/09 *********************
07/06/10 ********************
07/06/11 ********************
07/06/12 *****************************
07/06/13 *******************
07/06/14 *****************
07/06/15 *********************************
07/06/16 ********************
07/06/17 ****************************************************
07/06/18 *******************************************
07/06/19 ***************************************
07/06/20 ***************************
07/06/21 **************************
07/06/22 ***************
07/06/23 ********************
07/06/24 *********************************
07/06/25 *******************
07/06/26 ***************
07/07/08 ***
07/07/09 ********************
07/07/10 ***********
07/07/11 ***********************
07/07/12 ***********************
07/07/13 ****************
07/07/14 *************************
07/07/15 ***************
07/07/16 **********
07/07/17 **********
07/07/18 *****
07/07/19 ****
07/07/20 ****************
07/07/21 ***
07/07/22 ***********
07/07/23 *
07/07/24 ***********
07/07/25 *****
07/07/26 ******
07/07/27 *
07/07/28 *****************
07/07/29 *****************
07/07/30 *********
07/07/31 *****************
07/08/01 *********
07/08/02 ****
07/08/03 **************************************
07/08/04 ***************
07/08/05 *********************
07/08/06 ********************
07/08/07 ***********
07/08/08 ***************
07/08/09 ********************
07/08/10 ******************
07/08/11 *******
07/08/12 **********
07/08/13 *************
07/08/14 ************************
07/08/15 *************************
07/08/16 ****************
07/08/17 ******************************
07/08/18 ***********************************
07/08/19 *****************************
07/08/20 ************************
07/08/21 ***********************
07/08/22 *****************************************
07/08/23 *************
07/08/24 *******************
07/08/25 ******
07/08/26 **********************
07/08/27 ************************************
07/08/28 ************
07/08/29 ************
07/08/30 ***********
07/08/31 **********
07/09/01 *****************
07/09/02 *************
07/09/03 *********************
07/09/04 ************
07/09/05 *********
07/09/06 *****************
07/09/07 ********
07/09/08 *******
07/09/09 ************************
07/09/10 ***********************
07/09/11 *****************
07/09/12 ********************
07/09/13 *************************
07/09/14 *********************************
07/09/15 ********************
07/09/16 ************
07/09/17 **********************************************************************************************************************
07/09/18 *******************************
07/09/19 *********************************************
07/09/20 *****************************************************
07/09/21 *******************************
07/09/22 *********************
07/09/23 *******************************
07/09/24 ********************************
07/09/25 *****************
07/09/26 ********************************
07/09/27 **********************
07/09/28 *************************************
07/09/29 ************************************************
07/09/30 ********************
07/10/01 ****************************
07/10/02 **********************
07/10/03 *****************
07/10/04 **************
07/10/05 **********
07/10/06 ******************
07/10/07 *************
07/10/08 *******
07/10/09 *************
07/10/10 ******************
07/10/11 ********************************
07/10/12 **********
07/10/13 *****************
07/10/14 **************
07/10/15 *****
07/10/16 *************
07/10/17 ***********
07/10/18 ****************
07/10/19 ******
07/10/20 **********
07/10/21 *********************
07/10/22 *************
07/10/23 *************************************
07/10/24 **************************
07/10/25 *************
07/10/26 **************
07/10/27 *************
07/10/28 **************
07/10/29 *****************
07/10/30 *******************************************************************
07/10/31 ****************************************
07/11/01 **********************
07/11/02 **************************
07/11/03 *************************
07/11/04 *******************
07/11/05 *******************
07/11/06 *******************
07/11/07 ************
07/11/08 **************
07/11/09 *************************
07/11/10 ****************************
07/11/11 ***********************************************
07/11/12 ******************************************************
07/11/13 ******************
07/11/14 *********************************
07/11/15 *****************************
07/11/16 **********************************
07/11/17 ***************************
07/11/18 ***********************
07/11/19 *********************
07/11/20 *******************
07/11/21 *********************************************
07/11/22 *************************
07/11/23 ********************
07/11/24 ********************************
07/11/25 ******************************************************
07/11/26 **************************
07/11/27 *********************



# golfusr-entrytime.rb

log={}
name ="nn"
10000.times{|n|
    break if !FileTest.exist?( name+(n+1).to_s+".htm" ) 
    open(name+(n+1).to_s+".htm"){|w|
      w.each{|line|
        /\<td\>([0-9][0-9]\/[0-9][0-9]\/[0-9][0-9])( [0-9][0-9]:[0-9][0-9]:[0-9][0-9])\<\/td\>/ =~ line
        if $1
          if log[$1]
            log[$1]+=1
          else
            log[$1]=1
          end
        end
        /(Language Ranking)/ =~ line
        break if $1
      }
    }
}
log.sort.each{|t,n|
  puts t+" "+"*"*n
}

whitespace ml 適当な訳

| whitespace ml 適当な訳 - たばさの を含むブックマーク はてなブックマーク - whitespace ml 適当な訳 - たばさの

(2000)

--

てすと。

--

interpreter in haskel つくったよ

--

どうやってコンパイルごにょごにょ

--

ファイル読み込みが欲しいよね?

ファイル名を入力するとスタックにファイル番号が返ってくるとかどうかな。

--

だめー、そんなことしたらwhitespace がウイルスに侵されてしまうー!

--

ちょ、ウイルスって。

ないない。

(2003)

--

アップデートです!

--

--

spam

--

spam

--

なんでメンバー以外のめーる弾く設定にしてないんだろ

--

まてよ、これはひょっとしてspamにみせかけたwhitespace プログラムじゃないか?

--

あるあ・・・ないないない

--

ま、確かに出来るけどな

--

--

spam ****

--

--

はじめまして!

見つけましたwhitespace。いいですね~

ところでチューリングコンプリートどうおもいますか?

--

spam

--

おーい。spam ばっかりだなあ、おい。

--

すまんすまん。

spam ばかりなもんで見落としてた。

もちろん whitespace はチューリング・コンプリートだよ。



(2005)

--

参加します。whitespace。いいですね~。

C++でインタプリタ書いてるんすけど、バージョン0.3の追加機能で分からない

ところあるので質問させてください。

slide うんぬんのところは、1はどれをさすの?たぶんスタックのうえのほうからだと

思うんだけど、あってる?あと、ゼロ始まりかイチ始まりか。


--

おーい。

--

spam spam

--








おーい。


| 2007-12-03 - たばさの を含むブックマーク

cygwin, setup.exe でgnat取ってきて、

procedure gnat.io.a is begin put("Hello, world!!!?");end;

$ gnatmake

Usage: ...(略)

$ gnatmake -gnatG a.adb

$ ./a

Hello, world!!!?

よくわからんけど出来たー


参考

http://panathenaia.halfmoon.jp/alang/ada-samples.html 

http://golf.shinh.org/reveal.rb?Nothing/kt3k/1195648521

http://cygwin.com/

トラックバック - http://rubyist.g.hatena.ne.jp/hatecha/20071203

12/02(日) 2007

言語別

言語別 - たばさの を含むブックマーク はてなブックマーク - 言語別 - たばさの

anarchy golf


A+: kt3k,mskzzzz,mskzzzz(ascii),shinh,tabasa
AWK: ,Mark Byers,Regiomontanus,_N,breadbox,eban,eban(cheat),eban(embed),eban(exec),emoken,gami,hi_saito,hrkw,jijixi,kjana,krokofant,ksk,kt3k,letter,m,ma,moe,morimasa,mskzzz,mskzzzz,naoya_t,nazo,odz,okamotok,pooq,s0upa,shinh,sulky,tabasa,test,trebir,unau,usa,usa(cheat),usa(embed),wow,yamaya,ysn,yunyun,zetamatta,znz
Ada: ,Boost,D,Hakrabi,YT,hirose,kiste,kt3k,m.ukai,mskzzzz,nazo,shinh,tabasa,tokiwa,usa,yhara,yt,yt&amp;D,yt(bit op),yt(cheat)
BASIC: ,FalconNL,Kee,Tekgno,abb,breadbox,h0shu,kt3k,mskzzz,mskzzzz,poop,pooq,scottg,shinh,siru,tabasa,tokiwa,usa,xebu,yt,yt(cheat),yt(straightforward)
Bash: ,51b,666,Al Dimond,David Rainsford,Frane,Gus,KEN3,Kee,Mark Byers,RiSK,Robert,alexmdac,amedama,bizzfuzz,blue,blueblimp,breadbox,bungee,daira,eban,eban(alt),eban(bash),eban(cheat),elb,emoken,flagitious,flatline,gami,hansode,hat,hibi,hirose,kazuho,ksk,kt3k,kurimura,kuwashima,lifthrasiir,lurker,ma,mokotan,moriA,moriB,mskzz,mskzzz,mskzzzz,nazo,notogawa,pla,pneuma,rawwell,sgr,shaurz,shinh,smly,tabasa,trebir,unau,usa,ush,xhl,yamaya,yhara,ym,ysn,yuizumi,zetamatta,znz
Befunge: 51b,51b ,Mark Byers,Mark Byers (no stderr),Mark Byers (symbol),breadbox,eban,emoken,flagitious,hirose,hirose(sym),kaki,kik,kt3k,m,mskzzzz,nazo,niha,pla,shinh,shinh(tetraglot),tabasa,wiz,ySas,ySas(cheatless),ySas(ref),yhara,yowa,yzx
Brainfuck: ,Mark Byers,REM(VIPPER),REM_VIPPER,RiSK,SeeNoEvil,_,_(embed),breadbox,f,flagitious,hirose,hirose(cheat),jreiffers,kaki,kinaba,ksk,kt3k,kt3k(cheat),kt3k_,kurimura,m,mskzzz,mskzzzz,nazo,niha,notogawa,nuko,ozy4dm,pascal,pi8027,shinh,shinh(cheat),shinh(tetraglot),shuyo,smly,tabasa,yowa,yzx
C: ,18kb,51b,51b ,51b(calc),51b(cheat),51b(embed),51b(no exec),51b(not bin),51b(not embed),51b(竊粗mbed),666,7gyou,7gyou(after),7gyou(cheat),AKrotkov,Adam,Al Dimond,Amnesiasoft,Ancient123,Andrei,Anon,Arturion,BAR,Blayne,Bongo Bill,Brute Force Man,CD,DS,Dan,Dashiva,DiDi,Doster,DrFlibble,EarOwl,Frane,Free Bird,GauHelldragon,Gizzle,Gus,Harkonnen,Inky,Inside,Itamotsu,Kee,Ki,Kibi,MagicBobert,Magnus Jonsson,Mark Byers,Myrd,Natu,Negitoro,Okiesmokie,Patrick,Reed1,Reed2,Reed3,RiSK,Robert,Sarav,Sasha Slutsker,Skrud,SocialSecurity,Spliznork,TENDON,TenBin,TestingSomething,TheEconomist,TimO,Yuuki--;,Zauberer,_,a,abobo,adonai,afarmer,ahoudori,akihiro,albert,alex,alex2,alexmdac,alofalt,ancient123,angpoo,aoi,ark,bascule,blueblimp,boo,breadbox,dai,daira,dm,doubleukay,dud,eban,educa,egashira,emaland,endu,entragian,examiner,fkino,flagitious,foo,gaus,ggg,goh,green,h013,h0shu,havehave,hilite250,hina,hinoe,hinoe(another),hinoe(hidoi),hinoe(sorry),hiraku,hirose,how,hyoroku,i708,irori,ishiguro,jackpalance,joe,jojo,kamekozo321,katsu,kazuki,kcha,keigo,kenz,kikou,kinaba,kios,koedo,koge,kohei,kohei2,kohy,kotetu,kozima,krait,kt3k,kurimura,kyasu,lame attempt,letter,lifthrasiir,m.ukai,ma,maa,main(){system(&quot;cat&quot;);},main(){system(&quot;dd&quot;);},mamedaifuku,masashi,mayarero,melonhead,mendo1099,mezashi,mi,moge,mori,moriA,mskzzz,mskzzzz,murky-satyr,mushi,naka,naoya,nazo,negi,neocat,neologic,niha,nobody,not embed. leftmost? see http://shinh.skr.jp/m/?date=20070213#c12,notogawa,notogawa(cheat),ntabe,nullpo,obvious troll,oichang,ombra,oto-oto-oto,ozy4dm,ozy4dm(inchiki),paleman,papicon,pascal,peterx,pf,phoenix,pi8027,pneuma,ps,qebab,restday2,rgb_yoshijima,rickrickrick,ryoakg,s,s0upa,s_fox,sa,sabupot,sadakiyo,sargon,scottg,sentium,sgr,sh0u,sheerbird,shiena,shinh,shinh (C C++ Ruby Python PHP Perl),shinh (C C++ Ruby Python PHP),shinh(cheat),somebear,sourcek,sugarfree,sunsuron,suzume,t_issie,tabasa,takashi4233,tako,tanzaku,tapooh,ten,tensaix2j,test,tlwlvmtm,tmf,tokiwa,ttsy,tututu,tyoro,tyos,unco,unnonouno,usa,viznut,wiseler,wow,x0d,xenocide,yamada,yatchan,yhara,yoshijima,yowa,yshl,yshl(C, PostScript(bin)),yshl(C, PostScript),yshl(polyglot C and PostScript(bin)),yshl(polyglot C and PostScript),ysn,yt123,yu,yuizumi,yuta,yzx,zaki,znz,zybler,zyblerair,↑hinoeさんのコードを弄ってみた(by Ozy)
C#: 666,@,AncientCodeslinger,Belligerent,Bongo Bill,Craig,Ehsan,FalconNL,Inoue,J,JohnStalcup,Justin Bozonier,KaZoo,Kokuma,Mark Byers,Matt,Mikkun,Nikes,Patrik,RiSK; un=RiSK,Seb1499,SiroKuro,Tim,Vandra Akos,YokoKen,Your_Persona,a,aDodo,abobo,abortjesus.com,aschazaar1001,aschazaar1002,atlas,axos88,cat-walk,daze,drawk,drawk2,drawk3,drawk4,drawk5,drawk6,drawk7,ehe,elb,ginga,gth,haichi,joe,jrun,kazuki,kenz,kihon,krokofant,kt3k,kurimura,lynng,matarillo,mei,mho,mskzzzz,nattow,nazo,notogawa,noxpert,pg9,raj,raj2,rulerofutumno,saiya,sentium,shinh,siokoshou,siokoshou(NoCheat),siokoshou(dd),siokoshou(unfair),siokoshou+matarillo,snFB,sside,tabasa,unnonouno,usa,wit,xebu,ysn,yuizumi,zcrar70
C++: ,&amp;#1605;&amp;#1581;&amp;#1605;&amp;#1583;&amp;nbsp;&amp;#1576;&amp;#1606;&amp;nbsp;&amp;#1605;&amp;#1608;&amp;#1587;&amp;#1575;&amp;nbsp;&amp;#1575;&amp;#1604;&amp;#1582;&amp;#1608;&amp;#1585;&amp;#1586;&amp;#1605;&amp;#1610;,666,7gyou,Andrew,Anon,Arturion,Arturion (recursive),Azumanga,Chris,Chronos111,DS,Dan,FalconNL,Gus,IceManXp,Jonathan,Karu!,Kee,Kronos111,LoRRy,Lorentzen,NickP,NickP.,Okiesmokie,OvermindDL1,RiSK,RiSK; un=RiSK,Ricardo,Runtime,SOL,Siddhartha Gandhi,Smasher,Standard,Stupid1,Sumudu,Tay Kaijun,TheEconomist,afarmer,ahoudori,alexmdac,alofalt,blueblimp,bluefox,breadbox,bumSki,eban,egashira,ema,erosuke,fryman,h0shu,humpty,humptyOther,hyoroku,hyperair,iwadon,j.hzr,jhon.hzr,joe,katsu,kenz,kibi,ksk,kt3k,kurimura,kus,letter,lifthrasiir,lokko,m.ukai,me22,mi,mibuna,mintman,moriA,mskzzzz,n,nazo,neologic,niha,noah,notogawa,nyock,ozy4dm,passworder,pbe,roflcopter,s,sabupot,scottg,sgr,shinh,shinh (C C++ Ruby Python PHP Perl),shinh (C C++ Ruby Python PHP),shinynew,t_issie,tabasa,toki,trebir,usa,usaoya,xenocide,ysn,znz,zybler_hyperair,zyblerair
COBOL: Enigma,amginE,breadbox,hirose,kinaba,kt3k,masa_jade,mskzzzz,nazo,shinh,tabasa,uenoB,uenoB(no_cheat)
Common LISP: 	Defenestrator (read file),Defenestrator,Grue,Gus,Magnus Jonsson,Mark Byers,RiSK,Robert,___,breadbox,cm(exec),ddickison,ddickison(format),ddickison(loop),fkm,foo,kozima,kozima	,kozima(embed),kt3k,m,ma,ma(2),mskzzzz,nazo,negi,notany,ozy4dm,plh,pooq,rogersm,shimizu,shinh,siru,sn,tabasa,tokiwa,winstonsmith,wow,yhara,znz
Curry: breadbox,kt3k,m,mskzzzz,sakai,shinh,tabasa
D: ,51b,51b(embed),51b(no exec),Negitoro,ON,YT,breadbox,enk,kinaba,kt3k,kurimura,kurimura(no exec),letter,mskzzzz,nazo,niha,notogawa,ntabe,nyo,ozy4dm,qebab,rawwell,shinh,tabasa,yt
D-compile-time: breadbox,kt3k,kurimura,mskzzzz,nazo,niha,shinh,tabasa
Erlang: 51b,51b(cheat),51b(computed),51b(embed),51b(no exec),51b(not embed),blueblimp,jijixi,jijixi(computed),konn,kt3k,moriA,mskzzzz,pooq,shinh,shuyo,sshi,tabasa,wookay
Forth: ,51b,51b ,51b(sh),Michael,breadbox,eban,fizz,kt3k,mskzzzz,nazo,no22,pbx,pooq,shaurz,shinh,tabasa,usa,yt
Fortran: 51b,RiSK,Simon Geard,breadbox,bungee,eban,hermi,kt3k,mskzzzz,nazo,scottg,tabasa,tokiwa,usa,yhara,yuizumi
Haskell: ,.[1..100]&gt;&gt;=pen,2nd sample output is wrong!,7gyou,80,Ben,Defenestrator,Gus,Kee,Magnus,Magnus Jonsson,NMSpaz,This is test code.,[1..100]&gt;&gt;=pen,[1..100]&gt;&gt;=pen (not golf),[1..100]&gt;&gt;=pen(MushaKushaShiteYatta),[1..100]&gt;&gt;=pen. leftmost? see http://shinh.skr.jp/m/?date=20070213#c12,_,_(embed),a,aljee,b2ox,b2ox(embed),b2ox(invalid),b2ox; un=b2ox,blue,blueblimp,breadbox,davidad,emoken,flagitious,glguy,halt,irori,katsu,kinaba,konn,konn(ERAT),konn(FER),konn(MR),kt3k,kurimura,kuwashima,lazard,m,mgsloan,moriA,moriA(exec),moriB,mskzzzz,nazo,notogawa,notogawa(cheat),notogawa(embed),notogawa(exec),notsmack,oxy,ozy4dm,pbx,r-west,rulerofutumno,sakai,scottg,seasons,shaurz,shinh,smly,sshi,sss,tabasa,takatoh,tanakh,tanakh; un=tanakh,tanzaku,test,testprogram,tex,ttsy
Io: Io_fan,RiSK,ageldama,eban,fukkatsu otsu!,konn,kt3k,leonid,mskzzzz,nazo,pbx,poop,pooq,shinh,tabasa,usa,wow
J: eban,flagitious,irori,kinaba,kinaba(cheat),kt3k,lifthrasiir,mskzzzz,poop,pooq,pooq(exec),shinh,tabasa
Java: ,7gyou,ACCELE,AfzalB,AfzalB Recursive,Ankur,Anonymous does not forgive,Arjun Comar,Bobo,Brian S,Brian Yi,Chris Drost,Dab,Dashiva,David Chan,Glimt,Gu,Gus,Imran,Ineffable3000,Isaac @ Programming,Joe,Joe(symbol),JohnStalcup,Jose,Kee,Keih,Mark Byers,Matt,Notch,PrestonP,RyanL,SIS,Sam,Sasha Slutsker,Spug,Stu Coates,TENDON,Tom,Undermined,Yoshiori,aaaaa,abatkin,abc,baxter,bchic869,bleis,breadbox,breadbox is a gay faggot,btcqg,bungee,cep,champkind,coke,craigus,csjunker,dEp,daira,degei,ds,eeb,elb,elb_cheat,enk,fs,fuddy,fune,georgia,geronimo,hoge,javara,jj,joe,joeBob,kemco,kenz,kibi,kik,kinaba,kra,krokofant,kt3k,kurimura,kweg,leatherboundbooks,letter,letter(embed),mark,masa,megun,mn,moe,moe2,mskzzz,mskzzzz,murky-satyr,n8theGr8,nack,namamekashi-banchou,nattow,nayamashi-banchou,nazo,nielsc,niwa-tori,notogawa,notogawa(cheat),okamotok,orrc,ozy4dm,perisy,phoenix,planete2303,pw,rawwell,richmahogany,roki,s0upa,sasaking,scottg,shiena,shinh,shr3kst3r,siokoshou,ste_mcleod,sug,swac,t_issie,tabasa,takashima,test,tnk,toshi,tyrn,usa,usaoya,warriorness,wow,yhara,yooskeh,you said you wouldn't kiss&amp;tell!,yuhei,zcrar70,zen,znz
JavaScript: ,51b,7gyou,AtoMa,Dashiva,FalconNL,JohnStalcup,Mark Byers,Milly,Patrick,RiSK,YAA,YungSang,boring,dsl,eban,eil,emaland,hirose,hogehoge,junathecca,kaki,kemco,kinaba,kt3k,kweg,letter,mi,motemen,mskzzzz,murky-satyr,murky-satyr (cheese),murky-satyr (emb),nanto_vi,nanto_vi (cheat),nanto_vi(cheat),nattow,nawa,nazo,nuko,ofk,ozy4dm,pooq,shinh,t4652f85e,tabasa,wow,xyzzy,yowa,znz
Lazy-K: 51b,eban,hirose,irori,kt3k,niha,shinh,tabasa,yowa
Lua: ,Nexuapex,RiSK,Spencer Schumann,SpencerSchumann,blueblimp,breadbox,c031,eban,hammm,konn,kt3k,letter,letter(embed),mike,mskzzz,mskzzzz,nazo,planque,planque(cheat),planque(embed),rickrickrick,rickrickrick(no-load-file),roflcopter,tabasa,tokiwa,usa,yhara,yowa,znz
Mind: RiSK,eban,kt3k,maa,mskzzzz,poop,pooq,shinh,tabasa,yuizumi
Minus: 51b,Mark Byers,breadbox,flagitious,flagitious(embed),hirose,kt3k,mskzzzz,shinh,tabasa,yowa,yowa(c)
OCaml: ,Adam Blinkinsop,Robert,SugarSun,airobo,airobo(noexec),blueblimp,bungee,elb,flagitious,hat,hrkw,jijixi,jijixi(noexec),kinaba,kizz,kozima,ksk,ksk (MD),ksk(Num),ksk(bin),ksk(cheat),ksk(embed),ksk(noexec),kt3k,kuwashima,letter,m.ukai,m.ukai(Num),m.ukai(embed),m.ukai(exec),m.ukai(noexec),moriA,mskzzzz,nazo,phoenix,pooq,s,samvid,shinh,smly,soutaro,sshi,suiginto,suiginto(bin),suiginto(embed),suiginto(embed)	,tabasa,tapooh,unnonouno,xhl,ysn,ysn(noexec)
ObjC: Anon,Frane,blueblimp,emaland,jijixi,kt3k,mskzzzz,nazo,pooq,tabasa,usa,yhara
PHP: ,#suidroot,(given integer &lt; 111) [1..100]&gt;&gt;=pen,.[1..100]&gt;&gt;=pen,18kb,Andrew,Eddie,Eduardo,Emanuel,EmoJimbo,EricSmith,FalconNL,FlatLine,GotMex?,HotRod,HzFalcon,HzFalcon(symbol),Inoue,JohnStalcup,Jose,Justin,K_TAKAGI,Kevin Francis,Kevin G Francis,Kim...,LatinoHeat,LatinoThunder,Loadx,Mark Byers,Marz,Mearn,Mighty,Mike Alexander,Mike Alexander2,Milly,Newave Designs,Paul,Paul Wilkins,PeePeeFace,RiSK,RichieC,Robert,Sasha Slutsker,Sean,SeeN,Simon Lim,SirFartsAlot,Slick,Stupid1,T,T-bag,TENDON,TrueJournals,VatoLoco,Vraylle,WillieGollino,YungSang,ZARU,Zach,Zack,[1..100]&gt;&gt;=pen,a,abobo,acp,adachi,afarmer,ajkirwin,akkun_choi,alex,altair,anonymous,apalan,apo,ar,ar(cheat),ast,beton,blaat,blaat2,blaat3,bluejean,bluejean(symbol),bluejean(symbol_),bumbumface,charly,chatii,chucker,codetester,con,daira,daze,deanWombourne,decama,demonicus,devidos,doraenator,eban,eil,elb,emaland,enSige,ensige,entragian,eviljim,fal,flagitious,forte,ha1t,hamori,hamori縲€,hh,hi-poko,hilde,hisapoko,hogera,hohe(given integer &lt; 111) [1..100]&gt;&gt;=pen,honestnaoko,hs,iatz,ideo,igooo,imoto,intangible,iphoting,itochin,j4,jazzanova,jln,juno,kaska,kiba@kei-3,kinaba,konbu,koyuki,ksk,kt3k,l-tama,letter,mastercheap,mechaong,megun,mikechml,mitsu-,mogesura,momo,msk,mskzzz,mskzzzz,nazo,neko,nic,noah,nob,nuko,nullpo,ozy4dm,patches,persilian,php is for fools,pistoriusp,poopdawg,pop,pw,r28,rawwell,razor.crusade,rgb_yoshijima,rpatel10,shadow,shimooka,shinh,shinh (C C++ Ruby Python PHP Perl),shinh (C C++ Ruby Python PHP),siru,skyrc,smeghead,soushi,submatt,sunsuron,t_issie,tabasa,tanakh,tazyamah,te,test 1,testmn,thefizzbuzzthug,thetrve,tyoro,umasika,unau,usa,w,wow,xebu,xroric,yae,yoshijima,yowa,yuki,yzx,yzx(cheat),yzx(exec),znz,zybler,竊薙≠縺サ縺・
Pascal: 1-2-3,666,7gyou,Gaby,Herbert Sitz,breadbox,foo,hirose,hsitz,ksk,kt3k,mskzzzz,nazo,ozy4dm,planque,rawwell,sample implementation,scottg,sigle,tabasa,tokiwa,uru,usa,yhara,yt,yt(cheat)
Pefunge: Mark Byers,flagitious,hirose,kik,kt3k,shinh,tabasa
Perl: ,324324,Aglet,Bhaskar,CD,Ciaran,Eric Elinow,Eric Elinow2,Fotios,Hテ・kan,Io_fan,Leonardo Herrera,Mark Byers,Milly,Mithran,RayQ,RiSK,Robert,Sarav,Sarav(not my code),Skrud,SocialSecurity,Spencer Schumann,TAKESAKO,Tadman,TakashiYamaoka,Terje K,YAA,Yagi,ace,alp,another,ar,blazar,brad,bran,breadbox,dacci,dankogai,dankogai (cheat?),davidad,deq,dinomite,drmz,eban,eban(cheat),emaland,entragian,erics84,fkm,flagitious,foo,fotios,fujiwara,gamehaus,gomis,haru,hassy,hassylin,havana,hiroaki,hirose,hotaru,hs,initself,intangible1,intangible2,intangible_not_cheat,jg,jimr,jls,junathecca,k12u,kf,kinaba,kohei,komondorok,konbu,kounoike,kozima,ksk,kt3k,letter,m.ukai,maa,mauke,melonhead,mho,momo,moriA,morimasa,morita,moritan,mskzzz,mskzzzz,mwb,nazo,negi,neocat,nh33,niha,nnn,nohat,noname,nonstrict,nuko,nullpo,odz,op,osa,ott,ott(cheat),ott(embed),ott(nocheat),ott(noembed),ozy4dm,paperhat,pascal,ph,ph2,pp,prakash,sa,sabupot,safii,saitoma,scottg,shinh,shinh (C C++ Ruby Python PHP Perl),shinh (sym),shinh(symbol),shmem,sma,sma1,sugarfree,sunsuron,t4652f85e,t_issie,tabasa,tacky,teengenerate,tete,theducks,ti,tripa,ttt,tybalt89,umasika,unau,usa,uu,whitebell,wow,xhl,ySas,ySas (cheat),ySas(embed),ySas(inspired by kinaba),yoortje,yuki,yuki_neko_nyan,yzx,zetamatta,znz,・儡as
Perl6: dankogai,kt3k,kt3k(alt),kt3k(read file),kt3k_,mskzzzz,ott,ott(embed),ozy4dm,shinh,tabasa,wow
Postscript: &lt;&lt;/The{}/answer 42/anser 42/to{}/life?{=}/universe?{=}/everything?{=}&gt;&gt;begin{(%stdin)(r)file token not{exit}if exec}loop,Mark Byers,Mark Byers (no binary),Troy Howard,konbu,kt3k,makoto-k,makoto-k(symbol),moriA,mskzzzz,shinh,tabasa,ySas,ySas (embed),ySas (not bin),ySas(bin),ySas(embed),ySas(not bin),ySas;,ySa・・yshl,yshl (alnum),yshl((%stdin) (r) file read {2 idiv =} if quit),yshl(C, PostScript(bin)),yshl(C, PostScript),yshl(a few bin),yshl(alnum),yshl(bin),yshl(bin)(cheat),yshl(bin)(embed),yshl(bin)(perl shinh 1174511406),yshl(cheat),yshl(compress),yshl(embed),yshl(embed)(bin),yshl(no bin),yshl(not bin),yshl(perl shinh 1174511406),yshl(polyglot C and PostScript(bin)),yshl(polyglot C and PostScript)
Prolog: ,Mikevil,Robert,breadbox,elb,elb(bin),hirose,kazuki,kt3k,mskzzzz,nazo,okina,pooq,sakai,shinh,tabasa,tanzaku,yooskeh,リァル・・・ァル・
Python: ,Adam Blinkinsop,AdamG,Aglet,Alexs,Amadeo Bellotti,Arafangion,Berengal,BioGeek,Dashiva,Defenestrator,Defenestrator (cheat),Ephphatha,Frane,HzFalcon,Jacob Rus,Jay,Jean-Louis,JohnStalcup,JonAllie,KUN,Ksero and #python,Lanzaa.,Mark Byers,Mark Byers (no binary),Michael,Milly,Patrick,RiSK,Richard Loveland,Robert,Ropo,Sasa,Sasa Petrovic,Sasa Petrovic2,Sasa Petrovic3,Sean,SeeNoEvil,SeeNoEvil (haha),SeeNoEvil(embed),Simple Solution,Stupid1,Thomas Geeee Willis,TsXc,U1A,__nb__,ac,accurrent,adbachman_01,adbachman_02,adbachman_03,ap,blueblimp,boo,chobo,darked,dinomite,doo,dplusplus,drigz,eban,ek,elb,elb(no compression),emaland,flagitious,flagitious and Mark Byers,flatline,fredrik,fuji,gee,go,hiro.suzuki,hiro.suzuki (zip),hiro.suzuki縲€,hiro.suzuki縲€(no load file),hirose,hirose(sym),houeland,itsme,jijixi,jj,jk,junya,kamezou,kashifkhan,ksk,kt3k,kt3k(...,kt3k(another,kt3k(no bin),kt3k(sym),letter,lifthrasiir,lifthrasiir (no cheat),lyx,mft,mho,mkszzz,morchin,moriA,mozi codo,mskzzz,mskzzzz,musicinmybrain,nack,nazo,neger,neger2,neger3,neger5,neger6,neger7,neger8,nob,nobody,notme,notogawa,octech,oqre,ozy4dm,pbx,pp,primo,py2,qebab,qebaba,quietgolfer,rawwell,ryo,sakaki,sdfsd,sdkay,shaurz,shbird,sheerbird,shimizu,shinh,shinh (C C++ Ruby Python PHP Perl),shinh (C C++ Ruby Python PHP),siru,skrzynka,stesch,strank,superneger1,superneger7,superneger8,tabasa,tahai,tenkoma,test,thor,tokiwa,tyr,usa,wer,wow,zak,zakj,zeek,zetamatta,znz
Ruby: ,	flagitious(oops other solution is embed, but this one uses mathn :),666,AtoMa,Brian Adkins,Brian with Ben,Charles,Chuck Vose,Ciaran,Daniel Butler,DarkDust,Duane Bailey,Florian,GOROman,George Bush,GooGoo+.,Grant Hutchins,Habitue,Hector Vergara,Hexa,Hyperair,JaeSharp,JohnDough,KEN3,Kihara,Mark Byers,Mark Byers (symbol),Mark Byers 2 (symbol),Matthew,Milly,Myrd,Phill Kenoyer,RiSK,Robert,Rozza,Scott,Servo,Slartibartfast,Sohum,Spug,SuperFrankie,Takagi,Tay,Tomy,YAA,_,_N,_N(rand),___,a,ab,ageldama,akausagi,altair,ammmm,apeiros,ar,arikui,as,atheye,b2ox,bascule,bert,brad,brik,chucker,comp.lang.ruby,crazyjimbo,dai,dan,dan5,diddle,drunk guy from ohio,dux,dw,eban,eban(cheat),eban(noexec),eban(regexp),eban(require),eban(sym),eil,elb,ema,fkm,flagitious,flagitious(alnum),flagitious(alt),flagitious(embed),flagitious(mathn),flagitious(oops alnum),flagitious(oops other solution is embed, but this one uses mathn :),flagitious(req),flagitious(semi embed),flagitious(sym 4),flagitious(sym),flagitious(unembeded),flagitious(zlib),fmonkey,foo,fsystem,fuji,fuu,g5n,geir,geir_again,german,gomis,greenpenguin,gtheoret,ha-tan,hermi,hi,hirose,hirose(sym),hrkw,irori,irori(alt),irori(mathn),isrc,iwadon,j,javara,jj,jj-jrun,jrun,jrun1,junathecca,juno,kaki,kanagawa,kep,kermi,kik,killy971,kinaba,knu,kodera,konn,konn (embed &amp; not algorithmic),krokofant,ksk,ksk (mathn),ksk (sym),ksk(cheat),ksk(sym),ksk(sym+3B),kstn,kt3k,kt3k(sym),kt3k(sym_),kurimura,ky,lazymage,leonid,leonid (alnum),leonid (sym),leonid (sym) 2,leonid (symbol),leonid(sym),leonid(sym)2,letter,lifthrasiir,lokiju,m.ukai,ma,maki,mamamoto,masadoi,mather,megun,mgoss,minke,moriB,mskzzz,mskzzzz,murky-satyr,nakahira,naruse,nattow,nawa,nazo,neko,niha,niha(majime),niha(mathn),niha(zurui!),niwa-tori,nmk,notmatt,nozuru,nullpo,octech,ombra,oto-oto-oto,oto-oto-oto(),oza,ozy4dm,ozy4dm(inchiki),pnomolos,pooq,poqute,primo,probablycorey,puzzles,qwejkl,r,raspberry lemon,rawwell,rickrickrick,roflcopter,s,satoru,shinak,shinh,shinh (C C++ Ruby Python PHP Perl),shinh (C C++ Ruby Python PHP),shinh (mathn),shinh(alpha),shinh(cheatless),shinh(embed),shinh(other),shinh(sym),shinh(symbol),shrapnel,shuyo,siru,sourcek,spelunker,sshi,sumim,t_issie,tabasa,tad,takaaki,takase,takatoh,tamubun,tapasa,tar0_t,te,tell,test,th,tocken,tokiwa,tpope,tsukkee,ttsy,tututu,tyos,umasika,unno,usa,usa(alnum),usa(cheat),usa(embed),usa(mathn),usa(rehabilitation),usa(symbol),usa(t0),wara,wedge,wookay,wow,xfy,ySas,yasuhito,yhara,youchan,yowa,yowa(e),yowa(no pack),yunyun,yvl,znz,zraii
Scheme: ,EthanB,JonPhilpott,Milly,O,RiSK,Robert,_,astecp,blue,fkm,foo,gnome,guybrush,haya,hirofummy,hirofummy(embed),hirofummy/exec,hirose,juli,kazuya_a,kkishi,konbu,konn,kozima,kt3k,kuwashima,kyle,letter,m,ma,ma(embed),ma(no_cheat),ma(this_problem_sucks),maeda,masa.edw,motemen,mskzzz,mskzzzz,nazo,pla,pla(no exec),pla_cheat,pooq,ranekov,scm,shinh,sn,sshi,tabasa,tanakh,tanzaku,theoria,thori,tokiwa,troter,unno,wow,yhara,yuichi,yuki_neko_nyan,znz
Smalltalk: hirose,jijixi,kt3k,mskzzz,mskzzzz,murky-satyr,nazo,poop,pooq,ralf,shinh,sumim,tabasa,usa
Tcl: RiSK,Sean,Zigs,breadbox,eban,ether,kt3k,mskzzz,mskzzzz,nazo,tabasa,tensaix2j,test,unau,usa,user,usk,ysk
Unlambda: Mark Byers,_,hayamizu,hirose,irori,irori(symbol),konn,kozima,kt3k,kurimura,m,mskzzzz,shinh,tabasa,yowa
VHDL: boon,educa,hirose,kt3k,mayarero,mskzzzz,natsutan,shinh,ta_bo__,tabasa,tori,yt
Whirl: 51b,atheye,hirose,kt3k,shinh,tabasa,yowa,yowa(o)
Whitespace: ,Kee,Mark Byers,breadbox,flagitious,hirose,kt3k,mskzzzz,phoenix,pla,shinh,shinh(tetraglot),shinh__,tabasa,tokiwa,toshi,yowa
Xtal: eban,kt3k,murky-satyr,nazo,ozy4dm,pooq,shinh,tabasa
gas: 7gyou,CD,breadbox,eban,kik,kt3k,kurimura,lifthrasiir,mskzzz,mskzzzz,nazo,shinh,tabasa,wow
m4: &lt;a href=&quot;#m4&quot;&gt;m4&lt;/a&gt;,51b,breadbox,eban,kt3k,lifthrasiir,mskzzzz,shinh,tabasa,yamaya
sed: 51b,Ciaran,Mark Byers,_N,breadbox,drigz,eban,eban(cheat),eban(embed),eban(exec),eban-,emoken,emoken(embed),goto,hirose,hrkw,irori,jg,kerebron,kt3k,m,moe,momo,moriA,morimasa,mskzzz,mskzzzz,ott,s0upa,shinh,tabasa,taka,usa,yamaya,ysn,yuizumi,znz
x86: 51b,breadbox,kt3k,maki,mskzzzz,nazo,shinh,shinh(tetraglot),tabasa,viznut
xgawk: 51b,Mark Byers,Robert,breadbox,eban,emoken,hi_saito,ksk,kt3k,mskzzzz,shinh,tabasa,usa,yamaya



# golfusr-langlist.rb
# ver.'071203

log=[]
person={}
name ="nn"
lng=""
lngs={}
10000.times{|n|
    break if !FileTest.exist?( name+(n+1).to_s+".htm" ) 
    # print n,","
    open(name+(n+1).to_s+".htm"){|w|
      w.each{|line|
        # change the language name
        /name="(.*)"\>/ =~ line
        if $1
          lng=$1 
          /(problem)/ =~ lng
          lngs[lng]=[] if lngs[lng]==nil && !$1
        end
        /\<\/td\>\<td\>(\<[^\>]*\>)?([^<]*)/ =~ line
        persontmp=$2
        log << $2 if $2 && $2!=""
        tmp=person[$2]
        tmp =[] if tmp==nil
        person[$2]=tmp+[lng]
        /(value=)/ =~ lng
        # puts persontmp+"!"+lng if lng && persontmp
        lngs[lng]+=[persontmp] if lng && persontmp
        /(Language Ranking)/ =~ line
        break if $1
      }
    }
}
log.sort!
person.each{|a,b|
 b.sort!
}

ha={}
b=""
now=""
cou=0
log.each{|i|
 if b!=i 
  ha[now]=cou
  now=i
  cou=1
  b=i
 else
  cou +=1
 end
}

ha[now]=cou if cou>0
cou=1
print "n: id, entry :(num) lang\n"
print "-"*25,"\n"

he=ha.sort{|a,b|b[1].to_i<=>a[1].to_i}#<=>b.to_i
he.each{|a,b|
 print cou,":",a,",",b," :(",person[a].uniq.length,")"
 print person[a]*",","\n";cou+=1}
print "-"*25,"\n"

he=ha.sort{|a,b|b[0]<=>a[0]}
he.each{|a,b|print a,",",b,"\n"}
print "-"*25,"\n"

lngs.sort.each{|l,p| puts l+": "+p.sort.uniq*"," if p.length>0}

トラックバック - http://rubyist.g.hatena.ne.jp/hatecha/20071202
カレンダー
<< 2007/12 >>
1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31
archive Error : RSSが取得できませんでした。