My Profile

Lakhvir.Singh Offline Male 

Exalted and Worshipped Member

Last Activity 11-03-2014

Write a Message

You are not able to post a message.

Showing 31 to 40 of 191

My messages
  1. Made a global Boolean training or whatever you want to call it... Which is set to true when the 4th menu option is selected and false when 1 is selected...

    Then changed the display cavern method slightly to this....

    Code:
    void displayCavern(char[][] cavern, Logical monsterAwake) {
    		int count1;
    		int count2;
    		for (count1 = 1; count1 <= N_S_DISTANCE; count1++) {
    			console.println(" ------------- ");
    			for (count2 = 1; count2 <= W_E_DISTANCE; count2++) {
    				if (cavern[count1][count2] == ' '
    						|| cavern[count1][count2] == '*'
    						|| (cavern[count1][count2] == 'M' && monsterAwake.is)
    						|| (cavern[count1][count2] == 'M' && training)
    						|| (cavern[count1][count2] == 'T' && training)) {
    					console.print("|" + cavern[count1][count2]);
    				} else {
    					console.print("| ");
    				}
    			}
    			console.println("|");
    		}
    		console.println(" ------------- ");
    		console.println();
    	}
    Probably a much neater way of doing it but this works
  2. I think making sure you can't go out of bounds is a given, will eat some kind of inanimate object if that doesn't come up :P

    Allowing Lower and upper case inputs is a good quick question so I'm expecting that.

    Making the traps and monster show up in the training game at all times, like they're supposed to.

    Changing the number of traps is another one which seems to be an obvious change to make.

    these are the obvious ones that I am expecting to come up, maybe a couple more but I'm not really sure how many alterations they will ask us to make...
  3. I don't mind answering questions, but I don't really have a file with all of the changes, most of the time when I see or think of something new I just make the changes to try it out on a fresh copy of the skeleton code and delete them afterwards ...
  4. I'm fairly sure it won't get mentioned, they have better stuff to ask us on the short questions, and it seems pretty trivial to me..

    I'll try and explain Exception e, basically by this you are saying you want to catch all exceptions that occur between the try and the catch, and you are going to call that exception e, there are other more specific exceptions such as FileNotFoundException etc, but I was just being lazy and catching everything xD
  5. This is essentially a problem with the AQAConsole class not the Monster game, but you can sort it out using a try catch block around the readChar bit like this...

    Code:
    char getMove() {
    		char move;
    		try{
    		move = console.readChar();
    		}catch(Exception e){
    			move = ' ';
    		}
    		console.println();
    		return move;
    	}
    Basically you are saying if you try and read an empty char and it causes an error just make move = ' ', or any other character you want here...

    (Pretty much irrelevant but i'll explain why the error happens... The problem with the console is that the readChar method actually works by reading in a string then taking the 1st character using the charAt(0) method, so if you just press enter you have a string that is empty and there isn't a chat at position 0 so Java complains...)
  6. Hi, I saw on one of the boards that you had the tutor2u revision guide for Buss3, I was wondering if you could e-mail it me>
  7. Our teacher is actually pretty good, but I don't think you can really guess what'll come up in section B to be honest. On previous years it was literally just implementing pseudo code for bubble sort and linear search, but maybe it'll be something different this year.. ?
  8. bleh... I meant B
  9. That's what my teacher said, he probably read it in a new spec guideline or something.

    He reckons it's because exams are getting harder, they want you to do more "unexpected" programming in section C, rather than what you can prepare for in Section D.

    You too
  10. Great thank you :] I'm been doing a lot of revision so kinda bored. But summer is soon to come! xD You? x

About Me

  • About Lakhvir.Singh

    Name
    Lakhvir
    Orientation
    Straight
    Star Sign
    Taurus

My Stats

Total Posts

Visitor Messages

General Information

  • Last Activity 11-03-2014
  • Join Date 17-06-2011

Location Birmingham(UK)

Join Date 17-06-2011

Total Posts 1,177

1 Groups My Groups

(1)My Social Groups
Article updates