Created
September 27, 2012 16:55
-
-
Save anonymous/3795098 to your computer and use it in GitHub Desktop.
CatSim file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.*; | |
import java.io.*; | |
import java.lang.*; | |
public class CatSim | |
{ | |
private boolean running; | |
private double version; | |
private int hunger; | |
private int bladder; | |
private int thirst; | |
private int happiness; | |
public CatSim() | |
{ | |
version = 0.1 | |
preSim(); | |
createStats(); | |
printTut(); | |
} | |
private void preSim() | |
{ | |
System.out.println(""); | |
System.out.println("A NUNNERY PRODUCTION ||| Created by ToppleTheNun"); | |
System.out.println(""); | |
System.out.println("RICHARD HARRAH PRESENTS ANOTHER 'I'M BORED AT SCHOOL' PRODUCTION"); | |
System.out.println(""); | |
System.out.println("CATSIM v" + version); | |
System.out.println(""); | |
} | |
private void printStats() | |
{ | |
System.out.println("Hunger: " + getHunger() + " | Thirst: " + getThirst() + " | Bladder: " + getBladder() + " | Happiness: " + getHappiness()); | |
} | |
private void printTut() | |
{ | |
System.out.println("-----------------------"); | |
System.out.println("Welcome to the CATSIM tutorial."); | |
System.out.println(""); | |
System.out.println("This program simulates what it's like to have a cat."); | |
System.out.println(""); | |
System.out.println("Each stat ranges from 0-100. 0 is bad, 100 is good."); | |
System.out.println(""); | |
System.out.println("Hunger is how well fed your cat is."); | |
System.out.println("Thirst is how much water your cat has had to drink."); | |
System.out.println("Bladder is how bad your cat has to piss."); | |
System.out.println("Happiness is how happy your cat is."); | |
System.out.println("-----------------------"); | |
} | |
private void createStats() | |
{ | |
setHappiness(50); | |
setHunger(50); | |
setThirst(50); | |
setBladder(50); | |
} | |
public int getHappiness() | |
{ | |
return happiness; | |
} | |
public void setHappiness(int newHappiness) | |
{ | |
happiness = newHappiness; | |
} | |
public int getThirst() | |
{ | |
return thirst; | |
} | |
public void setThirst(int newThirst) | |
{ | |
thirst = newThirst; | |
} | |
public int getBladder() | |
{ | |
return bladder; | |
} | |
public void setBladder(int newBladder) | |
{ | |
bladder = newBladder; | |
} | |
public int getHunger() | |
{ | |
return hunger; | |
} | |
public void setHunger(int newHunger) | |
{ | |
hunger = newHunger; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment