Skip to content

Commit

Permalink
Bug fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonHK committed Dec 4, 2016
1 parent 4e0781a commit 2e1b6d0
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions Brainfuck.vb
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,29 @@
If Not ForceStop Then
Select Case Code.Chars(index)
Case ">"
CellPointer += 1
Try
CellPointer += 1
Catch ex As OverflowException
CellPointer = 29999
End Try
Case "<"
CellPointer -= 1
Try
CellPointer -= 1
Catch ex As OverflowException
CellPointer = 0
End Try
Case "+"
Try
Cell(CellPointer) += 1
Catch ex As OverflowException
Cell(CellPointer) = -128
End Try
Case "-"
Cell(CellPointer) -= 1
Try
Cell(CellPointer) -= 1
Catch ex As OverflowException
Cell(CellPointer) = 127
End Try
Case "."
MainForm.BrainfuckOutput(Cell(CellPointer))
Case ","
Expand Down

0 comments on commit 2e1b6d0

Please sign in to comment.