From f74d9b115b0882ee3e2d8df5efb137456d4d2fc6 Mon Sep 17 00:00:00 2001 From: Steven Schronk Date: Tue, 5 Apr 2011 21:36:57 -0500 Subject: [PATCH] Fixed halting problem. Machine would run in an endless loop requiring a restart of the browser to halt program. This has been solved by creating a halt variable and adjusting it at the right places. --- TODO | 8 ++------ turing_tarpit.html | 1 + 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/TODO b/TODO index beac496..b57dbc2 100644 --- a/TODO +++ b/TODO @@ -1,15 +1,11 @@ Need method to load/save code for later use. -When in run mode, a SEGFAULT will cause an endless loop. - -Not displaying HALT message when in run mode. Caused by loop skipping comments. - Implement all instructions for language. Need stop button that works with endless loops. (Could pause program to allow button click?) Add ability to modify memory location at any time. -Sample programs in documentation that can be loaded into code window by clicking a button. - Find decent color scheme for the tool. Set some standards and put them in the page. + +Finish documentation for the tool along with examples. diff --git a/turing_tarpit.html b/turing_tarpit.html index 5cccf1b..0d67652 100644 --- a/turing_tarpit.html +++ b/turing_tarpit.html @@ -208,6 +208,7 @@ function stop() function run() { var total_steps = document.getElementById("code").value.length; + halt = false; /* seems weird, but this is the only way to make the halt work */ while(ins_pointer <= total_steps && halt == false) { step_next(); } } -- 2.11.4.GIT