Sponsored Content
Top Forums Shell Programming and Scripting Making a Text based game. Need help. Post 302728269 by lemonoid on Wednesday 7th of November 2012 02:27:04 PM
Old 11-07-2012
Making a Text based game. Need help.

Okay so Zork sparked my interest in this. I have been learning to program for the last year and a half. I've dabbled in everything from Java to Ruby to PHP & XHTML & SQL, and now I'm on bash. I really like bash scripting. Its easy and fun. I just started two days ago. Pretty much I've been writing a story line requiring user input, but simply just using read, echo, if/then/else, etc. Pretty much what I need help is being able to branch off into different scenarios based on user input. For example,
echo -n "Retto is very excited that Miles has joined the ranks. However, he needs to present Miles with a test. Should we test him with a bootloader hack or a mainver downgrade? > "

Where the user chooses one of the options, and then based on which option is chosen, the story line is different than if the user chose the opposite test. I know that I need to have the result of each test written, but how do I go about skipping the one and continuing into the selected storyline? For example, if bootloader is chosen, Miles works day and night and requires the user to pick a device with the locked bootloader, and then the success of Miles determines what reward he is given for his success. If mainver is choosen, the user has to decide what type of computer Miles uses work on the mainver downgrade, and in turn, the reward that is given for his success in the venture.

bootloader > miles needs a device, pick from dev1/dev2/dev3/dev4 > dev4 has the hardest, as in real-time it takes miles 30 seconds to crack it, and he is given an amazing reward || all the other devices are easy and take (real-time 15 seconds, game time one day) to crack, and he is given a simple reward > then miles is presented with his new task

same thing with the mainver, but replace the devices with different computers and rewards.

I don't know how to branch into different scenarios

If someone understands what I am asking and trying to do here, please help me figure out some way to branch these scenarios. Thank you so much.

ps. Think of Zork and all of the different results that happened based on the user's inputs, and how each of those results would branch into a different result.
 

10 More Discussions You Might Find Interesting

1. What is on Your Mind?

Making a new OS based on Solaris / OpenSolaris

Hi I'm planning on making a OS based on the Solaris kernel. And I would like to know what you think about this idea or want to contribute. I'm planning on modifying the current Solaris kernel and adding more drivers to it and making it work better on x86. This project will be completely open... (1 Reply)
Discussion started by: Dinolinux
1 Replies

2. UNIX for Dummies Questions & Answers

text based football game?

Is there a textbased football game (American) that I can download through ubuntu server edition? (1 Reply)
Discussion started by: dadoprso
1 Replies

3. UNIX for Dummies Questions & Answers

Is there picture based game under linux terminal?

Is there picture based game under linux terminal? Just like Supermario under DOS. (18 Replies)
Discussion started by: vistastar
18 Replies

4. Programming

This Makes NO sense. I'm making a game and getting an error, need help.

Okay so I'm making a simple text based game that branches into different scenarios. By branching I mean branching off into whole different files with that part of the game in it. I got tired of working on scenario 1 so I'm working on scenario 2. As I get started and try to test it, I get an error... (1 Reply)
Discussion started by: lemonoid
1 Replies

5. Shell Programming and Scripting

Shell Text Based Game, This Error Makes NO sense. Please help

Okay so I'm making a simple text based game that branches into different scenarios. By branching I mean branching off into whole different files with that part of the game in it. I got tired of working on scenario 1 so I'm working on scenario 2. As I get started and try to test it, I get an... (3 Replies)
Discussion started by: lemonoid
3 Replies

6. UNIX for Dummies Questions & Answers

[Solved] Making a text based game

Hello, I am looking to make a text based game, that runs in the command window, or a window similar. I will only need to use 1 window. I read somewhere that there is libraries for this kind of thing? But I can't remember the name of them.. Can anyone point me in a direction? I will be... (2 Replies)
Discussion started by: murphy
2 Replies

7. News, Links, Events and Announcements

Eulora, a Linux-based MMORPG, holds first game event.

This Sunday, June the 7th, players in attendance will be given unique items engraved with their name. The items can be used to generate free in-game currency on a daily basis, which is particularly notable because the game's currency is bitcoin. I can't post a link yet; if you're interested, engage... (0 Replies)
Discussion started by: danielpbarron
0 Replies

8. Shell Programming and Scripting

Tetris Game -- based on a shell script (new algorithm)

GitHub - deepgrace/tetris: Tetris implementation in all kinds of Programming Languages Usage: bash Tetris_Game ] ] ] ] Range: #!/bin/bash # Tetris Game // The Art Of Shell Programming box0=(4 30) box1=(4 30 4 32) box2=(4 30 5 32) box3=(4 28 4 30 4 32) box4=(4 28 4 30... (69 Replies)
Discussion started by: complex.invoke
69 Replies

9. Shell Programming and Scripting

Proper distribution of cards in terminal based crazy8's game in bash script

When I run the following script at the bottom it say cards remaining=44...It should be=35. Can anyone tell me what I'm doing wrong. I've spent hours trying to get this to work and I can't go any further until this part works. thank you in advance Cogiz #!/bin/bash # Date="November, 2016" #... (2 Replies)
Discussion started by: cogiz
2 Replies

