protected void discard(int card){
		assert(in_play[card-1] && action);
		action = false;
		in_play[card-1] = false;
		//Reshuffle, if no cards in draw pile
		if (draw_count == 0){
			has_shuffled = true;
			shuffle(false);
		}
		//Push to stack
		discard[discard_count++] = card;
		//Remove old reference to this card in memory
		int old_loc = memory_hash[card-1];
		if (old_loc >= 0)
			memory[old_loc] = 0;
		else if (memory_count < rack_size*2)
			memory_count++;
		//Add new reference to memory
		memory_hash[card-1] = memory_head;
		memory[memory_head] = card;
		memory_head = (memory_head + 1) % cards;
		if (!shuffling && gui != null)
			gui.discard(card);
	}