Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
csci71-lib
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Brian Guadalupe
csci71-lib
Commits
2794776d
Commit
2794776d
authored
Mar 26, 2023
by
Brian Guadalupe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Made program line highlight change color based on TM state
parent
19fcba12
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
3 deletions
+11
-3
gui.rkt
tm/gui.rkt
+11
-3
No files found.
tm/gui.rkt
View file @
2794776d
...
...
@@ -44,8 +44,12 @@
(
tape-cell
tape-idx
(
tape-at
tm
tape-idx
)
(
=
tape-idx
(
tape-pos
tape
))))))))
(
define
YELLOW
(
make-color
240
198
116
))
(
define
GREEN
(
make-color
185
202
74
))
(
define
RED
(
make-color
204
102
102
))
; render single line from program listing
(
define
(
program-line
linestr
[
in-focus?
#f
])
(
define
(
program-line
linestr
state
[
in-focus?
#f
])
(
overlay/align
"left"
"middle"
(
text/font
linestr
18
"black"
...
...
@@ -53,7 +57,10 @@
"modern"
"normal"
"normal"
#f
)
(
rectangle
(
*
TAPE-WIDTH
40
)
30
"solid"
(
if
in-focus?
(
make-color
240
198
116
)
(
match
state
[
'accept
GREEN
]
[
'reject
RED
]
[
'running
YELLOW
])
"white"
))))
; display 10 lines at a time
...
...
@@ -70,7 +77,8 @@
""
;(string-append (~r i #:min-width 4) " "
(
stmt->string
(
vector-ref
(
tm-config-program
tm
)
i
)))
;)
(
vector-ref
(
tm-config-program
tm
)
i
)))
(
tm-config-state
tm
)
(
=
i
(
tm-config-line-no
tm
)))))))
(
define
(
render-status
tm
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment