How to make a basic text-based game in Python

1) Import ‘time.’

It will be used to create a timer for a clear-screen.

2)
This creates a waiting timer, which counts down in milliseconds.

3)
This will clear the screen of all text.

4)Your also going to need to have something to count progress in the game, something as simple as this will do:

Your code will need this, and will add to this to represent furthering the game.

5) Create several directories that represent the possible actions a player can choose from.
For example:

6) Put the entire game within a ‘while’ loop:

This forces the code to continually loop so the game doesn’t crash if a player re-does a previously used command.

7) At the beginning of while the loop, declare the cls(); and create a simple statement:

The ‘cls’ clears the screen, and the newly-created ‘response’ will allow the player to actually make inputs to the game, so it actually becomes a playable game.

8) Create many, many elif (else if) statements. Every elif will represent an action and progress level. The simplest way to have it would be:

9) For displaying text to the user:

10) For progression in a game, under any of the elifs, then place this under the code:

The last three steps will be repeated many times, and will generally line up to make a full story, possibly with extreme amounts of flavor text.

How to Github to host a website [FREE]

Perhaps you need to have a site for some reason, maybe it’s a download page, maybe it’s an information page, or maybe it’s just a site in general, anyways, what you made your site for is not important. What is important is that you will need to get it hosted somewhere, luckily I’ve got your back on this one. All we need to do is make a GitHub Page, and fortunately for you, this guide will show you how, and it’s free just in-case you were wondering.

Things that you may need: GitHub Desktop (So we can actually do this), A website, and a bit of common sense, also a web browser.

Go herehttps://github.com, then do as the pictures below do.

 

Now, we must open up GitHub desktop, and, then after logging in, we’re going to want to open the Git Shell, a picture below will show you what to do to open it.

After you get the shell open, you wan to type the below in, also, make sure that after each line ends, you press enter, because this is not all just one line.

echo "# *yourrepository*" >> README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/*yourgithubusername*/*your repositoryname*.git
git push -u origin master

We then need to do is move the site, and all of its files into the place where the Blue arrow points into, and then make sure that we choose “Make a new branch” and in the new branch name it ABSOLUTELY NEEDS TO SAYgh-pages” if you don’t do this then you won’t get a working site.

Then you can find your site at *your github user name*.github.io/*your github repository*

AND there we go! Now we have free hosting for our website which is great.