Mercurial > hgrepos > hgweb.cgi > jk
changeset 0:316a45277858 draft
init
author | HIROSE Yuuji <yuuji@e.koeki-u.ac.jp> |
---|---|
date | Tue, 17 Nov 2009 12:34:29 +0900 |
parents | |
children | 4b6330451865 |
files | .htaccess index.html myproj.rb |
diffstat | 3 files changed, 30 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.htaccess Tue Nov 17 12:34:29 2009 +0900 @@ -0,0 +1,1 @@ +AddType "text/plain; charset=EUC-JP" .html
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/index.html Tue Nov 17 12:34:29 2009 +0900 @@ -0,0 +1,11 @@ +<html> +<head> +<title>My Project!</title> +</head> + +<body> +<h1>マイプロジェクト</h1> +<p>chmod +x したら ./myproj.rb で起動してね。</p> + +</body> +</html>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/myproj.rb Tue Nov 17 12:34:29 2009 +0900 @@ -0,0 +1,18 @@ +#!/usr/bin/env ruby +srand +judge = 0 +hand = %w,グー チョキ パー, +while judge == 0 + print "グーは1、チョキは2、パーは3、どれ? :" + human = gets.to_i-1 + com = rand(3) + printf("ぽんっ キミ %s : %s わし\n", hand[human], hand[com]) + judge = (3+human-com) % 3 + if judge == 2 + puts "キミの勝ちだ、めで" + elsif judge == 1 + puts "キミの負けだ、けけ" + else + puts "あいこでしょっ" + end +end