Browse files

update before making public

  • Loading branch information...
1 parent 0222660 commit e537bcbd52ea5bab935bf4ce8a4719c31dcf5eec @ascot21 committed Oct 22, 2012
Showing with 89 additions and 25 deletions.
  1. +74 −1 lib/forkslist.csv
  2. +12 −22 lib/game.rb
  3. +1 −1 lib/scores.csv
  4. +2 −1 lib/story.rb
75 lib/forkslist.csv
@@ -1 +1,74 @@
-id,story,path1,path2,finish,score 1,"You are hiking in Snake Canyon when you find yourself lost in the strange and dimly lit Cave of Time. Gradually you can make out two passage ways. One curves downward to the right; the other leads upward to the left. It occurs to you that the one leading down may go to the past and the one leading up may go to the future.\n\nWhich way will you choose?\n\nType '1' for the tunnel leading down\nType '2' for the tunnel leading up",4,5,FALSE,100 4,"As you walk out the tunnel you find yourself very sleepy. So sleepy in fact that you fall asleep just as you step into the sunlight. Hours go by and then you wake up to find you are in the ICE AGE!\n\nDo you stay and adventure on or do you go back to the cave?\n\nType '1' to stay where you are\nType '2' to return to the cave",8,10,FALSE,300 5,"As you walk out of the cave you are hit with a very cold wind. A wind so strong that you need to seek shelter. There is another cave in front of you.\n\nDo you go in that cave or return to the one you came out of?\n\nType '1' for the new tunnel\nType '2' for the old tunnel",6,16,FALSE,100 6,"As you walk through the cave you get an eerie feeling like you are being transported through time. You walk for what seems like miles and then you finally come to an opening. As you step out of the tunnel you are almost immediately hit by a knight on a charging horse. You brush yourself off and notice that you have been transported to the MEDIEVAL AGES!\n\nDo you go back in the cave or do you adventure on?\n\nType '1' for adventuring on\nType '2' for going back in the tunnel",22,114,FALSE,300 8,"As you begin walking through the cold tundra you notice that there are some moving animals way off in the distance. Just as you begin to walk towards them you realize there are some people off in the other direction.\n\nDo you go looking for the animals or do you join the people?\n\nType '1' for joining the people\nType '2' for walking to the animals",17,18,FALSE,300 10,"You re-enter the cave and realize that the inside of the cave is much different than before. The tunnels leading outside have moved. You hear wind coming out of one tunnel and you hear what sounds like snow out of the other.\n\nWhich tunnel do you go out of.\n\nType '1' for the tunnel with the wind\nType '2' for the tunnel with the snow",20,21,FALSE,200 11,"He walks you up into a tower of the castle. As you are looking out the window you hear the door slam shut and lock. You've been locked in!\n\nDays go by and you begin looking for ways to escape. You rummage through everything to find something to help you escape. You open up a large trunk and find a knife and broad sword.\n\nWhich do you grab?\n\nType '1' for the knife\nType '2' for the sword",13,12,FALSE,500 12,"Just as you grab the sword you hear loud roar outside. You look out the window and see a huge Loch Ness monster swimming in the moat. It sees you and extends it's head up to your window. This thing is friendly!\n\nDo you jump on it's head and try to escape or do you stay in the tower?\n\nType '1' to jump on the Loch Ness monster\nType '2' to stay in the tower",66,78,FALSE,300 13,"Just as you pick up the knife you hear the door to the tower swing open and you see a guard. He says you've been released! You drop the knife and get out of there as quickly as you can. The guard offers to ride you into town on his horse.\n\nDo you take up his offer and ride with him or do you decide to walk on your own?\n\nType '1' to walk on your own\nType '2' take up his offer to ride on the horse",14,15,FALSE,200 14,"You begin walking into town. Along the way you run into a dashing young lady named Merrie England. She is the most beautiful girl you've ever seen. You begin talking as you walk and within minutes you know you've met the love of your life.\n\nYou and Merrie never part and live happily ever after!",nil,nil,TRUE,500 15,"As you ride the horse into town you see another cave. You ask the guard if he'll drop you off there instead. He complies and you enter the cave. This cave only has one tunnel to exit. So you go through it and are taken to the year 983 AD. Not happy with this you begin to look for another cave to try and find another portal to another time. But this search is futile. You search for years and never find one.",nil,nil,TRUE,200 16,"Back in the tunnel you see an old man. He has an evil look about him. To your right is a new tunnel.\n\nDo you talk to the old man or head right out of the tunnel?\n\nType '1' to talk to the old man\nType '2' for the tunnel leading out",25,24,FALSE,300 17,"You join the people to find that they are cavemen. You quickly realize they don't speak English or any modern language. They make weird sounds that is their 'language'.\n\nDo you try to make friends or do you look for another cave?\n\nType '1' to try and make friends\nType '2' to look for another cave",26,28,FALSE,300 18,"As you walk to the animals you realize that they are infact huge mammoths. These things are huge! You also notice another cave in the distance.\n\nDo you try to get closer to the mammoths and ride on or do you go to the new cave?\n\nType '1' to ride a mammoth\nType '2' to go to the cave.",29,30,FALSE,100 20,"Walking out of the tunnel you find yourself in the middle of a vast desert. A desert so wide you can't see anything for miles. But nonetheless you decide to stay and walk until you find something.\n\nDo you go East or West?\n\nType '1' for East\nType '2' for West",93,93,FALSE,300 21,"As you leave the cave you realize you are on top of a huge iceburg floating in the middle of the ocean. As luck would have it you see two boats. One is the Titanic and one is a small boat with a gorgeous girl sunbathing on the front.\n\nWhich boat do you try to signal?\n\nType '1' for the Titanic\nType '2' for the small boat",33,35,FALSE,300 22,"You venture out and find that you are in the middle of a jousting tourney for England's royalty. You make friends with the king and his family. Both the king and another man invite you to meet the queen.\n\nWhich do you go with?\n\nType '1' to go with the king\nType '2' to go with the other man",36,37,FALSE,200 24,"You step out of the tunnel to find yourself in the middle of a huge herd of buffalo. You are about to be trampled! You see a huge wall to your left and a space ship to your right.\n\nWhich do you go towards?\n\nType '1' for spaceship\nType '2' for the huge wall",40,38,FALSE,500 25,"The old man is a wizard. He gives you a choice to return to the past or go to the future.\n\nDo you want to go to the future or to the past?\n\nType '1' to go the future\nType '2' to go to the past",44,45,FALSE,300 26,"Making friends with the cavemen proves to be an easy task. You're quite the charmer and you fit in very quickly. Months later you find that the cavemen are planning on migrating to a warmer climate. You like the simple life but aren't sure if you should join them.\n\nWhich do you choose?\n\nType '1' to join them\nType '2' to venture out on your own",46,47,FALSE,200 28,"You decide to venture out and find another cave. So you leave and eventually find another cave. You go inside and then find another entrance to a sub cave. There are two more cave entrances.\n\nWhich do you choose?\n\nType '1' to go in the left one\nType '2' to go into the right one",51,51,FALSE,500 29,"You approach the mammoths and realize that they are pretty gentle creatures.\n\nDo you try to jump up on one and ride it?\n\nType '1' if you try to ride one\n\nType '2' if you don't dare try to ride one",52,53,FALSE,200 30,"Back in the cave you are presented with two more tunnels.\n\nWhich tunnel do you go down?\n\nType '1' for the tunnel leading down\nType '2' for the tunnel leading up",92,54,FALSE,300 31,"You are transported millions of years in the future. The earth is disolate and there is no light. The sun has died and shortly later you do too.",nil,nil,TRUE,300 32,"When you come out of the otherside of the tunnel you find yourself at the bottom of the ocean! Your underwater and you need to get to air fast! You swim as fast as you can and luckily make it to another cave with air pockets for you to breath. Once you catch your breath you decide to try and make it to the surface. You hold you breath and go! Just as you are only a few feet from the surface you hear an underwater siren coming from another cave.\n\nDo you swim to that cave or to the surface?\n\nType '1' for the surface\nType '2' for the underwater cave",58,64,FALSE,100 33,"The Titanic sees you and sends out a rescue boat. They save you and bring you onboard the Titanic. There is a giant party going on.\n\nDo you join the party even though you are exhausted or do you try and get some sleep?\n\n",68,79,FALSE,300 35,"The small boat sees you and picks you up. The lovely girl you saw sunbathing is named Louisa. She is thankful to see you as she's been alone on the boat for days. She asks if you want to join her in her journey around the world or if you'd rather be dropped off at the closest shore.\n\nType '1' if you want to join her\nType '2' if you want to be dropped off at shore",80,76,FALSE,300 36,"You go with the king to meet the queen. He's having trouble finding her.\n\nType '1' to continue",11,11,FALSE,200 37,"You go with the man to meet the queen. He's having trouble finding her.\n\nType '1' to continue",11,11,FALSE,500 38,"You make your way to the wall and climb to the top. You realize this is the Great Wall of China. You see two towers.\n\nWhich do you go in?\n\nType '1' to go in the first tower\n Type '2' to go in the second tower",87,81,FALSE,300 40,"You run to the space ship and jump on board. The space ship is actually full of astronauts that are working on a new NASA shuttle. They invite you to go on the mission. You agree and buckle up. As soon as the shuttle takes off there is a problem and the ship bursts into flames. You perish with the others but become famous in the news.",nil,nil,TRUE,200 44,"On no! He's sent you too far to the future. It's the APOCALYPSE! Everything is crashing around you. Soon you swallowed up in everything and killed by an astroid.",nil,nil,TRUE,500 45,"The wizard grants your wish and sends you to the past. Well the past ends up being just this morning before you started on this crazy adventure. You decide to stay put and be happy in the present.",nil,nil,TRUE,200 46,"You decide to migrate with them to warmer climates. Great choice. They've migrated to the Yucatan peninsula in Mexico where the water is crystal blue and the breeze is refreshing. You decide this is the place to stay and you live here happily every after.",nil,nil,TRUE,300 47,"You watch as the cavemen leave. You're all alone again. You set out on foot to find what to do next. As you are walking you come upon a mean looking wolf. The wolf charges you and you try to escape. You see two caves and have to quickly pick one to hide in.\n\nType '1' to go in the first cave\nType '2' to go into the second cave",50,49,FALSE,300 49,"Inside the cave you see an old man in the corner. Do you approach him?\n\nType '1' to talk to him\nType '2' to leave him alone",25,25,FALSE,100 50,"Inside the cave you feel safe and sound. All of this adventure has worn you out so you decide to take a nap.\n\nType '1' to continue",81,81,FALSE,300 51,"Then you find another and another. You're in a 'cave loop'! Eleven years later you finally find yourself a way out and return home to live happily.",nil,nil,TRUE,300 52,"Success! Getting up on one of the mammoths wasn't so hard. The gentle creatures are very friendly and like you. The mammoth you are riding walks you towards the people that you saw. These people are cavemen. You join them and make friends fast. You decide this simple life is much better than the hustle and bustle of your life so you stay and live happily ever after.",nil,nil,TRUE,200 53,"Not riding one of the mammoths might have been a good idea. But maybe not. Just as you are about to walk away something frightens the heard of mammoth and they begin to scatter. You are caught in the middle of this and one knocks you off a cliff to your death.",nil,nil,TRUE,500 54,"You come out of the tunnel to find yourself on a moving train. You look out the window and see you are somewhere in the middle of the mountains. After a while the train stops.\n\nDo you get off the train or stay on?\n\nType '1' to stay on\nType '2' to get off the train",98,101,FALSE,300 56,"The gathering of people you approach are all cheering for a large man in white that is speeking to them. He speaks in a language you've never heard. After a few minutes of listening you find someone that speaks English. He tells you that the man speaking is the Emperor of the Perfect Society. You ask what the Perfect Society is and he tells you it's the world you live in. The countries of the world no longer exist. Everyone lives together in peace in a 'perfect society'.Hard to believe but it's true.\n\nHappy to be here you decide to start walking around town to find a place to live. You come across a large white building that looks to be buzzing with people your age. Next door real estate company.\n\nWhich do you go in?\n\nType '1' for the large white building\nType '2' for the real estate company",57,60,FALSE,200 57,"You enter the large white building and quickly figure out that this is THE place to live in town. It's super fancy and has tons of people you would get along with. The 'META' buidling is the center of everything. You love it so much that you purchase a unit right away and live a 'perfect' life.",nil,nil,TRUE,500 58,"You make it to the surface of the water just in time. You catch your breath and realize you are just off the coast of Hawaii. You are in the middle of a harbor. On the left is a Hawaiian jungle. To the right is a beach with lots of people.\n\nWhich way do you go?\n\nType '1' to go to the jungle\nType '2' to go to the crowded beach",63,62,FALSE,200 60,"You step into what you thought was a real estate company. But actually it's a front for an underground biotech research company. They are researching how to cross breed different species. You stuble into one of the R&D rooms and see a cute little purple fur ball animal. You go up to it to get a closer look. The little monster jumps up and bites you in the neck killing you instantly.",nil,nil,TRUE,300 61,"You come out of the cave and find yourself in Colonial America. You see a horse and jump on.\n\nDo your ride north or east?\n\nType '1' to ride north\nType '2' to ride east",36,37,FALSE,300 62,"You swim to the beach and realize there are thousands upon thousands of people here to watch as the best surfers in the world compete in the World Championship. You quickly realize that you are in paradise and rejoice! You've always wanted to live hear. So you quickly meet some friends and decide to stay. You become a surfer and 5 years later you actually win the World Surfing Championship!",nil,nil,TRUE,100 63,"You swim to shore and begin to look for food. As you are walking through the thick brush you stop to look around. Just as you stop a huge boa drops from a tree around you and immediately starts to squeeze you. It's grip is too much for you and you die.",nil,nil,TRUE,300 64,"You swim into the cave to investigate what the siren is. You swim around for what seems like minutes struggling to hold your breath. To be continued...\n\nType '1' to continue",102,102,FALSE,300 66,"Nessie allows you to ride on her head. She helps you escape the tower! You ride off into the sunset where the two of you become best friends for life.",nil,nil,TRUE,200 68,"You join the party and start mingling with people. After a few hours of drinks and fun you realize something is wrong. The ship has hit an iceburg! The ship sinks and you die!",nil,nil,TRUE,500 74,Eaten Alive (end),nil,nil,TRUE,500 76,"Louisa drops you off and the closest shore a few days later. You make it into town and try to find a job. You land a job at a Cadillac car dealership. This suits you well and you have a long career there.",nil,nil,TRUE,200 78,"The Loch Ness monster soon leaves. Relieve you go back to the door with your sword. You pry the door open and then begin your escape. Just as you are about to leave the castle you are caught. They hang you on the spot.",nil,nil,TRUE,300 79,"After a few hours of sleep you wake up to find you've been transported back to a cave. In the cave there are two tunnels.\n\nWhich do you go out?\n\nType '1' for the first tunnel\nType '2' for the second tunnel",88,86,FALSE,300 80,"You decide to join her on her journey. But she forgot to tell you that she is almost out of supplies. A week later you run out of food and water and are stranded at sea. You hope for a boat to come by but that never happens. You die of heat stroke.",nil,nil,TRUE,100 81,"You wake up hours later only to realize this was all a dream.",nil,nil,TRUE,300 82,"You go into the tower and find that the stairs actually lead down. You walk down into the room and find yourself in a room of people chained to the wall. Just as you turn to leave you are hit on the head with a giant pipe. You awake minutes later to find yourself chained to the wall. You are now a chinese slave! You spend the rest of your life working the farms in the area as a slave.",nil,nil,TRUE,300 86,"You are transported to London. It's September 7th 1940. It's the middle of World World II and you are caught in the middle of German bombers attacking London! You quickly find shelter and ride the storm out. A couple years later you return to London where you become a writer and live happily ever after.",nil,nil,TRUE,500 87,"You walk through the door and find yourself transported to the deck of a huge ship at sea. You walk around and soon realize you are on the ship alone. The ship has been abandoned. You are lost at sea and that's where you die.",nil,nil,TRUE,300 88,"As you come out of the tunnel you see dinosaurs everywhere. You are in the Jurassic period!\n\nScared you have to decide whether to return to the cave or try and hide in a tree.\n\nType '1' to hide in a tree\nType '2' to return to the cave",91,90,FALSE,200 90,"You wake up to find that all of this was just a whild and crazy dream. It's good to be home!",nil,nil,TRUE,500 91,"Just as you are starting to climb the tree out from nowhere comes a T-rex! It swoops in and eats you!",nil,nil,TRUE,200 92,"You've stepped into the year 8742! Flying cars! Flying people! Space ships buzz over your head. Blinky electronics are everywhere! You begin to walk around and explore. Life here is much different than you ever expected. Everyone seems to be dressed exactly the same and everything is white! Is this the perfect society? You walk until you see a gathering of people outside of a huge building.\n\nType '1' to continue",56,56,FALSE,300 93,"You've been walking for hours and hours and are starting to get exhausted. You begin looking for a place to try and get some sleep. You finally stumble upon a cave. You go in and fall asleep for hours.\n\nWhen you awake notice that the cave has once again changed (what's up with these caves?). There are two tunnels.\n\nWhich do you go down?\n\nType '1' for the tunnel leading down\nType '2' for the tunnel leading up",32,31,FALSE,300 98,"You decide to stay but you move to another car to settle in. As you sit down you notice a large duffle bag underneath the seat behind you. You open the bag and find thousands of 100 dollar bills. It's millions! You decide to travel the world for the rest of your life!",nil,nil,TRUE,1000 101,"You get off the train and as you leave the station you realize that you are in fact a small being in the toy train set of a toddler. The toddler picks up the toy train and slams it down. Right on top of your head. You die at the hands of a toddler.",nil,nil,TRUE,300 102,"You swim and swim and can't find the siren. You are out of breath and about to drown. Just as you are about to take you last breath you wake up and realize all of this was a dream.",nil,nil,TRUE,300 104,"You ride north and find yourself in Boston. It's the year 1718. You make you way into town see a shipyard.\n\nType '1' to continue",107,107,FALSE,100 106,"As soon as you start to ride and group of lawmen come out of nowhere and surround you. They take you to jail for stealing a horse.\n\nType '1' to continue.",111,111,TRUE,300 107,"You see a shipped named 'Bounty of Gold'. You walk to the ship and meet the captain. He's in a great mood. It's his last day. He's retiring. He still needs to find a replacement captain so he immediately appoints you the new captiain. You gladly accept and spend the rest of your life captaining the most prosperous ship in America.",nil,nil,TRUE,200 111,"The men take you to jail. Just as the steel door slams you awake to find this was all a dream.",nil,nil,TRUE,500 114,"This cave only has one exit.\n\nType '1' to continue",61,61,FALSE,300
34 lib/game.rb
@@ -14,13 +14,7 @@ def instructions
puts ""
puts "Welcome to the game of".center(80)
- puts <<-CAVE_OF_TIME
- _____ _ ____ __ _____ _
- |_ _| |__ ___ / ___|__ ___ _____ ___ / _| |_ _(_)_ __ ___ ___
- | | | '_ \\ / _ \\ | | / _` \\ \\ / / _ \\ / _ \\| |_ | | | | '_ ` _ \\ / _ \\
- | | | | | | __/ | |___ (_| |\\ V / __/ | (_) | _| | | | | | | | | | __/
- |_| |_| |_|\\___| \\____\\__,_| \\_/ \\___| \\___/|_| |_| |_|_| |_| |_|\\___|
+"forks/instructions.txt", "r").each_line { |file| puts file }
puts ""
puts "~~~~ A Choose Your Own Adventure Game ~~~~".center(80)
puts "\nThis is a game where you choose what happens next in the story. It all depends on the choices you make. How does the story end? Only you can find out! And the best part is that you can start over and go ahead until you've had not one but many incredibly daring experiences!\n\n"
@@ -29,8 +23,7 @@ def instructions
def get_user_name
- @name = gets.chomp
- @name = @name.capitalize
+ @name = gets.chomp.capitalize
def load_next(id)
@@ -43,19 +36,14 @@ def load_next(id)
puts "Please enter a 1 or 2."
route = Integer(gets)
- if route == 1
- next_fork = item.path1
- elsif route == 2
- next_fork = item.path2
- end
+ next_fork = item.path1 if route == 1
+ next_fork = item.path2 if route == 2
item = @maingame.get_fork(next_fork)
@total_score += item.score.to_i
puts item.story.split(/\\n/)
- add_to_high_scores
- show_high_scores
def clear_screen
@@ -64,12 +52,14 @@ def clear_screen
def game_over
puts " ____ ___ _
- / ___| __ _ _ __ ___ ___ / _ \\__ _____ _ __| |
- | | _ / _` | '_ ` _ \\ / _ \\ | | | \\ \\ / / _ \\ '__| |
- | |_| | (_| | | | | | | __/ | |_| |\\ V / __/ | |_|
- \\____|\\__,_|_| |_| |_|\\___| \\___/ \\_/ \\___|_| (_)"
+ / ___| __ _ _ __ ___ ___ / _ \\__ _____ _ __| |
+ | | _ / _` | '_ ` _ \\ / _ \\ | | | \\ \\ / / _ \\ '__| |
+ | |_| | (_| | | | | | | __/ | |_| |\\ V / __/ | |_|
+ \\____|\\__,_|_| |_| |_|\\___| \\___/ \\_/ \\___|_| (_)"
- puts "You scored #{@total_score} points #{@name.chomp}!".upcase.colorize(:green).center(70)
+ puts "You scored #{@total_score} points #{@name.chomp}!".upcase.colorize(:green).center(70)
+ add_to_high_scores
+ show_high_scores
def get_top_scores
@@ -88,7 +78,7 @@ def add_to_high_scores
low_score = 0 #if there are no high scores
- if @total_score > low_score
+ if @total_score > low_score #if score should be in top ten
if @top_scores.length < 10
@top_scores[@top_scores.length + 1] = {:id => @top_scores.length + 1,:score => @total_score,:name => @name,:date =>}
2 lib/scores.csv
@@ -5,6 +5,6 @@
3 lib/story.rb
@@ -9,7 +9,8 @@ class Story
def initialize
@all_forks = {}
CSV.foreach("forkslist.csv", :headers => true) do |row|
- @all_forks[row[0]] =[0],row[1],row[2],row[3],row[4],row[5])
+ story_text ="forks/#{row[0]}.txt", "r").read
+ @all_forks[row[0]] =[0],story_text,row[1],row[2],row[3],row[4])

0 comments on commit e537bcb

Please sign in to comment.