Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
public static void study(FlashCard[] cards)
{
LinkedList<FlashCard> queue = new LinkedList<FlashCard>();
for (FlashCard c : cards)
queue.add(c);
do
{
LinkedList<FlashCard> correct = new LinkedList<FlashCard>();
boolean oneWrong = false;
FlashCard cur;
while (cur = queue.remove() != null)
{
boolean correct = quiz(cur);
if (correct)
correct.add(cur);
else
{
oneWrong = true;
queue.add(cur);
}
}
queue = correct;
} while (oneWrong);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment