This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Player | |
def play_turn(warrior) | |
# cool code goes here | |
if @health.nil? then | |
@health = warrior.health | |
end | |
if @health > warrior.health then | |
if warrior.feel.empty? then | |
warrior.walk! | |
elsif warrior.feel.enemy? then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Player | |
def play_turn(warrior) | |
# cool code goes here | |
if @health.nil? then | |
@health = warrior.health | |
end | |
if @health > warrior.health then | |
if warrior.feel.empty? then | |
warrior.walk! | |
else |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Player | |
def play_turn(warrior) | |
# cool code goes here | |
if warrior.feel.empty? then | |
if warrior.health < 20 then | |
warrior.rest! | |
else | |
warrior.walk! | |
end | |
else |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Player | |
def play_turn(warrior) | |
# cool code goes here | |
if warrior.feel.empty? then | |
warrior.walk! | |
else | |
warrior.attack! | |
end | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Player | |
def play_turn(warrior) | |
# cool code goes here | |
warrior.walk! | |
end | |
end | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# encoding: utf-8 | |
HARA = 8 | |
HAPPY = 8 | |
COUNT = 7 * 4 | |
DAY_STAT = ['朝','昼','晩','夜中'] | |
CMD = ['食事','掃除','散歩','睡眠'] | |
day = 0 | |
petnum = 1 | |
game = 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding:utf-8 | |
te = ["","グー","チョキ","パー"] | |
report = [""] | |
3.times do |i| | |
# my_te = gets.to_i | |
my_te = rand(3)+1 | |
pc_te = rand(3)+1 | |
puts "人間の手は「#{te[my_te]}」、コンピュータの手は「#{te[pc_te]}」" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ul> | |
<li><a href="http://rina0309.hatenablog.com/" target="_blank">りなのキラキラ☆ブログ</a></li> | |
<li><a href="http://cat.hatenadiary.jp/" target="_blank">(「・ω・)「ニャオー</a></li> | |
<li><a href="http://junjunmbb.hatenablog.com/" target="_blank">楽~んブログ</a></li> | |
<li><a href="http://sunnyswedding.ti-da.net/" target="_blank">サニーズウェディング</a></li> | |
<li><a href="http://repserc.hotcom-web.com/wordpress/" target="_blank">上階の住人はよく物を落とす。</a></li> | |
<li><a href="http://ochan.lolipop.jp/" target="_blank">沖縄 マインドブロックバスター琉球校大田裕(おーちゃん)</a></li> | |
<li><a href="http://meiying.jp/" target="_blank">沖縄中国語教室</a></li> | |
<li><a href="http://ryu9life.com/" target="_blank">沖縄に移住しホームページ制作で頑張る!毎日「沖縄移住生活/琉球ライフ」</a></li> | |
</ul> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding:utf-8 | |
num = 0 | |
sum = 0 | |
max = 0 | |
print "整数を入力してください:" | |
max = gets.to_i | |
while num < max | |
num += 1 | |
sum += num | |
end |
NewerOlder