xxxxxxxxxx
73
master=[];
states=[];
capitals=[];
questionOrder=[];
function preload()
{
master=loadStrings("./Master.txt");
}
function setup() {
createCanvas(400, 400);
for(var i=0; i<50; i++)
{
questionOrder.push(i);
nextState=master[i];
found=false;
newState="";
newCapital="";
for(j=0; j<nextState.length; j++)
{
if((nextState[j]!= "-") && (!found))
{
newState=newState+nextState[j];
}
else if(nextState[j]=="-")
{
found=true;
newState=newState.substring(0, newState.length-1);
}
else if(found)
{
newCapital=newCapital+nextState[j];
}
}
states.push(newState);
newCapital=newCapital.substring(1, newCapital.length);
capitals.push(newCapital);
}
scrambleOrder();
}
function draw() {
background(220);
}
function displayCard()
{
answers=[];
}
function scrambleOrder()
{
numShuffles=10;
for(var i=0; i<numShuffles; i++)
{
for(var j=0; j<50; j++)
{
randInd=floor(random(50));
temp=questionOrder[j];
questionOrder[j]=questionOrder[randInd];
questionOrder[randInd]=temp;
}
}
}