Hey im studying first year java at university and i dont understand the questions and how we are supposed to go about them, if you could help it i would be thankful. Files of assignment attached below. http://www.mediafire.com/download.php?i1nvf477tc11c0v
better give the questions now I will help you to solve!
The first question is stage 1 where your supposed to Draw the 2D array of coloured cells. It says The cells are randomly assigned colours. So i did this: for(int i=0; i<cellBlock.length; i++){ for(int j=0; j<cellBlock[i].length; j++){ int k = (int)(Math.random()*6); g.setColor(COLOURS[k]); g.fillRect(i*CELL_SIZE+CELL_SIZE, j*CELL_SIZE+3*CELL_SIZE, CELL_SIZE, CELL_SIZE); } I changed the placements of the things so i can see them and the buttons, anyway later when it gets to stage 4 it says each cell stores the index of its fill colour but im wondering how are you supposed to randomize a colours and store them so i can call them later on. Also for stage two it has public int getCellColourIndex(int row, int col) {} and public void setCellColourIndex(int row, int col, int colourIndex) {} Im wondering what is it supposed to get and set. Thanks for help
|dw:1348897240992:dw|
|dw:1348897440542:dw|
Join our real-time social learning platform and learn together with your friends!