我使用ArrayDeque創建了一個基本的庫存系統,其中的東西被推入庫存。 Couch couch1 = new Couch("I wouldn't sit on it.", 100, true);
roomList[0].inventory.add(couch1);
我正在運行檢查以查看某個項目是否在像這樣的房間中。 if (input.matches(".*look.*"))
{
我有下面的代碼。 int clock;
ArrayDeque<Integer> q = new ArrayDeque<Integer>();
int customer = 1;
Random r = new Random();
for (clock = 0; clock <= 99; clock++) {
q.add(customer);
如前所述,我正在使用ArrayDeque邊緣的迭代器來查找具有最低路徑代價節點的圖塊。下面的代碼: public static void UCS(String filename)
{
//a double-ended queue, when used with "addFirst" and "remove", it's a LIFO queue
ArrayDeque<Node