Skip to content

Commit

Permalink
add left arrow for resetting tape position (related to #72)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
CSchank committed Mar 7, 2019
1 parent 7f3afb8 commit 7b8ae0f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Simulating.elm
Original file line number Diff line number Diff line change
Expand Up @@ -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 ->
Expand Down

0 comments on commit 7b8ae0f

Please sign in to comment.