Skip to content

Instantly share code, notes, and snippets.

@vgmoose
Created September 5, 2014 17:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vgmoose/2eeb200fba60753beccb to your computer and use it in GitHub Desktop.
Save vgmoose/2eeb200fba60753beccb to your computer and use it in GitHub Desktop.
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