From d95b4854fb802659929d8d5c5aa44e51fe554772 Mon Sep 17 00:00:00 2001 From: Jason Orendorff Date: Mon, 23 Sep 2013 22:23:42 -0500 Subject: [PATCH] Reorder modes for functional style. --- calculator.html | 6 +++--- ui.js | 20 ++++++++++---------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/calculator.html b/calculator.html index 8335e87..521c66b 100644 --- a/calculator.html +++ b/calculator.html @@ -60,11 +60,11 @@

Compilers 101 Toy Calculator

diff --git a/ui.js b/ui.js index adc4275..dedf3f6 100644 --- a/ui.js +++ b/ui.js @@ -344,26 +344,26 @@ function go() { try { var result = parseModes[mode](question); switch (mode) { - case 'calc': - Shell.printAnswer(result); - break; - - case 'fraction': - Shell.printAnswer(result); + case 'json': + Shell.printAnswer(JSON.stringify(result, undefined, " ")); break; case 'blocks': writeNode("normalOutput", result); break; - case 'json': - Shell.printAnswer(JSON.stringify(result, undefined, " ")); - break; - case 'mathml': writeNode("normalOutput", result.element); break; + case 'calc': + Shell.printAnswer(result); + break; + + case 'fraction': + Shell.printAnswer(result); + break; + case 'graph': showPlot(result); break;