summaryrefslogtreecommitdiff
path: root/sample
diff options
context:
space:
mode:
Diffstat (limited to 'sample')
-rw-r--r--sample/drb/README.rd.ja48
-rw-r--r--sample/drb/dhasenc.rb6
-rw-r--r--sample/mine.rb40
3 files changed, 47 insertions, 47 deletions
diff --git a/sample/drb/README.rd.ja b/sample/drb/README.rd.ja
index 04143b9ad5..ec78dc70dd 100644
--- a/sample/drb/README.rd.ja
+++ b/sample/drb/README.rd.ja
@@ -1,59 +1,59 @@
-= サンプルスクリプト
+= 泣潟鴻
-* Arrayをリモートから利用してイテレータを試す。
+* Array≪若ゃ若帥荅
* darray.rb --- server
* darrayc.rb --- client
-* 簡易チャット
+* 膂≧c
* dchats.rb --- server
* dchatc.rb --- client
-* 分散chasen
+* chasen
* dhasen.rb --- server
* dhasenc.rb --- client
-* 簡易ログサーバ
+* 膂≧違泣若
* dlogd.rb --- server
* dlogc.rb --- client
-* Queueサーバ。
- クライアントdqin.rbはQueueサーバの知らないオブジェクト(DQEntry)を
- pushするがDRbUnknownによりクライアントdqout.rbがpopできる。
+* Queue泣若
+ ゃ≪潟dqin.rbQueue泣若ャ吾с(DQEntry)
+ pushDRbUnknownゃ≪潟dqout.rbpopс
* dqueue.rb --- server
- * dqin.rb --- client。DQEntryオブジェクトをpushする
- * dqout.rb --- client。DQEntryオブジェクトをpopする
- * dqlib.rb --- DQEntryを定義したライブラリ
+ * dqin.rb --- clientDQEntry吾сpush
+ * dqout.rb --- clientDQEntry吾сpop
+ * dqlib.rb --- DQEntry絎臂ゃ
-* 名前による参照
- IdConvをカスタマイズしてidでなく名前で参照する例
+*
+ IdConv鴻帥ゃ冴idсус箴
* name.rb --- server
* namec.rb --- client
-* extservのサンプル
+* extserv泣潟
* extserv_test.rb
-* TimerIdConvの使用例
- * holders.rb --- server。ruby -d hodlers.rbとするとTimerIdConvを使用する。
+* TimerIdConv篏睡箴
+ * holders.rb --- serverruby -d hodlers.rbTimerIdConv篏睡
* holderc.rb --- client
-* rinda.rbの使用例
- * rinda_ts.rb --- TupleSpaceサーバ。
- * rindac.rb --- TupleSpaceのclientでアプリケーションのclient
- * rindas.rb --- TupleSpaceのclientでアプリケーションのserver
+* rinda.rb篏睡箴
+ * rinda_ts.rb --- TupleSpace泣若
+ * rindac.rb --- TupleSpaceclientс≪宴若激с潟client
+ * rindas.rb --- TupleSpaceclientс≪宴若激с潟server
-* observerの使用例
+* observer篏睡箴
cdbiff - ((<URI:http://namazu.org/~satoru/cdbiff/>))
* dbiff.rb --- dcdbiff server
* dcdbiff.rb --- dcdbiff client
-* drbsslの使用例
+* drbssl篏睡箴
* drbssl_s.rb
* drbssl_c.rb
-* DRbProtoclの追加例
+* DRbProtocl菴遵箴
* http0.rb
* http0serv.rb
-* ringの使用例
+* ring篏睡箴
* ring_place.rb
* ring_echo.rb
diff --git a/sample/drb/dhasenc.rb b/sample/drb/dhasenc.rb
index 44e58ce096..1c0c153b5b 100644
--- a/sample/drb/dhasenc.rb
+++ b/sample/drb/dhasenc.rb
@@ -1,4 +1,4 @@
-# -*- encoding: euc-jp -*-
+# -*- encoding: utf-8 -*-
=begin
distributed Ruby --- dRuby Sample Client -- chasen client
Copyright (c) 1999-2001 Masatoshi SEKI
@@ -10,5 +10,5 @@ there = ARGV.shift || raise("usage: #{$0} <server_uri>")
DRb.start_service
dhasen = DRbObject.new(nil, there)
-print dhasen.sparse("本日は、晴天なり。", "-F", '(%BB %m %M)\n', "-j")
-print dhasen.sparse("本日は、晴天なり。", "-F", '(%m %M)\n')
+print dhasen.sparse("ャ翫ぉ", "-F", '(%BB %m %M)\n', "-j")
+print dhasen.sparse("ャ翫ぉ", "-F", '(%m %M)\n')
diff --git a/sample/mine.rb b/sample/mine.rb
index 4ef006685e..a8711a25ab 100644
--- a/sample/mine.rb
+++ b/sample/mine.rb
@@ -1,5 +1,5 @@
-#! /usr/bin/ruby -Ke
-# -*- encoding: euc-jp -*-
+#! /usr/bin/ruby -Ku
+# -*- encoding: utf-8 -*-
class Board
def clr
@@ -13,19 +13,19 @@ class Board
end
def put(x, y, col, str)
pos(x,y); colorstr(43,str)
- pos(0,@hi); print "残り:",@mc,"/",@total," "
+ pos(0,@hi); print "罧:",@mc,"/",@total," "
pos(x,y)
end
private :clr, :pos, :colorstr, :put
- CHR=["・","1","2","3","4","5","6","7","8","★","●","@@"]
+ CHR=["","鐚","鐚","鐚","鐚","鐚","鐚","鐚","鐚","","","@@"]
COL=[46,43,45] # default,opened,over
def initialize(h,w,m)
- # ゲーム盤の生成(h:縦,w:横,m:爆弾の数)
+ # 蚊若ゃ(h:膰鐚w:罔鐚m:綣障)
@hi=h; @wi=w; @m=m
reset
end
def reset
- # ゲーム盤を(再)初期化する
+ # 蚊若ゃ()
srand()
@cx=0; @cy=0; @mc=@m
@over=false
@@ -47,7 +47,7 @@ class Board
pos(@cx,@cy)
end
def mark
- # 現在のカーソル位置にマークをつける
+ # 憜若純篏臀若ゃ
if @state[@wi*@cy+@cx] != nil then return end
@state[@wi*@cy+@cx] = "MARK"
@mc=@mc-1;
@@ -55,8 +55,8 @@ class Board
put(@cx, @cy, COL[1], CHR[9])
end
def open(x=@cx,y=@cy)
- # 現在のカーソル位置をオープンにする
- # 爆弾があればゲームオーバー
+ # 憜若純篏臀若潟
+ # 綣障違蚊若若
if @state[@wi*y+x] =="OPEN" then return 0 end
if @state[@wi*y+x] == nil then @total=@total-1 end
if @state[@wi*y+x] =="MARK" then @mc=@mc+1 end
@@ -76,7 +76,7 @@ class Board
pos(@cx,@cy)
end
def fetch(x,y)
- # (x,y)の位置の爆弾の数(0 or 1)を返す
+ # (x,y)篏臀綣障(0 or 1)菴
if x < 0 then 0
elsif x >= @wi then 0
elsif y < 0 then 0
@@ -86,13 +86,13 @@ class Board
end
end
def count(x,y)
- # (x,y)に隣接する爆弾の数を返す
+ # (x,y)f・綣障違菴
fetch(x-1,y-1)+fetch(x,y-1)+fetch(x+1,y-1)+
fetch(x-1,y) + fetch(x+1,y)+
fetch(x-1,y+1)+fetch(x,y+1)+fetch(x+1,y+1)
end
def over(win)
- # ゲームの終了
+ # 蚊若腟篋
quit
unless win
pos(@cx,@cy); print CHR[11]
@@ -103,8 +103,8 @@ class Board
end
end
def over?
- # ゲームの終了チェック
- # 終了処理も呼び出す
+ # 蚊若腟篋с
+ # 腟篋若喝冴
remain = (@mc+@total == 0)
if @over || remain
over(remain)
@@ -114,8 +114,8 @@ class Board
end
end
def quit
- # ゲームの中断(または終了)
- # 盤面を全て見せる
+ # 蚊若筝(障腟篋)
+ # ら≪荀
@hi.times do|y|
pos(0,y)
@wi.times do|x|
@@ -125,19 +125,19 @@ class Board
end
end
def down
- # カーソルを下に
+ # 若純筝
if @cy < @hi-1 then @cy=@cy+1; pos(@cx, @cy) end
end
def up
- # カーソルを上に
+ # 若純筝
if @cy > 0 then @cy=@cy-1; pos(@cx, @cy) end
end
def left
- # カーソルを左に
+ # 若純綏
if @cx > 0 then @cx=@cx-1; pos(@cx, @cy) end
end
def right
- # カーソルを右に
+ # 若純劻
if @cx < @wi-1 then @cx=@cx+1; pos(@cx, @cy) end
end
end