10. Shell Programming and Scripting

Creating a text based game using shell script.

Hello guys I'm new to shell scripting and I need to make a game using shell script. I want to know if it is possible for me a total noob to shell scripting to make this game. The game concept is simple: First thing when you launch the script you get a menu in which you select if you want to... (3 Replies)
Discussion started by: Othmane
3 Replies
Dancer::Development::Integration(3pm)			User Contributed Perl Documentation		     Dancer::Development::Integration(3pm)

NAME
Dancer::Development::Integration - guide for Dancer's core-team members DESCRIPTION
This documentation describes the procedure used for integrators to review and merge contributions sent via pull-requests. Every core-team member should read and apply the procedures described here. This will allow for a better history and more consistency in our ways of handling the (increasing number!) of pull requests. TERMS
We will first define the most important terms used in this documentation: o PR Acronym for Pull Request o Contributor A GitHub user who had forked and cloned the official Dancer's repo, and who has sent a PR. o Integration branch This branch is the branch used to merge all contributions. This is a git-flow convention. In Dancer, our integration branch is "devel". As explained in Dancer::Development, every PR should be based on the integration branch. If not, this is enough to refuse the PR (it makes the life of the integrator much harder if this is not the case). o Integrator A member of Dancer's core-team who is responsible for reviewing and either rejecting the PR, or merging it into the integration branch. PROCEDURES
Processing a Pull Request This procedure describes how an integrator should process a PR. Let's say the user $user has sent a PR, he has followed the instructions described in Dancer::Development so his work is based on the integration branch ("devel"). All the procedure described here is designed to avoid unnecessary recursive-merge, in order to keep a clean and flat history in the integration branch. Of course, we could just pull from $user into our "devel" branch, but this would shift the history because of recursive merge, most of the time. To avoid that, we're going to pull the commits of $user into a temporary branch, and then cherry-pick the commits we want. In order to have a clean history, like the one we got with git-flow when working on a feature, we're going to do that in a topic branch, named "review/$user". Then, this branch will be merged into "devel" and we will just have to drop it. First, we make sure we are in sync with "origin/devel" git checkout devel git pull origin devel Then, from that branch we create a temp sandbox git checkout -b temp We pull here from $user git pull <user repo> <pr/branch> Here, either the pull was run as a fast-forward or as a recursive merge. If we have a FF, we can forget about the temp branch and do the pull directly in "devel". If not, we'll have to cherry-pick the commits by hand. From devel, we first create the final "review" branch: git checkout devel git checkout -b review/$user Then we cherry-pick all the commits we want. To know them, we just have to go into temp and inspect the history (with "git log"). When we have the list of commits we want: for commit in C1 C2 C3 ... CN do git cherry-pick $commit done (Another option is to use "git rebase -i" to manually select the list of commits to cherry-pick/rebase.) Then we can review the code, do whatever we want, maybe add some commits to change something. When we're happy with the change set, we can merge into devel: git checkout devel git merge --no-ff review/$user Note the "--no-ff" switch is used to make sure we'll see a nice commit named "Merge branch 'review/$user' into devel". This is on purpose and mimic the behaviour of git-flow. Your local "devel" branch is now merged, and can be pushed to the remote. $ git push origin devel RELEASE CYCLES
We have one main release cycle. This is the release cycle based on the devel branch. We use this branch to build new releases, with new stuff all the new shiny commits we want. Those release are built with git-flow (with "git-flow release") and are then uploaded to CPAN. Since Dancer 1.2, we also have another parallel release cycle which is what we call the frozen branch. It's a maintenance-only release cycle. That branch is created from the tag of the first release of a stable version (namely a release series with an even minor number). This branch must be used only for bug-fixing the stable releases. Nothing new should occur in that branch. Let's take an example with Dancer 1.2003 and Dancer 1.3002. o Dancer 1.2003 is the last stable release of Dancer. Its codebase is handled in the frozen branch, that has been created from the tag 1.2000. o Dancer 1.3002 is the last release of Dancer. As it belongs to a development series, it can provide new features, code refactoring and deprecations. Its codebase is handled by the integration branch, "devel". o When a bug is found in 1.2xxx, it's fixed in the "frozen" branch, and a new release is built from here and then uploaded to CPAN. o Whenever the team wants to, they can release new versions of 1.3xxx from the devel branch, using "git-flow release start". o When the team finds that the current state of devel (namely, the last version of 1.3xxx) is stable and mature enough. They can decide it will be the new stable version. Then, a release 1.4000_01 is built from devel, an upload is done to CPAN, and when ready, the 1.40001 can be uploaded the same way. From that moment, the master branch is merged into frozen in order to be able to hotfix the frozen branch in the future. It's now possible for the team to continue working on new stuff in devel, bumping the version number to 1.5000_01 AUTHOR
This documentation has been written by Alexis Sukrieh "<sukria@sukria.net>". perl v5.14.2 2011-11-30 Dancer::Development::Integration(3pm)
All times are GMT -4. The time now is 02:39 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy