Hello all. I am remaking the old video game called 'Zork'. I will be using ruby for this. You can download Ruby here: http://www.ruby-lang.org/en/downloads/. I would like your help on this. You don't need to have played Zork before to do this, but it would be best if you googled Zork. Thank you in advance.
Create a file called ZorkProgress and make it a .txt file.
What we have done so far:
#!/usr/bin/env ruby
#intro
puts "Welcome to Zork"
#puts "What version of zork would you like?"
#TypeOfZork = get.chomp
#if TypeOfZork ==
progress = ""
in_file = open("ZorkProgress.txt", "r")
in_file.each do |line|
progress = line
end
in_file.close
if progress == "htkf" || progress == ""
puts "What is your name?"
name = gets.chomp
puts "Okay, so, your name is #{name.capitalize}."
puts "You appear in front of a large tower. There is a sign saying it is the 'Tower of Magic'"
puts "Options: 'enter'"
x = gets.chomp
if x == "enter"
puts "You enter the building"
#choosing a tutor
puts "Two men appear. One has a staff and is bald. The other has a black goatee and black hair."
puts "Options: 'bald wizard' or 'goatee wizard'"
x = gets.chomp
if x == "bald wizard"
TypeOfMagic = "light"
Tutor = "Gunnar"
puts "The bald wizard use his staff to make you teleport away."
#choosing a kind of staff
puts "You appear in a wooded area. The wizard tells you to find a tree."
puts "Options: 'willow', 'maple', or 'oak'"
staffType = gets.chomp
puts "You choose a #{staffType} staff."
else
if x == "goatee wizard"
TypeOfMagic = "dark"
Tutor = "Krolax"
puts "The wizard with the goatee teleports you away with just his hands."
else
puts "You typed something that wasn't an answer!"
TypeOfMagic = "Fail"
end
end
else
puts "You typed something that wasn't an answer!"
TypeOfMagic = "Fail"
end
#end intro
#begin tutoring
else
if progress == "goob" || progress == "rodd"
if progress == "goob"
TypeOfMagic = "light"
end
if progress == "rodd"
TypeOfMagic = "dark"
end
if progress == "goob" || progress == "rodd"
if TypeOfMagic == "light"
#light tutoring
puts "You appear in a room that looks like it's on a cloud"
puts "Hello. My name is Gunnar."
puts "My job is to teach you #{TypeOfMagic} magic."
puts "The mysterious thing about the light is that it is everywhere. The dark are afraid of it. Unless their knowledge in magic is stronger. What would you like to learn first?"
puts "Options: 'force' or 'spells'?"
firstlesson = gets.chomp
if firstlesson != "force" || firstlesson != "spells"
if firstlesson == "force"
puts "You have chosen #{firstlesson}"
else
if firstlesson == "spells"
puts "You have chosen #{firstlesson}."
puts "Spells contain of one word"
puts "such as 'Beloga'"
puts "Suddenly fire appeared."
puts "In battle these words will help."
puts "Now you are ready for a lesson of the force."
end
end
else
puts "I did not understand that."
end
else
if TypeOfMagic == "dark"
#dark tutoring
puts "You appear in a room with stones on all sides."
puts "Hello. My name is Krolax."
puts "My job is to teach you #{TypeOfMagic} magic."
puts "#{Tutor} summons an imp."
inventory = []
inventory.push "Imp"
puts inventory
puts "#{Tutor} said 'Listen to the imp. You will be able to "
#some stuff about learning dark magic
end
end
end
end
end
#You exit the tower.
#Adventure stuff
#During this time you meet your tutor some more and learn new stuff.
#That's it so far.NOTE: Mods, if this should be somewhere else, please move it. Thank you.
Last edited by gbear605 (2010-12-14 16:11:25)
Offline
Since this isn't related to Scratch... it would probably go on some other forum that is dedicated to Zork, Ruby, or Programming Languages in general.
Offline
Magnie wrote:
Since this isn't related to Scratch... it would probably go on some other forum that is dedicated to Zork, Ruby, or Programming Languages in general.
Well, since I want other people's help... This is for the mods to decide.
Offline
I could help, but i don't know ruby!
Offline
ProgrammingFreak wrote:
I could help, but i don't know ruby!
I don't know that much. That website that I linked to has some links to good tutorials.
EDIT: One is here http://pine.fm/LearnToProgram/?Chapter=00
Last edited by gbear605 (2010-12-06 17:19:19)
Offline
bump
Offline
I would like to help redo Zork but why would we use ruby? Why not C# or Visual Basic
Offline
Soaringscorer wrote:
I would like to help redo Zork but why would we use ruby? Why not C# or Visual Basic
Because I know Ruby and not C# or Visual Basic, plus, I don't think Visual Basic works on macs(and I only have Macs)(i might be wrong)
Offline
Soaringscorer wrote:
I would like to help redo Zork but why would we use ruby? Why not C# or Visual Basic
I might be changing it to C++ though, I know some C++.
Offline
Magnie wrote:
Since this isn't related to Scratch... it would probably go on some other forum that is dedicated to Zork, Ruby, or Programming Languages in general.
Let's try moving this to Miscellaneous. It seems better placed there since the topic is not directly related to Scratch.

Offline
Are we still gonna do this in ruby?
Offline
Ruby for now.
Offline
Ok, I'm going to add comments saying a general idea of what's happening in that spot, then upload. Then you can work on it based on what I said. Then you would upload. And so on.
Offline
k! I am so energized. Zork is pretty cool. And all we really need to use is puts, gets, and variables
Offline
new here: here
Offline
ProgrammingFreak wrote:
k! I am so energized. Zork is pretty cool. And all we really need to use is puts, gets, and variables
And some other stuff, but mostly that, I mean stuff like 'if'.
Offline
how do I do a ruby file? I know ruby, the language. And I downloaded it
Offline
ProgrammingFreak wrote:
how do I do a ruby file? I know ruby, the language. And I downloaded it
Try double clicking on it, what OS do you have.
Offline
I have WindowsXP. How do you even run a ruby file? I'll start working on the code. I can at least do that
Offline
ProgrammingFreak wrote:
I have WindowsXP. How do you even run a ruby file? I'll start working on the code. I can at least do that
Type in ruby zork.rb into command prompt (the application)
Offline
into cmd of windows or like ruby.exe? (exe is the extension for Windows)
Offline
cmd of windows.
Offline
this is what it says:
'ruby' is not recognized as an internal or external command,
operable program or batch file.
Offline
type in ruby zork.exe
if that doesn't work type zork.exe
if that doesn't work type zork.rb
if that doesn't work, google it.
Offline