Hello everybody,
I am new to all things .Net, but have several years experience of OOP in Java from my college days.
I have recently written a sliding block/tile type puzzle game in Java and I would now like to rewrite it in VB.Net. The programming construct I used to manage the logic behind the game was a LinkedList - each element of the list represented one block/tile.
Basically speaking In Java I coded the following:
Then after populating my list like so:Code:LinkedList tileManager = new LinkedList();
I could move the tiles in the list in the following manner.Code://The int[] tileLayout was used to hold the colour values //of the tiles - 0 for black, 1 for white. public void populateLinkedList(int[] tileLayout) { for(int i = 0; i < tileLayout.length; i++) { tileManager.add((Integer)tileLayout[i]); } }
How then would I go about coding the same functionality in VB.Net?Code://Note that the boolean variable direction used below was initialised //earlier in the code depending on the users actions. if(direction==true) { //Move the tiles clockwise in the list. tileManager.addFirst(tileManager.removeLast()); } else if(direction==false) { //Move the tiles anti-clockwise in the list. tileManager.addLast(tileManager.removeFirst()); }
Thank you for your help.
Regards,
The Thing.




Reply With Quote