!7 p-pretty { new CirclesAndLines cal; Circle a = cal.circle_autoVis("PLAYER", "Chess Player", 0.25, 0.75); Circle b = cal.circle_autoVis("PLAYER", "Chess Player", 0.75, 0.75); cal.arrow(a, "VS", b); cal.circle_autoVis("MAGNUS CARLSEN", 0.25, 0.25); cal.circle_autoVis("HIKARU NAKAMURA", 0.75, 0.25); Canvas canvas = cal.show(600, 600); nu(Thinker, +cal, +canvas).addControls(); } sclass Thinker { double delay = 2; // 2 seconds CirclesAndLines cal; Canvas canvas; JTextArea textArea; JButton btnThink, btnStartOver; volatile bool thinking; S status, initialStatus = "Set up."; O think; // func -> bool void addControls { swing { addToWindowRight(canvas, withMargin(vstackWithSpacing( jMaxWidth(167, jMinHeight(180, jscroll(textArea = setFontSize(16, makeBold(wordWrapTypeWriterTextArea()))))), btnThink = fatButton(100, "Think!", r { thinkOrStop() }), btnStartOver = fatButton(60, "Start over", r { startOver() }) ))); status = initialStatus; status(); } } void startOver { // todo } void run { repeat { sleepSeconds(delay); if (thinking) pcall { print("Thinking"); bool t; time { t = think(); } if (!t) { thinking(false); print("Done"); } else { print("Updating"); canvas.update(); } } } } void thinking(bool b) { thinking = b; status(); setText(btnThink, b ? "