This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2010-12-05 10:01:18

gbear605
Scratcher
Registered: 2008-03-06
Posts: 1000+

Zork.rb (ruby)

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:

Code:

#!/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)


Yeah, I'm mostly inactive.  I check in once in a while though.  If you want to contact me, I have a contact form at my website, http://escratch.org

Offline

 

#2 2010-12-06 11:58:35

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: Zork.rb (ruby)

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

 

#3 2010-12-06 15:07:47

gbear605
Scratcher
Registered: 2008-03-06
Posts: 1000+

Re: Zork.rb (ruby)

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.


Yeah, I'm mostly inactive.  I check in once in a while though.  If you want to contact me, I have a contact form at my website, http://escratch.org

Offline

 

#4 2010-12-06 15:28:59

ProgrammingFreak
Scratcher
Registered: 2010-09-04
Posts: 1000+

Re: Zork.rb (ruby)

I could help, but i don't know ruby!

Offline

 

#5 2010-12-06 15:33:16

gbear605
Scratcher
Registered: 2008-03-06
Posts: 1000+

Re: Zork.rb (ruby)

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)


Yeah, I'm mostly inactive.  I check in once in a while though.  If you want to contact me, I have a contact form at my website, http://escratch.org

Offline

 

#6 2010-12-07 16:36:53

gbear605
Scratcher
Registered: 2008-03-06
Posts: 1000+

Re: Zork.rb (ruby)

bump


Yeah, I'm mostly inactive.  I check in once in a while though.  If you want to contact me, I have a contact form at my website, http://escratch.org

Offline

 

#7 2010-12-11 08:22:55

Soaringscorer
New Scratcher
Registered: 2010-10-30
Posts: 3

Re: Zork.rb (ruby)

I would like to help redo Zork but why would we use ruby? Why not C# or Visual Basic

Offline

 

#8 2010-12-11 08:39:57

gbear605
Scratcher
Registered: 2008-03-06
Posts: 1000+

Re: Zork.rb (ruby)

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)


Yeah, I'm mostly inactive.  I check in once in a while though.  If you want to contact me, I have a contact form at my website, http://escratch.org

Offline

 

#9 2010-12-11 08:42:37

gbear605
Scratcher
Registered: 2008-03-06
Posts: 1000+

Re: Zork.rb (ruby)

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++.


Yeah, I'm mostly inactive.  I check in once in a while though.  If you want to contact me, I have a contact form at my website, http://escratch.org

Offline

 

#10 2010-12-11 17:17:52

cheddargirl
Scratch Team
Registered: 2008-09-15
Posts: 1000+

Re: Zork.rb (ruby)

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.  smile


http://i.imgur.com/8QRYx.png
Everything is better when you add a little cheddar, because when you have cheese your life is at ease  smile

Offline

 

#11 2010-12-13 14:22:07

ProgrammingFreak
Scratcher
Registered: 2010-09-04
Posts: 1000+

Re: Zork.rb (ruby)

Are we still gonna do this in ruby?

Offline

 

#12 2010-12-13 14:46:14

gbear605
Scratcher
Registered: 2008-03-06
Posts: 1000+

Re: Zork.rb (ruby)

Ruby for now.


Yeah, I'm mostly inactive.  I check in once in a while though.  If you want to contact me, I have a contact form at my website, http://escratch.org

Offline

 

#13 2010-12-13 14:53:42

ProgrammingFreak
Scratcher
Registered: 2010-09-04
Posts: 1000+

Re: Zork.rb (ruby)

how may I help?

Offline

 

#14 2010-12-13 14:55:58

gbear605
Scratcher
Registered: 2008-03-06
Posts: 1000+

Re: Zork.rb (ruby)

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.


Yeah, I'm mostly inactive.  I check in once in a while though.  If you want to contact me, I have a contact form at my website, http://escratch.org

Offline

 

#15 2010-12-13 14:57:11

ProgrammingFreak
Scratcher
Registered: 2010-09-04
Posts: 1000+

Re: Zork.rb (ruby)

k! I am so energized. Zork is pretty cool. And all we really need to use is puts, gets, and variables

Offline

 

#16 2010-12-13 15:05:40

gbear605
Scratcher
Registered: 2008-03-06
Posts: 1000+

Re: Zork.rb (ruby)

new here: here


Yeah, I'm mostly inactive.  I check in once in a while though.  If you want to contact me, I have a contact form at my website, http://escratch.org

Offline

 

#17 2010-12-13 15:07:34

gbear605
Scratcher
Registered: 2008-03-06
Posts: 1000+

Re: Zork.rb (ruby)

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'.


Yeah, I'm mostly inactive.  I check in once in a while though.  If you want to contact me, I have a contact form at my website, http://escratch.org

Offline

 

#18 2010-12-13 15:18:45

ProgrammingFreak
Scratcher
Registered: 2010-09-04
Posts: 1000+

Re: Zork.rb (ruby)

how do I do a ruby file? I know ruby, the language. And I downloaded it

Offline

 

#19 2010-12-13 15:24:47

gbear605
Scratcher
Registered: 2008-03-06
Posts: 1000+

Re: Zork.rb (ruby)

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.


Yeah, I'm mostly inactive.  I check in once in a while though.  If you want to contact me, I have a contact form at my website, http://escratch.org

Offline

 

#20 2010-12-13 15:26:03

ProgrammingFreak
Scratcher
Registered: 2010-09-04
Posts: 1000+

Re: Zork.rb (ruby)

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

 

#21 2010-12-13 15:36:00

gbear605
Scratcher
Registered: 2008-03-06
Posts: 1000+

Re: Zork.rb (ruby)

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)


Yeah, I'm mostly inactive.  I check in once in a while though.  If you want to contact me, I have a contact form at my website, http://escratch.org

Offline

 

#22 2010-12-13 15:46:25

ProgrammingFreak
Scratcher
Registered: 2010-09-04
Posts: 1000+

Re: Zork.rb (ruby)

into cmd of windows or like ruby.exe? (exe is the extension for Windows)

Offline

 

#23 2010-12-13 15:48:51

gbear605
Scratcher
Registered: 2008-03-06
Posts: 1000+

Re: Zork.rb (ruby)

cmd of windows.


Yeah, I'm mostly inactive.  I check in once in a while though.  If you want to contact me, I have a contact form at my website, http://escratch.org

Offline

 

#24 2010-12-13 15:51:34

ProgrammingFreak
Scratcher
Registered: 2010-09-04
Posts: 1000+

Re: Zork.rb (ruby)

this is what it says:
'ruby' is not recognized as an internal or external command,
operable program or batch file.

Offline

 

#25 2010-12-13 15:54:11

gbear605
Scratcher
Registered: 2008-03-06
Posts: 1000+

Re: Zork.rb (ruby)

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.


Yeah, I'm mostly inactive.  I check in once in a while though.  If you want to contact me, I have a contact form at my website, http://escratch.org

Offline

 

Board footer