2D-int-array shuffle

im neu in diesem, aber im tring zu tun, eine hotel-Reservierung-Programm.

Also ich habe ein 2D-int-array mit ALLE Zimmer, wenn ich das Programm starten möchte ich Ihnen zufällig shuffle Sie in einem array mit dem Namen RoomNotInUse oder RoomInUse (so evertime ich das Programm starten und die Zimmer werden nach dem Zufallsprinzip generiert.

Wäre genial wenn jemand weiß einen Weg, um dieses 🙂

//ARRAYS
protected static int[][] rooms = {
{1,1}, {1,2}, {1,3}, {1,4}, {1,5}, 
{2,1}, {2,2}, {2,3}, {2,4}, {2,5}, 
{3,1}, {3,2}, {3,3}, {3,4}, {3,5}, 
{4,1}, {4,2}, {4,3}, {4,4}, {4,5}, 
{5,1}, {5,2}, {5,3}, {5,4}, {5,5} 

};
//Declare all hotel rooms 5x5, the first number is the floor and the sec is the room
private char[][] ROIU = {

};
//Rooms not in use
private char[][] RIU = {

};
//Rooms in use


public class roomShuffle {

}
//Shuffle all rooms in 2 diffrent arrays, ROIN and RIU

public class RoomNotInUse {

}
//Displayes all the rooms thats not in use  

public class RoomInUse {

}
//Displayes all rooms in use

}

InformationsquelleAutor Erazx | 2013-11-25
Schreibe einen Kommentar