Ideas For A Text-Based Game

I tried working on Graphics a while ago, but I didn't have too much luck with that ;)
Just wondering if anyone here has any ideas about a 'fun' text-based game, that wouldn't be really based on RPG style stuff, because I don't really want to bother with having characters save and stuff(I kno how to though...)
Something like Rock/Paper/Siscors(spelling? lol), but kinda more adicting...oh right, forgot to tell you...idea for a MULTIPLAYER text-based game ;)
Thanks
-Been trying to think of a good idea all day, no luck ;)

Think of an existing exciting game, and make a clone. Thinking of new games is hard.
Scissors.
Addicting.

Similar Messages

  • How to make an a basic attack in my text based game

    hey guys! i really need some genuine help on how to create an attack for my monsters and player. the attack should be basic: if the room contains a monster, then the monster attacks when the player goes inside the room. then the player can type a command to attack the monster. the attack should just deduct the hp of the monster. so the player can keep attacking till the monster is "dead"(this is where i remove the monster).
    anyway i tried alot in creating the attack but i failed all the time, messing my code even more. please!!!!! help!!!
    my monster class:
    public class Monster
    private int hp, stage;
    private String name;
    public Monster(String name, int stage)
    this.name = name;
    this.stage = stage;
    if(stage == 1) {
    hp = 1;
    else if(stage == 2) {
    hp = 2;
    else if(stage == 3) {
    hp = 2;
    else if(stage == 4) {
    hp = 3;
    else if(stage == 5) {
    hp = 4;
    else if(stage == 6) {
    hp = 6;
    public int monsterStage()
    return stage;
    public String getName()
    return name;
    this is where i created the monsters in my main game class:
    private Monster skeleton, sphinx, zombie, vampire, werewolf, undeadking;
    setting the monster to a room:
    skeleton = new Monster("skeleton1", 1);
    skeleton = new Monster("skeleton2", 1);
    sphinx = new Monster("sphinx1", 2);
    sphinx = new Monster("sphinx2", 2);
    sphinx = new Monster("sphinx3", 2);
    zombie = new Monster("zombie", 3);
    vampire = new Monster("vampire1", 4);
    vampire = new Monster("vampire2", 4);
    werewolf = new Monster("werewolf", 5);
    undeadking = new Monster("undeadking", 6);
    //setting the monster to a place
    bridge.addMonster("skeleton1", skeleton);
    castleDoor.addMonster("sphinx1", sphinx);
    castleChest.addMonster("zombie", zombie);
    dungeonDoor.addMonster("sphinx2", sphinx);
    castleStair.addMonster("werewolf", werewolf);
    dungeonBridge.addMonster("vampire2", vampire);
    dungeonBook.addMonster("sphinx3", sphinx);
    dungeonChest.addMonster("skeleton2", skeleton);
    throneCenter.addMonster("undeadking", undeadking);
    ps.: please help me! each room has one monster only and they are stored in hashmaps

    Here is a start of a basic text based game--it doesn't level or regen characters nor give healing or have new weapons...
    package ForumJunk;
    import java.util.Random;
    import java.util.Scanner;
    public class ForumJunk{
      private final int widthX;
      private final int heightY;
      private int myX;
      private int myY;
      private int myLevel;
      private int baseHP;
      private int myHP;
      private int myTreasure;
      private String[] myWeapon = {"fist", "open hand", "dagger", "short sword", "long sword", "b-sword", "2H sword"};
      private int[] myWeaponMaxDamage = {2, 3, 4, 6, 10, 12, 16};
      private int monsterFillFactor = 40;
      private int[][] monsterLevel = {{1, 1, 1}, {2, 2, 2}, {3, 3, 3}};
      private String[][] monsterName = {{"Skeleton", "Orac", "Kobald"}, {"Zombi", "Wolf", "Giant Rat"}, {"Bandit", "Mummy", "Ghost"}};
      private int[] monsterMaxDamage = {2, 4, 6};
      private myRoom[][] room;
      private Random rand;
      public ForumJunk(){
        widthX  = 100;
        heightY = 100;
        myLevel = 1;
        rand = new Random();
        baseHP   = 16;
        myHP     = baseHP;
        for(int i=0; i<myLevel; i++) myHP = myHP + rand.nextInt(4) + 4;
        room = new myRoom[widthX][heightY];
        for(int i=0; i<widthX; i++)for(int j=0; j<heightY; j++)room[i][j]=new myRoom();
        myX = rand.nextInt(widthX);
        myY = rand.nextInt(heightY);
        myTreasure = 0;
        fillMonster();
      public void doAttack(){
        if(!(room[myX][myY].monster != null)){
          System.out.println("Oh, it must have been my shadow; there's no monsters here \n");
          return; //no monster
        if(rand.nextBoolean()){
         doHumanAttack();
         if(room[myX][myY].monster.hp > 0) doMonsterAttack();
        }else{
          doMonsterAttack();
          doHumanAttack();
      public void doHumanAttack(){
        int weaponIndex = 0;
        if(myLevel<myWeaponMaxDamage.length) weaponIndex = myLevel;else weaponIndex = myWeaponMaxDamage.length-1;
        System.out.println("Attacking with " + myWeapon[weaponIndex] + " ...");
        int damage = myLevel * rand.nextInt(myWeaponMaxDamage[myLevel]);
        room[myX][myY].monster.hp -= damage;
        if(damage>0) System.out.println("Hit for " + damage + " damage\n");
        else System.out.println("I missed!\n");
        if(room[myX][myY].monster.hp <= 0) System.out.println("The " + room[myX][myY].monster.name  + " is dead.");
      public void doMonsterAttack(){
        System.out.println("The " + room[myX][myY].monster.name  + " is attacking...");
        int damage = rand.nextInt(monsterMaxDamage[room[myX][myY].monster.level-1]);
        myHP -= damage;
        if(damage>0) System.out.println("I've been hit for " + damage + " damage\n");
        else System.out.println("It missed me!\n");
        if(myHP<=0){
          System.out.println("Oh no, I'm dead!!!!!");
          System.exit(0);
      public void doStatus(){
        System.out.println();
        System.out.println("  Status:");
        System.out.println("    Room: " + myX + ":" + myY);
        System.out.println("      HP: " + myHP);
        System.out.println("Treasure: " + myTreasure + " gp");
        System.out.println("   Level: " + myLevel);
        System.out.println();
      public void doTreasure(){
        if(!(room[myX][myY].monster != null)){
          System.out.println("What--do you expect it just to be laying around in every room? \n");
          return; //no monster
        if(room[myX][myY].monster.hp>0){
          System.out.println("If there is any treasure that " + room[myX][myY].monster.name + " is guarding it.\n");
          return; //no monster
        myTreasure += room[myX][myY].monster.treasure;
        System.out.println("I found " + room[myX][myY].monster.treasure + " gp\n");
        room[myX][myY].monster = null;
      public void fillMonster(){
        int fill = (widthX * heightY * monsterFillFactor) / 100;
        int x = 0;
        int y = 0;
        boolean gen = false;
        for(int i=0; i<fill; i++){
          gen = true;
          while(gen){
            x = rand.nextInt(widthX);
            y = rand.nextInt(heightY);
            if(!(room[x][y].monster != null)){
              room[x][y].monster = new Monster(rand.nextInt(3)+1);
              gen = false;
      class Monster{
        int level = 0;
        int hp   = 0;
        int treasure = 0;
        String name = "";
        Monster(int level){
          this.level = level;
          hp = 1;
          for(int i = 0; i<level; i++) {
            hp += rand.nextInt(6);
            treasure += rand.nextInt(100);
          name = monsterName[level-1][rand.nextInt(3)];
      class myRoom{
        Monster monster = null;
        //what ever else you want to put in here
      public static void main(String[] args){
        String myIN = "";
        Scanner scan = new Scanner(System.in);
        ForumJunk fj = new ForumJunk();
        System.out.print("I am in room: " + fj.myX + ", " + fj.myY + " I have " + fj.myHP + " hit points and " + fj.myTreasure + " treasure ");
        if(fj.room[fj.myX][fj.myY].monster!=null){
          System.out.println("There is a  " + fj.room[fj.myX][fj.myY].monster.name + " here!");
        System.out.println("\n");
        while(!(myIN=scan.next()).equals("exit")){
          if(myIN.equals("north")){
            fj.myY -=1;
            if(fj.myY<0) fj.myY=fj.heightY-1;
          }else if(myIN.equals("south")){
            fj.myY +=1;
            if(fj.myY==fj.heightY) fj.myY=0;
          }else if(myIN.equals("west")){
            fj.myX -=1;
            if(fj.myX<0) fj.myX=fj.widthX-1;
          }else if(myIN.equals("east")){
            fj.myX +=1;
            if(fj.myX==fj.widthX) fj.myX=0;
          }else if(myIN.equals("attack")){
            fj.doAttack();
          }else if(myIN.equals("weapon")){
            System.out.println("I'll be using my " + fj.myWeapon[fj.myLevel] + " to attack\n");
          }else if(myIN.equals("treasure")){
            fj.doTreasure();
          }else if(myIN.equals("status")){
            fj.doStatus();
        System.out.print("I am in room: " + fj.myX + ", " + fj.myY + " I have " + fj.myHP + " hit points and " + fj.myTreasure + " treasure ");
        if(fj.room[fj.myX][fj.myY].monster!=null){
          System.out.print("There is a ");
          if(fj.room[fj.myX][fj.myY].monster.hp<=0) System.out.print("dead ");
          System.out.println(fj.room[fj.myX][fj.myY].monster.name + " here!");
        System.out.println("\n");
      System.out.println("Bye!");
    }

  • Help with text based game.

    SO I've just begun to make a text based game and i've already ran into a problem :/
    I've made a switch statement that has cases for each of the classes in the game..for example
    Output will ask what you want to be
    1. Fighter
    2. etc
    3. etc
    case 1: //Fighter
    My problem is i want to be able to display the class
    as in game class not java class
    as Fighter
    That may be a bit confusing to understand sorry if it isn't clear
    Here is my code that i'm using this may help.
    import java.util.Scanner;
    public class main {
         public static void main(String args[]) {
              Scanner input = new Scanner(System.in);
              int health = 0;
              int power = 0;
              int gold = 0;
              System.out.println("Welcome to my game!");
              System.out.println("First of what is your name?");
              String name = input.next();
              System.out.println(name + " you say? Interesting name. Well then " + name + " what is your race?");
              System.out.println();
              System.out.println("Press 1. for Human");
              System.out.println("Press 2. for Elf");
              System.out.println("Press 3. for Orc");
              int Race = input.nextInt();
              switch (Race) {
              case 1: // Human
                   String race = "Human";
                   health = 10;
                   power = 10;
                   gold = 25;
              break;
              case 2: // Elf
                   health = 9;
                   power = 13;
                   gold = 25;
              break;
              case 3: // Orc
                   health = 13;
                   power = 9;
                   gold = 30;
              break;
              default:
                   System.out.println("Invalid choice Please choose 1-3");
              break;
              System.out.println("Now what is your class?");
              System.out.println("Press 1. Fighter");
              System.out.println("Press 2. Mage");
              System.out.println("Press 3. Rogue");
              int Class = input.nextInt();
              switch (Class) {
              case 1: // Fighter
                   health = health + 1;
                   power = power + 1;
                   gold = gold + 1;
              break;
              case 2: // Mage
                   health = health + 1;
                   power = power + 1;
                   gold = gold + 1;
              break;
              case 3: // Rogue
                   health = health + 1;
                   power = power + 1;
                   gold = gold + 1;
              break;
              default:
                   System.out.println("Invalid choice Please choose 1-3");
              break;
              System.out.println("So your name is " + name );
              System.out.println("and your race is: " + race);
              System.out.println("and your class is: " + Class);
    }Thanks in advance!

    Brushfire wrote:
    So you're advising him to run his console based game on the EDT, why?Far King good question... To which I suspect the answer is "Ummm... Ooops!" ;-)
    @OP: Here's my 2c... if you don't follow then ask good questions and I'll consider giving good answers.
    package forums;
    import java.util.Scanner;
    abstract class Avatar
      public final String name;
      public int type;
      public int health;
      public int power;
      public int gold;
      protected Avatar(String name, int health, int power, int gold) {
        this.name = name;
        this.health = health;
        this.power = power;
        this.gold = gold;
      public String toString() {
        return "name="+name
             +" health="+health
             +" power="+power
             +" gold="+gold
    class Human extends Avatar
      public Human(String name) {
        super(name, 10, 11, 31);
    class Elf extends Avatar
      public Elf(String name) {
        super(name, 9, 13, 25);
    class Orc extends Avatar
      public Orc(String name) {
        super(name, 6, 17, 13);
    interface AvatarFactory
      public Avatar createAvatar();
    class PlayersAvatarFactory implements AvatarFactory
      private static final Scanner scanner = new Scanner(System.in);
      public Avatar createAvatar() {
        System.out.println();
        System.out.println("Lets create your avatar ...");
        String name = readName();
        Avatar player = null;
        switch(readRace(name)) {
          case 1: player = new Human(name); break;
          case 2: player = new Elf(name); break;
          case 3: player = new Orc(name); break;
        player.type = readType();
        return player;
      private static String readName() {
        System.out.println();
        System.out.print("First off, what is your name : ");
        String name = scanner.nextLine();
        System.out.println(name + " you say? Interesting name.");
        return name;
      private static int readRace(String name) {
        System.out.println();
        System.out.println("Well then " + name + ", what is your race?");
        System.out.println("1. for Human");
        System.out.println("2. for Elf");
        System.out.println("3. for Orc");
        while(true) {
          System.out.print("Choice : ");
          int race = scanner.nextInt();
          scanner.nextLine();
          if (race >= 1 && race <= 3) {
            return race;
          System.out.println("Bad Choice! Please try again, and DO be careful! This is important!");
      private static int readType() {
        System.out.println();
        System.out.println("Now, what type of creature are you?");
        System.out.println("1. Barbarian");
        System.out.println("2. Mage");
        System.out.println("3. Rogue");
        while(true) {
          System.out.print("Choice : ");
          int type = scanner.nextInt();
          scanner.nextLine();
          if (type >= 1 && type <= 3) {
            return type;
          System.out.println("Look, enter a number between 1 and 3 isn't exactly rocket surgery! DO atleast try to get it right!");
    public class PlayersAvatarFactoryTest {
      public static void main(String args[]) {
        try {
          PlayersAvatarFactoryTest test = new PlayersAvatarFactoryTest();
          test.run();
        } catch (Exception e) {
          e.printStackTrace();
      private void run() {
        AvatarFactory avatarFactory = new PlayersAvatarFactory();
        System.out.println();
        System.out.println("==== PlayersAvatarFactoryTest ====");
        System.out.println("Welcome to my game!");
        Avatar player1 = avatarFactory.createAvatar();
        System.out.println();
        System.out.println("Player1: "+player1);
    }It's "just a bit" more OOified than your version... and I changed random stuff, so you basically can't cheat ;-)
    And look out for JSG's totally-over-the-top triple-introspective-reflective-self-crushing-coffeebean-abstract-factory solution, with cheese ;-)
    Cheers. Keith.
    Edited by: corlettk on 25/07/2009 13:38 ~~ Typo!
    Edited by: corlettk on 25/07/2009 13:39 ~~ I still can't believe the morons at sun made moron a proscribed word.

  • Ideas for a Java based Thesis

    Hi,
    does anybody have any good ideas for a Java based Thesis project, something that could be completed in no more than 6 months. I have been working with Servlets & J2ME for over a year, but I'm having trouble coming up with a good/challenging project....
    Any help appreciated,
    Shane

    You can find a ton of potential student projects here:
    http://mindprod.com/projects.html
    Dunno if any of them fit your criteria - but it's a start...
    Good luck!
    Grant

  • Is there a mobile device for just text and games for a child?

    is there a mobile device for just text and games for a child?

    iPod touch?  That's the only "iPod" that can play games (run apps).  It connects to the Internet over WiFi (not mobile carrier).  It's basically an iPhone without the phone parts.  If you get a used one, earlier models cannot run all the software available to the latest model (include the latest version of iOS).  That may be perfectly OK for a child, but you should look into and understand the imitations of older models, before getting one used or refurbished.  Apple-certified refurb iPod touch is available here
    http://store.apple.com/us/browse/home/specialdeals/ipod
    (The current version of iPod touch is 5th gen.)

  • Anybody know where I could download free text based games?

    Hi, I own a MacBook Pro that runs OS X 10.7.2, does anybody know a website were I could download free text based games? I would really appreciate it, and if any one knows another game, other than the command emacs -batch -l dunnet, that would be awesome too.
    Thanks, James

    You can't forget Zork I, II, III.   You need to download Boxer to run DOS games (in other words, don't download the Mac Version, because it needs to run in OS9 to work). You can also play it online just google it.
    Go south. 
    You have entered a forest with a tall tree.
    Climb tree. 
    You are at the top of the tree and you can see Cupertino off in the distance.  A troll followed you up the tree.
    Kill troll with sword. 
    Troll dies easily since it couldn't defend itself while climbing tree.
    Eat dead troll. 
    Nom nom.  Could have used a little salt.
    Message was edited by: OrangeMarlin

  • Customize Line Items Details Loading for Multiload TEXT-Based

    Hi all,
    has anybody customized HFM adapter to enable line item details loading for Text-based multiload files?
    Is it possible?
    Thanks

    But then we wouldn't have one text multiload file but several text files that will be converted into several .dat files to be loaded into HFM.
    Our current problem is that we have a multiload text file (we can convert from the Multiload Excel) but this file contains line item details. We want to keep the performance of loading only one .Dat file, but also load line item details.
    What about if the user split the multiload files into two:
    * Excel Multiload just with Line Item accounts (there are not so much)
    * Text Multiload for standard accounts
    This would be a nice solution as well? If they are happy....
    Thanks

  • Ideas for a Java based Project

    Hi all :)
    I follow Java forums, mainly read, although post a bit whenever i know.
    I am looking for some ideas on starting a College project which is based on java. Maybe java network based? Since there are so many experienced people here, i was wondering if some of you could tell me some ideas that i could do. I have a fair bit of experience with java. But if the project requires to learn something new...i wont mind at all. I would really appreciate you guys input about any ideas.

    You can find a ton of potential student projects here:
    http://mindprod.com/projects.html
    Dunno if any of them fit your criteria - but it's a start...
    Good luck!
    Grant

  • Ideas for a colour-based overview page

    Does anyone have any good ideas of how to create a page that is an overview of a production facility? It would be based on 1 or 2 tables, updated once each minute, and would show the status of each of 176 production units. Each unit would need to show 2 or 3 bits of information: they could all be colour-coded or all except one, which could be numeric. Ideally you would be able to click on the unit to go to detail pages on that unit. The colour codes could be simply colour or could be icons; there are probably advantages in each.
    Any thoughts on how to construct something like this?
    I should admit that I am still quite new to ADF. Using 11.1.1.2 at the moment but maybe 11.1.1.4 in a month or two.

    You can find a ton of potential student projects here:
    http://mindprod.com/projects.html
    Dunno if any of them fit your criteria - but it's a start...
    Good luck!
    Grant

  • Ideas for restricting content based on security

    I am relatively new to the Oracle UCM world, so please be gentle...
    I'm looking to move a current website over to Oracle UCM, and this website currently has a logon functionality. I believe our plan is to use the current Oracle security model to mimic the current login functionality. The current website is designed as two "seperate" sites (one for the public, and one for the registered users), but is reproducing some content across both versions of the site. Obviously, moving to content server, we could share the same content. The problem we are having trouble wrapping our heads around is as follows...
    There is a "Resources" section, for example, that contains different links based on if you are logged in or not. We want to allow contributors the ability to edit this content, but cannot figure out how to fit this data into the current system. Basically, we have a page that looks like this:
    Resources (title)
    Link 1 (public link)
    Link 2 (public link)
    Link 3 (logged in only link)
    Link 4 (public only link)
    Link 5 (logged in only link)
    Link 6 (public link)
    My initial thought was to have each link basically as a content item and assign it a security group, which will show or hide the link based on the users role. I think that would work pretty well for this page, but then we have an "About" page which is literally just 3 paragraphs of content, but if you are logged in, there is a link in the middle of one of the paragraphs. If this is a contribution region, I dont know how to tag that "partial" piece of content to not show with the overall content. This 2nd example does not seem to work with the 1st examples solution, and I want to find a solution that will work for the entire site.
    Any suggestions? I'm sure there are pieces of this that weren't clear, so if there's anything I can clarify, please let me know!
    Thanks,
    Dave
    Edit: I should mention I am using 10gr4
    Edited by: dpagini on Mar 12, 2010 1:10 PM

    Thanks for the reply, sapan.
    As I mentioned, I think that model could work pretty well for me in that one example, but I also have a different type of content, outlined below which this solution will need to work for.
    My page would look like this:
    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam arcu urna, suscipit ac sollicitudin eu, aliquet sit amet mi. In ut consectetur orci. Nam tempus diam at nisi lobortis sit amet volutpat tortor rhoncus. Vivamus dignissim tincidunt eros vel congue. Pellentesque sagittis tellus non enim euismod in vehicula nibh ullamcorper. Ut dignissim, elit a fringilla lacinia, lectus dolor tempus risus, ut ullamcorper dolor mauris et sapien. Ut non consequat mauris. Sed tempus egestas tortor, in fringilla urna porta nec. Ut in pretium massa. Phasellus sed augue et sem egestas faucibus. Duis ligula ligula, condimentum a tristique nec, faucibus non enim. Quisque pretium sapien et nibh eleifend imperdiet sed sed diam. Proin at orci odio.
    LINK >>
    Nullam vitae molestie lectus. Quisque in nunc orci. Duis ultrices ullamcorper metus nec aliquam. Sed ac aliquet massa. Nulla dapibus vestibulum magna, ultricies molestie mauris ultrices vel. Maecenas sit amet accumsan augue. Sed risus arcu, rhoncus ut porta nec, mattis eu velit. Vivamus ligula odio, gravida eu tempus eleifend, elementum ut dui. Nulla fermentum placerat varius. Praesent aliquet scelerisque dolor, id laoreet orci posuere sit amet. Pellentesque dignissim tincidunt ante, sit amet commodo arcu euismod nec. Vestibulum facilisis aliquam scelerisque.
    In this page, I would only want to present the logged in users the "LINK" at the end of the first paragraph. I see how I could easily wrap that part in the iDoc if statement, but I want to keep this whole section of content as one contribution region that a contributor could edit right on the page, and not have to know iDoc script. Do you see my problem?
    Thanks.

  • Need help creating text based game in Java

    Alright, I'm taking a big leap and I'm jumping a little out of league here. Anyways here are my two classes...I'm sure I've got plenty of errors :-/ One other thing. I have only programmed the battle section of the program so don't worry about the other 5 sections when fixing the code.
    import cs1.Keyboard;
    public class Knights
        public static void main (String[] args)
            // Object Declaration
            KnightsAccount player1 = new Account (1, 100, 200);
            // variable declarations
            boolean run = true;
            int choice;
            // Game Start
            System.out.println ("Welcome to Knights.");
            System.out.println ("--------------------------------------");
            System.out.println ("You are a level 1 character.  With 100 HP and 200 gold...good luck.");
            System.out.println ();
            while (run == true)
                System.out.println ();
                System.out.println ("Enter the number of the option you would like to do");
                System.out.println ();
                System.out.println ("1. Battle");
                System.out.println ("2. Train");
                System.out.println ("3. Work");
                System.out.println ("4. Rest");
                System.out.println ("5. Stats");
                System.out.println ("6. Quit");
                choice = Keyboard.readInt();
                if (choice == 1)
                    player1.battle();
                else if (choice == 2)
                    player1.train();
                else if (choice == 3)
                    player1.work();
                else if (choice == 4)
                    player1.rest();
                else if (choice == 5)
                    player1.stats();
                else
                    run = false;
    }And here is the second class...
    import java.util.Random;
    public class KnightsAccount
        public String winner;
        public int exp = 0;
        public void Account (int level, int hitPoints, int gold) {}
        public battle ()
            Random generator = new Random();
            int pumpkinHP = 80;
            int playerAttack, pumpkinAttack;
            System.out.println ("Engaged in combat with an Evil Pumpkin!");
            while (hitPoints > 0 && pumpkinHP > 0)
                if (pumpkinHP > 0)
                    playerAttack = generator.nextInt(15);
                    hitPoints -= playerAttack;
                    System.out.println ("Player 1 attacked Evil Pumpkin for " + playerAttack + ".");
                    System.out.println ("Evil Pumpkin has " + hitPoints + " HP left.");
                if (pumpkinHP <= 0)
                    pumpkinDead();
                if (hitPoints > 0 && !(pumpkinHP <= 0))
                    pumpkinAttack = generator.nextInt(12);
                    hitPoints -= pumpkinAttack;
                    System.out.println ("Evil Pumpkin attacked Player1 for " + pumpkinAttack + ".");
                    System.out.println ("Player 1 has " + pumpkinHP + " HP left.");
                if (hitPoints <= 0)
                    playerDead();
            return winner;
        private pumpkinDead ()
            System.out.println ("Success!  You have defeated the Evil Pumpkin with " + hitPoints + "HP left!");
            System.out.println ("For you good deed you earned 20 exp.");
            exp += 20;
            return exp;
        private void playersDead ()
            System.out.println ("You have been defeated.  Go home before we pelt melty cheeze at you.");
    }Whoever can help me I'd be grateful. I know there are probably a lot of things wrong here. Also if some of you could post your AIM or MSN so that I can get some one on one help on any of the smaller problems I run acrost that would help a lot too.
    Duke dollars to whoever helps me ;)
    AIM: Trebor DoD
    MSN: [email protected]

    You should really create a GameCharacter object that contains the
    statistics for a character (player or non-player) in the game.
    public class GameCharacter {
       private double attackStrength;
       private double defenseStrength;
       private String name;
       private String[] bodyParts;
       private Random = new Random();
    public GameCharacter(String name, String[] bodyParts, double attackSt, double defenseSt){
       this.attackStrength = attackSt;
       this.defenseStrength = defenseSt;
       this.bodyParts = bodyParts;
       this.name = name;
    // put lots of methods in here to get and set the information
    public String getName(){
      return this.name;
    public String getRandomBodyPart(){
       return this.bodyParts[random.nextInt(this.bodyParts.length)];
    }You then create your "knight" character and your "rabid pumpkin"
    character.
    Your fight method then just takes two GameCharacter objects and uses
    the information they contain to fight the battle.
    public void fight(GameCharacter a, GameCharacter b) {
       boolean fightOver = false;
       Random rn = new Random();
       double attackValue;
       while(!fightOver) {
           attackValue = a.getAttackStrength()*rn.nextDouble();
           System.out.println(a.getName()+" attacks "+b.getName()+"'s "+b.getRandomBodyPart()+" for "+attackValue+" points");
    }The above is not the fighting loop of course. I just put it in to
    demostrate how the fight method can be made generic. It takes any
    two characters and uses their defensive and attack information to
    calculate the fight outcome. It also uses the descriptions that the characters have
    to make the fight more interesting. (the getRandomBodyPart method in
    particular)
    matfud

  • Ideas for huge text area

    Our Document Control person catalogs documents in a form I've created. We are a spice manufacturer (ahhhh, but alas, I can't smell them anymore while here! )  In one text area on the form she lists associated items, for example PL-1234 is a pallet layout for all of our jars, so that text area for document PL-1234 might have eighty item numbers, each five or six chars listed in the field. In addition, there are verification sheets, assembly instructions, work instructions, all catalogued, and all with that associated items field holding many many many item numbers.  Production workers on the floor then will enter the item number that they are making for the day and a list of all the documents they need for producing the item will display in an interactive report, where they will then call up those they need (touch screens to boot!!).
    I've never liked this solution but she wanted to be able to copy and paste into the list from another source [WARNING WARNING DATA CONSISTENCY NIGHTMARE!! - spaces, dashes, commas, yeah yeah, I know].  Recently, when we did a version upgrade, I realized I had truncated the field when I exported to Excel and the text area got chopped (thankfully less than ten and easily fixable), not at exactly 1024 chars, but something in that random neighborhood.  Before you fall off your chair laughing or roll your eyes at my naiveté-learn-as-I-go education, I'm looking for another way to handle this clump of data.
    I have collections on the form, which was how I wanted to handle this a few years ago when I created it, then she'd have to enter those items manually, and the potential of inaccuracies is huge.  So I'm thinking I should just continue to let her enter those items in the same manner, then reformat it and plunk it into a table that joins to the document table.
    I apologize for not having the jargon.  I hope this makes sense.  Thanks in advance for any suggestions you see fit.
    Alexandra
    Application Express 4.2.2.00.11
    Edit 1
    Not only the above, but in the interactive report, as far as I've always known, that associated items field must be visible on the interactive report with allllllllllllll those items listed for it to be searched by the production floor. Please advise.
    Edit 2
    Just an example of the bald spots on my head: 430922 42181 &lt;- 42182 &lt;- 42183 &lt;- 42184 &lt;- 42186 &lt;- 42188 &lt;- 42190 &lt;- 42192 &lt;- 42194 &lt;-

    4000 characters is the limit you should be seeing, not 1024 (unless that is the size of the column in your table)
    There is a DB Parameter for 12c that should jump that up to 32k
    If it really is a 4000 character limit, there is a plugin that can help out: - Dynamic Action Plugin - Enkitec CLOB Load
    I can't advise you on the 1st edit.  not enough info (a 'sample' on apex.oracle.com would be nice)
    For processing, you'll need to read a lot of fantastically written manuals:
    use (??does apex have something)/UTL_URL  to change HTML code like "&lt;" into "<"
    you may need to use DBMS_LOB and LOOP over the CLOB in 4000 byte chunks.
    use REGEXP_REPLACE to add hair back to your head (ie convert commas and spaces to single tab, remove nonsense characters, etc.)
    use APEX_UTIL.string_to_table() to convert the entries in a table-like format.
    make sure that the above is reusable as you'll want to use it once for Validation and once for Processing
    use FORALL to professionally bulk-insert the results into a child table
    use LISTAGG in your SELECT statements to convert the Relational version of the data back into something that looks like what was entered.
    use CREATE PACKAGE so you don't go insane in the future.  This is a lot of code to write.
    use SQL Developer to actually develop the PL/SQL code
    use a code repository like SVN so you can 'rollback' your new-and-imporved-but-buggy versions.
    and, most importantly, use sufficient comments and APEX_DEBUG.MESSAGE() in your code so that future developers can pickup where you stopped.

  • IPhone game controller idea for free

    Hi,
    I have an idea for iPhone/iPod Touch game controller and i want to share it with all and especially Apple Engineering team.
    I don't know how to contact this team - they like living in the atomic bomb shelter - so i'm making post here - maybe they hear something.
    The concept and description of my idea is publicly available at my site - itunesworldwide.com.
    Bye.

    I don't know how to contact this team
    http://www.apple.com/feedback

  • I'm looking for a text/music notation app

    I am a drummer in a cover band who would like to use my iPad for my shorthand version of drum charts.  What I currently have is a paper notebook, in which I have dedicated a page for each set.  On each page, I have the song title, then the main drum beat(s) (written in musical notation), followed by any notes regarding arrangement, tempo, etc.  All of this is condensed down into a couple of lines, so I can fit about 10 songs on each sheet of paper.  I could scan in what I have now and view it that way, but I would rather have clear and editable digital based notation and text.  Does anything like this exist, not for composing and arranging orchestral pieces, but for simply inserting a bar or 2 of music into some text?
    In other words:
    Locked Out Of Heaven    I------------------------------------I   Intro/V/PC/C/V/C etc...        120 bpm
                                         I---Musical notation---------I
                                         I------------------------------------I
                                         I------------------------------------I

    If Settings -> General -> Accessibility -> VoiceOver does not work, then it is unlikely iBooks will do text to speach on its own in the current version.
    <http://www.apple.com/feedback>
    I know that some competing services, Kindle, Nook, etc... are restricted in doing text to speach by the book publishers.
    If this is text in a PDF (not an ebook), then maybe there is another app that can to text to speach on PDFs.
    If it is published books that are of interest, there is Audible.com <http://www.audible.com/>
    In theory it should be possible to use the Mac OS X Text to Speach facilities to convert a document into an audio file, and they sync that to the iPod Touch.  I assume there is similar text to speach utilities for Windows systems.
    I'm also guessing that there are web sites dedicated to assisting sight impaired individuals that might provide ideas for getting text to speach options for the iPod Touch.

  • Remembering/updating values (text based combat)

    So I'm making a simple text based game where I have a (so far) very simple combat system.
    I'm using a switch-thingy where I can choose some spells to attack with, and after I made my choice the attack is performed and then the enemy gets to attack then the switch loop starts over. Probably not the best solution, but it'll have to do for now (or?). I and the enemy has a specified amount of health, but here's the simple problem; both me and my enemy will obviously starts counting health from full every time. How would I make the value being stored after every loop?

    It should be outside the loop, unless I'm mistaken. My code basically looks like this
    public class combat
         public static void main (String [] args)
              *variables*
              do
                   *loop*
                        *cases* (different spells)
                   if *my attack hits*
                        *print result to combat log*
                   else
                        *print result to combat log*
                   if *my enemy hits*
                        *print to combat log*
                   else
                        *print to combat log*
    }Don't I have to do something more to make the variable save between the loops? It doesn't do that at least.

Maybe you are looking for

  • Problem setting maximum characters for a date field.

    Good morning all. I am trying to ensure that a date field on the form I am working on validates if the entry is not more than 8 digits, and if it is more, it should display a message, and return the focus back to the field until it is correct. Below

  • Acrobat X Pro ouput preview issue

    I have recently upgraded Acrobat from version 9 to 10. I frequently use the separations preview in the Output Preview tool to check the black separations on PDF files I receive for printing. When I try to click the black separation on and off again,

  • Need a internet download manager integration add on for waterfox

    was running latest Firefox,changed to water-fox for win7 64bit.got a message saying i needed to get integration module./extension?

  • Catalog for search

    Hi All, I want to know if WebLogic supports building a catalog for searching my website. The feature is available in Microsoft SiteServer. Or is there any third-party tool which i can use with WebLogic. Thanx and regards Samanth V Athrey

  • Unlimited exports not working

    I just paid $19.99 for unlimited pdf exports and adobe only gave me one as a "trial offer".  This is not a professional way to run a business and I need to convert a Polish export form into Word and then English now.  This is crap.