Skip to content

Commit ddfb230

Browse files
committed
Updated Readme & Fixed bug where tsting nonexistent registers produced the same outcome as if it wasn't empty
1 parent aeda52e commit ddfb230

2 files changed

Lines changed: 17 additions & 14 deletions

File tree

README.md

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,25 @@ https://felixselter.github.io/MurmelRechner/
55

66
## Features
77
### Simple Interface
8-
![interface](https://user-images.githubusercontent.com/55546882/148061728-c91ef4a3-7253-462c-a496-3d371ab28062.png)
8+
![interface](https://github.com/dgc08/MurmelRechner/assets/83305972/5ea747a5-26ef-48a5-a78a-061b8ce71629)
99

1010

1111

1212
1. ![load](https://user-images.githubusercontent.com/55546882/148061658-23e483ff-5fa8-421a-987d-3a59a4d7e3a9.png)Load your code
1313
2. ![save](https://user-images.githubusercontent.com/55546882/148061734-76d495be-0aa4-4a37-bc56-749a2ee2a5ba.png)Save your code
1414
3. ![flowchart](https://user-images.githubusercontent.com/55546882/148061724-ec8d5d28-309d-4873-9a26-0d2c2632fcfc.png)Generate a flowchart
15-
4. ![formatt](https://user-images.githubusercontent.com/55546882/148061725-5dd9ab94-e5de-476d-9c81-bc6047056b68.png)Format your code
16-
5. ![addregister](https://user-images.githubusercontent.com/55546882/148061720-bbba2f11-c7d2-4f93-878c-190373f1dd6c.png)Add a register/marble store
17-
6. ![removeregister](https://user-images.githubusercontent.com/55546882/148061732-5c8047ac-b223-43e6-ae67-c945243b703d.png)remove the last register/marble store
15+
4. ![format](https://user-images.githubusercontent.com/55546882/148061725-5dd9ab94-e5de-476d-9c81-bc6047056b68.png)Format your code
16+
5. ![add_register](https://user-images.githubusercontent.com/55546882/148061720-bbba2f11-c7d2-4f93-878c-190373f1dd6c.png)Add a register/marble store
17+
6. ![remove_register](https://user-images.githubusercontent.com/55546882/148061732-5c8047ac-b223-43e6-ae67-c945243b703d.png)remove the last register/marble store
1818
7. ![execute](https://user-images.githubusercontent.com/55546882/148061722-fc562d36-48a9-440c-a553-324a4acfd91c.png) Execute your entire code
1919
8. ![nextline](https://user-images.githubusercontent.com/55546882/148061731-c0e88d8e-d888-41f8-b9b3-b62d47ea682d.png)Execute this line. The current position is indicated by this pointer ![pointer](https://user-images.githubusercontent.com/55546882/148063270-7ed1955c-bf79-44c1-9df1-51b103d24272.png)
2020
9. ![Stop](https://user-images.githubusercontent.com/55546882/150634279-bcd4c7cb-d995-4677-8b91-fbf1a7b0f7e3.png) Click this to stop your program if youre stuck in an infinite loop
21-
10. ![collaboration](https://user-images.githubusercontent.com/55546882/148063904-1a50f737-1c97-4c0d-9cb0-a13fb65e0db7.png)Enable the collaboration mode
22-
11. ![fullscreen](https://user-images.githubusercontent.com/55546882/148063906-0b35c442-9ec7-43fc-bda9-a5f57d8bd66f.png)Enter the fullscreen mode
23-
12. ![id](https://user-images.githubusercontent.com/55546882/148065155-0ce3572b-c0e5-4694-99be-06e547b85215.png) Click the id to get a link so you can invite others
24-
21+
10. ![increase_speed](https://user-images.githubusercontent.com/55546882/148061720-bbba2f11-c7d2-4f93-878c-190373f1dd6c.png)Increase Execution speed
22+
11. ![decrease_speed](https://user-images.githubusercontent.com/55546882/148061732-5c8047ac-b223-43e6-ae67-c945243b703d.png)Decrease Execution speed
23+
12. ![instruction_speed](https://github.com/dgc08/MurmelRechner/assets/83305972/abcc7713-6753-4f9d-8079-d02986e09a5a) Click the execution speed label to reset it to 1
24+
13. ![collaboration](https://user-images.githubusercontent.com/55546882/148063904-1a50f737-1c97-4c0d-9cb0-a13fb65e0db7.png)Enable the collaboration mode
25+
14. ![fullscreen](https://user-images.githubusercontent.com/55546882/148063906-0b35c442-9ec7-43fc-bda9-a5f57d8bd66f.png)Enter the fullscreen mode
26+
15. ![id](https://user-images.githubusercontent.com/55546882/148065155-0ce3572b-c0e5-4694-99be-06e547b85215.png) Click the id to get a link so you can invite others
2527
### Beautiful syntax highlighting
2628
![syntax](https://user-images.githubusercontent.com/55546882/148062386-b810ba2e-40a4-4183-a949-d1f27a3521c5.png)
2729

@@ -38,16 +40,17 @@ It can automatically generate a flowchart from your code
3840
### Collaborative editing:
3941
Enable the collaboration mode to work with others at the same time
4042

41-
Example multiplication code
43+
### Example multiplication code
4244
```
45+
; As long as the multiplier is not 0, continue with the program
4346
tst 0
4447
--jmp 4
4548
hlt
4649
47-
; Decrement the multiplier, done once in an iteration
50+
; Decrement the multiplier, done once per iteration
4851
dec 0
4952
50-
; Now decrement the multiplicand and add its content onto registers 2 and 3
53+
; Decrement the multiplicand until it's 0 and add its content onto registers 2 and 3
5154
tst 1
5255
--jmp 8
5356
jmp 12
@@ -56,7 +59,7 @@ inc 2
5659
inc 3
5760
jmp 5
5861
59-
; Move the multiplicand, now stored in the register 2, back to register 1
62+
; Move the multiplicand, now stored in register 2, back to register 1
6063
tst 2
6164
--jmp 16
6265
jmp 1

js/simulator.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ function executeLine() {
8787
break;
8888

8989
case 'tst':
90-
// If register exists and it does not conatin content
91-
if (registers[param] != null && !(registers[param] > 0)) line++;
90+
// If register doesnt exist or is null, skip next line
91+
if (registers[param] == null || registers[param] == 0) line++;
9292
break;
9393

9494
case 'hlt':

0 commit comments

Comments
 (0)