diff --git a/asobi/memomo.rb b/asobi/memomo.rb index 5e259c7..d85db4f 100755 --- a/asobi/memomo.rb +++ b/asobi/memomo.rb @@ -1,8 +1,9 @@ #!/usr/bin/env ruby # -*- coding: utf-8 -*- -Encoding.default_external = 'utf-8' + require 'csv' -CSV=open("iroiro.csv","w+")do|tango| +CSV.open("tango.csv","w+")do|tango| + tango<<["yougo"] tango<<["chomp"] tango<<["case"] tango<<["def"] diff --git a/asobi/tango.csv b/asobi/tango.csv index 02b6b33..4f403e3 100644 --- a/asobi/tango.csv +++ b/asobi/tango.csv @@ -1,3 +1,3 @@ -["chomp"],["case"],["def"],["elsif"],["else"],["end"],["gets"], -["if"],["ls"],["\n"],["print"],["puts"],["printf"],["ruby"], -["rand"],["sleep"],["to_i"],["to_f"],["while"],["when"] +プログラミング,英語 +chomp. case. def. elsif. else. end. gets. if. ls. \n. print. puts. printf. ruby +.rand. sleep. to_i. to_f. while. when,agitato. animato. brilant. con brio. ca diff --git a/asobi/tanngotyou.rb b/asobi/tanngotyou.rb index 325f946..51ad756 100755 --- a/asobi/tanngotyou.rb +++ b/asobi/tanngotyou.rb @@ -1,15 +1,14 @@ #!/usr/bin/env ruby # -*- coding: utf-8 -*- -Encoding.default_external = 'utf-8' + require 'csv' puts"これは単語帳だよ" data=CSV.read("tango.csv",headers:true) puts"プログラミング単語帳" - data.each{|row| - printf(" %s\n",row["print"]) + printf("プログラムで使う単語は、%s\n",row["プログラミング"])} puts"-------------------------------------------------------- -"} +" print"終わり\n" diff --git a/iroiro.csv b/iroiro.csv new file mode 100644 index 0000000..fe50266 --- /dev/null +++ b/iroiro.csv @@ -0,0 +1 @@ +["yougo"]["chomp"]["case"]["def"]["elsif"]["else"]["end"]["gets"]["if"]["ls"]["\n"]["print"]["puts"]["printf"]["ruby"]["rand"]["sleep"]["to_i"]["to_f"]["while"]["when"] \ No newline at end of file