From 7b8ae0f7228d9be0d779d84bfddb7d4d859b9fc7 Mon Sep 17 00:00:00 2001 From: CSchank Date: Thu, 7 Mar 2019 18:11:23 -0500 Subject: [PATCH] add left arrow for resetting tape position (related to #72) For now, we will not go backwards as I believe this would imply that machines can go backwards and forwards. However, having the left arrow reset the tape to the beginning is helpful. --- src/Simulating.elm | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Simulating.elm b/src/Simulating.elm index 887afb1..d398112 100644 --- a/src/Simulating.elm +++ b/src/Simulating.elm @@ -375,6 +375,14 @@ update env msg ( model, pModel, sModel ) = _ -> ( ( model, pModel, sModel ), False, Cmd.none ) + else if k == 37 then + --left arrow key + case model of + Default tId _ hErr -> + ( (Default tId -1 hErr, { pModel | currentStates = sModel.machine.start }, sModel), False, Cmd.none) + _ -> + ( ( model, pModel, sModel ), False, Cmd.none ) + else case model of Editing tapeId ->