Nand2Tetris .sh .bat file opening as a txt code file on Linux Ubuntu; made file executable [solved]

neutrino

New Member
Joined
Jan 26, 2022
Messages
15
Reaction score
0
Credits
165
1643613715142.png

1643613747401.png

I tried running this code but it doesn't run.
1643613772756.png


SOLUTION starts here:

In case anyone is having the same problem:

First go to the Nand2Tetris folder in the Graphical User Interface (normal screen), and then drag the folder 'TOOLS' into Terminal (open terminal) and it should come something like this: '/home/your user name/ downloads/nand2tetris/tools' (in quotes).
[In explanatory picture] : It shows something in blue color before the line mentioned above, ignore that, that's just mine.
Don't click ENTER just yet.

1643784427278.png


Then click CTRL + a (this should take you to the beginning of the last line of code [cursor in beginning of line shown in picture] And type in cd Then click ENTER.
1643784507365.png


Now it should take you into this downloads folder (i.e. it will show text like: /Downloads/nand2tetris... in blue color in terminal). (This won't be some text that you can edit, as this means you have entered into that folder on terminal, but its like an address).

Write this code in the terminal now: chmod +x HardwareSimulator.sh Then click Enter. Then type in ./HardwareSimulator.sh Then click Enter. It should open the simulator now. Remember H and S will be capital.
Run the same codes for CPU Emulator, namely: chmod +x CPUEmulator.sh Then click Enter. Then type in ./CPUEmulator.sh
Then click Enter. It should open the emulator now. Remember CPU and E for Emulator will be capital.

Same is shown in the image, but above is alt text: Type the two codes (for each simulator Hardware and CPU) in the terminal and it should run.
1643783985216.png

Hopefully this is clear lol I needed step by step instructions like this so I wrote it like that.
 
Last edited:



Members online


Latest posts

Top