
gnuWorldOrder_435
About this episode
The RCS revision control system and Ruby. Here is the code from this episode:
#!/usr/bin/env ruby
class Character
def initialize(name,role,lvl)
hp = rand(8)+1
@spells = ["cantrip", "chill touch", "detect undead"]
puts("You are #{name}, a level #{lvl} #{role}")
end #init
def listspells()
puts("#{@spells}")
end #list
def spellcast(n)
puts("You cast #{@spells[n]}")
dice = rand(20) + 1
if dice < 10 then
puts("Your spell pops and fizzles. Nothing happens.")
else
puts("Your spell does #{dice} damage.")
end #if
end #spellcast
end #class
if __FILE__ == $0 then
pc = Character.new("Bob","Wizard",1)
pc.listspells()
pc.spellcast(1)
pc.spellcast(0)
end
shasum -a256=a74e1f1ab22923b03397be10d9fe44afdf33faca034c321ea3b658061199396f
More from GNU World Order Linux Cast
nethack from the y software set of Slackware Linux. Also, this is the final episode of the show. Thanks for a decade of support and friendship. shasum -a256=651b53e545c6a2992a5eaa8a306058dba6f5f826ac9…
strfile , fortune , adventure , arithmetic , atc , backgammon and teachgammon , banner , battlestar , bcd and morse and ppt , caesar and rot13 , canfield , countmail , cribbage , dab , factor , gofish…
thunar , thunar-volman , tumbler , xfce4-appfinder , xfce4-clipman-plugin , xfce4-dev-tools , xfce4-notifyd , xfce4-panel , xfce4-panel-profiles , xfce4-power-manager , xfce4-pulseaudio-plugin , xfce4…
xlockmore , xmms , xpaint , xpdf , xsane , xscreensaver , xsnow , Greybird , elementary-xfce , exo , garcon , libxfce4ui , libxfce4util , mousepad software set of Slackware Linux. shasum -a256=d528910…
seamonkey , seyon , ssr , vim-gvim , windowmaker , x11-ssh-askpass , x3270 , xaos , xgames , xine-lib , xine-ui from the xap software set of Slackware Linux. shasum -a256=93c563d8660d95141f9c811068ae4…