jimbob1872's Profile User Rating: -----

Reputation: 1 Apprentice
Group:
Members
Active Posts:
16 (0.03 per day)
Joined:
08-January 13
Profile Views:
487
Last Active:
User is offline Nov 19 2013 09:15 AM
Currently:
Offline

Previous Fields

Country:
GB
OS Preference:
Windows
Favorite Browser:
Chrome
Favorite Processor:
Who Cares
Favorite Gaming Platform:
XBox
Your Car:
Ford
Dream Kudos:
0
Icon   jimbob1872 has not set their status

Posts I've Made

  1. In Topic: Java Console as a GUI

    Posted 8 Apr 2013

    forgive me, by eclipse console i meant the output of the console view in Eclipse IDE and by external console i meant place that text into a separate Jframe gui
  2. In Topic: moving a token

    Posted 29 Mar 2013

    View PostMartyr2, on 29 March 2013 - 12:12 PM, said:

    I think it is because you have your token positioning inside the for loop. This means that when you pass "1" to displaytoken it is going to be adding 1 to tokenpositiony each time around the outer for loop. Meaning that essentially you are adding 1 to the token y position "i" number of times. So both the token position for x and for y should probably be outside the loop so that you do the loops, then you set tokenpositionx and tokenpositiony the correct number of positions and then set it on the board.

    Hope you get what I mean. :)/>


    I changed it to the way you described I think but when testing with the token set on 3,3 it just runs the method and then shows the board with the token on 0,1 as if its setting the co-ordinates back to 0,0 and adding 1?

    	public void displayToken(int a, int B)/>{
    
    
    		for(int i=0; i < (width-1); i++){
    			for(int j=0; j < (height-1); j++){
    				board[i][j].tokenPos(false);
    			}
    		}
    		tokenpositionx = tokenpositionx + a;
    		tokenpositiony = tokenpositiony + b;
    
    		board[tokenpositionx][tokenpositiony].tokenPos(true);
    
    	}
    
    	public void moveTokenUp(){
    
    		if((board[tokenpositionx][tokenpositiony].up == false)){
    		System.out.println("Cannot make that token move.");
    		
    		}
    		
    		else if((board[tokenpositionx][tokenpositiony].up == true && board[tokenpositionx][tokenpositiony+1].down == true) ){
    			displayToken(+0,+1);
    			
    			showBoard();
    		}
    	}
    
  3. In Topic: moving a token

    Posted 29 Mar 2013

    so it was just the one bracket on the for loop, you were right. thank-you very much
  4. In Topic: algorithm time complexity big oh-notation

    Posted 27 Feb 2013

    Now I see it. The two Thalfs at the end make a full O(n) when they are added am I correct?
  5. In Topic: fork() process understanding

    Posted 23 Feb 2013

    View Postjjl, on 23 February 2013 - 03:31 PM, said:

    Quote

    how many processes are created by this program? I have 6 in my head because I think the new child becomes an adult to the next fork() child? or am i looking at this all wrong?


    Your correct, there will be 6 total processes created from the main parent process. That's the right way to think about it.


    Thanks for the reply! Good to know I'm understanding it a bit better!

My Information

Member Title:
New D.I.C Head
Age:
Age Unknown
Birthday:
Birthday Unknown
Gender:
Years Programming:
3
Programming Languages:
JAVA
C
HTML
VISUALBASIC

Contact Information

E-mail:
Private

Friends

jimbob1872 hasn't added any friends yet.

Comments

jimbob1872 has no profile comments yet. Why not say hello?