createCanvas(windowWidth, windowHeight);
bin = loadImage("ビンソート.png");
sel = loadImage("選択ソート.png");
ins = loadImage("挿入ソート.png");
hid = loadImage("隠す.png");
text("広島県の島のソートクイズ", 100, 100);
button = createButton("第1問");
button.position(900, 40);
button.style("width", "120px");
button.style("height", "70px");
button.mousePressed(BMP);
button = createButton("第2問");
button.position(1050, 40);
button.style("width", "120px");
button.style("height", "70px");
button.mousePressed(BBMMPP);
button = createButton("第3問");
button.position(1200, 40);
button.style("width", "120px");
button.style("height", "70px");
button.mousePressed(BBBMMMPPP);
image(hid, 100, 180, 1300, 700);
image(bin, 100, 200, 1300, 650);
text("広島県の島のソートクイズ", 100, 100);
text("Q.正しいのはどれ?", 100, 180);
button = createButton("ビンソート");
button.position(1450, 200);
button.style("width", "120px");
button.style("height", "70px");
button.mousePressed(firstTrue);
button = createButton("せんたくソート");
button.position(1600, 200);
button.style("width", "120px");
button.style("height", "70px");
button.mousePressed(firstFalse);
button = createButton("そうにゅうソート");
button.position(1750, 200);
button.style("width", "120px");
button.style("height", "70px");
button.mousePressed(firstFalse);
image(hid, 100, 180, 1300, 700);
image(sel, 100, 190, 1300, 700);
text("広島県の島のソートクイズ", 100, 100);
text("Q.正しいのはどれ?", 100, 180);
button = createButton("ビンソート");
button.position(1450, 200);
button.style("width", "120px");
button.style("height", "70px");
button.mousePressed(secondFalse);
button = createButton("せんたくソート");
button.position(1600, 200);
button.style("width", "120px");
button.style("height", "70px");
button.mousePressed(secondTrue);
button = createButton("そうにゅうソート");
button.position(1750, 200);
button.style("width", "120px");
button.style("height", "70px");
button.mousePressed(secondFalse);
image(hid, 100, 180, 1300, 700);
image(ins, 100, 190, 1300, 700);
text("広島県の島のソートクイズ", 100, 100);
text("Q.正しいのはどれ?", 100, 180);
button = createButton("ビンソート");
button.position(1450, 200);
button.style("width", "120px");
button.style("height", "70px");
button.mousePressed(thirdFalse);
button = createButton("せんたくソート");
button.position(1600, 200);
button.style("width", "120px");
button.style("height", "70px");
button.mousePressed(thirdFalse);
button = createButton("そうにゅうソート");
button.position(1750, 200);
button.style("width", "120px");
button.style("height", "70px");
button.mousePressed(thirdTrue);
image(hid, 1400, 300, 600, 500);
text("正解!これはビンソートです!\n\nもしも並べかえる島が\n100個あったとき、\n対応する場所をさがすのが\nとても大変です。\n\nつまりビンソートには、\nあまりにもたくさんの量の\n並べかえをするのは\nむずかしいという弱点がある!", 1450, 400);
image(hid, 1400, 300, 600, 500);
text("\n\n残念!これはビンソートでした!\n\nもう一度ちょうせんしてみよう!", 1450, 400);
image(hid, 1400, 300, 600, 500);
text("正解!\nこれはせんたくソートです!\n\n1番小さい数字を見つけては\n先頭と入れかえるので、\n先頭から確実に並べかえる\nことができます!\n\nしかし1番小さい数字を\n見つけるとき、数字を\nまちがえないことが大切です!", 1450, 400);
image(hid, 1400, 300, 600, 500);
text("\n\n残念!\nこれはせんたくソートでした!\n\nもう一度ちょうせんしてみよう!", 1450, 400);
image(hid, 1400, 300, 600, 600);
text("正解!\nこれはそうにゅうソートです!\n\n背の順で並ぶみんなの列に\nおくれてきた友達を\n入れてあげたいとき、\nその友達の並ぶべき場所に\n入れてあげるのも\nそうにゅうソートです!\n\nみんなが無意識にやっている\nソートで、そうにゅうソートが\n1番多いかなと思います!", 1450, 350);
image(hid, 1400, 300, 600, 600);
text("\n\n残念!\nこれはそうにゅうソートでした!\n\nもう一度ちょうせんしてみよう!", 1450, 400);