0

I am working on cs50 mario less but im having trouble getting into the file mario.c In terminal I follow the steps to setting up the files and have no problem getting into the mario-less directory.

But from there whenever I try to open a file in mario-less directory code mario.c to get into that file never works. My terminal just stays in mario-less directory and I can never move into any of the files in the directory. Not sure why I'm stuck.

enter image description here

1 Answer 1

1

You understand that you have to click on the mario.c frame to start typing and entering code in the file, right? In the image you posted, this would be the frame with the lone number "1" showing. That shows the line number. You type your code in this frame/box.

Then, you have to save the file to preserve any changes, right?

Note the tabs at the top - pseudocode.txt, mario.c and population. Each of those is a file opened for editing. The highlighted one is the current file displayed in the editor frame.

The frame below it is the command line interface. That's NOT where you enter the code.

2
  • So which are you trying to do, write and save code or compile and execute code? You write and save the code in the editor window at the top. You compile and execute the code in the bottom frame. Specifically you do it in the directory mario-less, where the file mario.c resides. You're already in that directory. To compile, the command is make mario. To run the executable file, it's ./mario
    – Cliff B
    Jul 30 at 23:46
  • Yes thank you! now ./mario works, which I thought I was supposed to do so execute commands but with my files were not in the right folder. the ./mario was giving me no file or directory because of that. I had to go back a redo things step by step. I think when I first was getting everything set up, the zip opened in my population folder from the last exercise. When I deleted that population folder plus my old mario-less folder and started from scratch, without the population folder there, the zip went into the right folder and my commands would work.
    – thisisjax
    Aug 1 at 15:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .