Skip to content

Commit 45c424b

Browse files
committed
instructions
1 parent bb40a58 commit 45c424b

File tree

2 files changed

+12
-51
lines changed

2 files changed

+12
-51
lines changed

hello/Makefile

Lines changed: 0 additions & 4 deletions
This file was deleted.

hello/index.md

Lines changed: 12 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -22,53 +22,41 @@ Go to your Terminal. You should find that its "prompt" resembles the below.
2222

2323
jharvard@somewhere ~ %
2424

25-
Click inside of that terminal window and then type (on Mac OS):
26-
27-
mkdir ~/Documents/problems
28-
29-
followed by Enter in order to make a directory (i.e., folder) called `problems` inside of your Documents directory.
30-
3125
Here on out, to execute (i.e., run) a command means to type it into a terminal window and then hit Enter. Commands are "case-sensitive," so be sure not to type in uppercase when you mean lowercase or vice versa.
3226

3327
Now execute
3428

35-
cd ~/Documents/problems/
29+
cd ~/Documents/Programming/
3630

3731
to move yourself into (i.e., open) that directory. Your prompt should now resemble the below.
3832

39-
problems %
33+
jharvard@somewhere Programming %
4034

4135
If not, retrace your steps and see if you can determine where you went wrong.
4236

43-
Now, open Atom, point to the File menu and choose New. This will open a new editor with a blank "Untitled1" file in it. First thing to do is to give it a name and save it into your new directory. Press **CTRL-S** or **Cmd-S** to open the file dialog. For **Filename**, type `hello.c`. Then below, choose (click) the `Documents`, then the `problems` folder that you just created and click on **Save**.
37+
Now, open Atom, point to the File menu and choose New. This will open a new editor with a blank "Untitled1" file in it. First thing to do is to give it a name and save it into your new directory. Press **CTRL-S** or **Cmd-S** to open the file dialog. For **Filename**, type `hello.c`. Then below, choose (click) the `Documents`, then the `Programming` folder that you just created and click on **Save**.
4438

4539
In your new file, type the C code for "Hello, World" as seen above. Save it once more.
4640

4741
### Instructions for Windows
4842

4943
Go to your Terminal. You should find that its "prompt" resembles the below.
5044

51-
jharvard@somewhere ~ %
52-
53-
Click inside of that terminal window and then type (on Mac OS):
54-
55-
mkdir /mnt/c/Users/<Windows User Name>/Documents/Development
56-
57-
followed by Enter in order to make a directory (i.e., folder) called `Development` inside of your Documents directory.
45+
jharvard@COMPUTER:~$
5846

5947
Here on out, to execute (i.e., run) a command means to type it into a terminal window and then hit Enter. Commands are "case-sensitive," so be sure not to type in uppercase when you mean lowercase or vice versa.
6048

6149
Now execute
6250

63-
cd /mnt/c/Users/<Windows User Name>/Documents/Development
51+
cd /mnt/c/Users/<Windows User Name>/Documents/Programming/
6452

6553
to move yourself into (i.e., open) that directory. Your prompt should now resemble the below.
6654

67-
Development %
55+
jharvard@COMPUTER:Programming$
6856

6957
If not, retrace your steps and see if you can determine where you went wrong.
7058

71-
Now, open Atom, point to the File menu and choose New. This will open a new editor with a blank "Untitled1" file in it. First thing to do is to give it a name and save it into your new directory. Press **CTRL-S** or **Cmd-S** to open the file dialog. For **Filename**, type `hello.c`. Then below, choose (click) the `Documents`, then the `Development` folder that you just created and click on **Save**.
59+
Now, open Atom, point to the File menu and choose New. This will open a new editor with a blank "Untitled1" file in it. First thing to do is to give it a name and save it into your new directory. Press **CTRL-S** or **Cmd-S** to open the file dialog. For **Filename**, type `hello.c`. Then below, choose (click) the `Documents`, then the `Programming` folder that you just created and click on **Save**.
7260

7361
In your new file, type the C code for "Hello, World" as seen above. Save it once more.
7462

@@ -79,7 +67,7 @@ Next, type precisely the below (in lowercase), then hit Enter:
7967

8068
ls
8169

82-
You should see just `hello.c`. That's because you've just listed the files in that same folder, this time using a command-line interface (CLI), using just your keyboard, rather than the graphical user interface (GUI) represented by that folder icon. In particular, you *executed* (i.e., ran) a command called `ls`, which is shorthand for "list." (It's such a frequently used command that its authors called it just `ls` to save keystrokes.) Make sense?
70+
You should see just `Makefile` and `hello.c`. That's because you've just listed the files in that same folder, this time using a command-line interface (CLI), using just your keyboard, rather than the graphical user interface (GUI) represented by that folder icon. In particular, you *executed* (i.e., ran) a command called `ls`, which is shorthand for "list." (It's such a frequently used command that its authors called it just `ls` to save keystrokes.) Make sense?
8371

8472

8573
## Compiling programs
@@ -122,27 +110,6 @@ Hello there again!
122110

123111
Recall from lecture that we can automate the process of executing `clang`, letting `make` figure out how to do so for us, thereby saving us some keystrokes.
124112

125-
Create a new file called `Makefile` (no dot! no extension) and enter into it the following lines:
126-
127-
**Windows/Ubuntu/Old Mac version**
128-
129-
# Makefile for CS50-type assignments
130-
131-
%: %.c
132-
clang -O0 -std=c11 -Wall -Werror -Wextra -Wno-sign-compare -Wno-unused-parameter -Wno-unused-variable -Wshadow -o $@ $< -lcs50 -lcrypt -lm
133-
134-
**Mac M1 version**
135-
136-
# Makefile for CS50-type assignments
137-
138-
INCLUDE_PATH=${HOMEBREW_PREFIX}/opt/libcs50/include
139-
LIBRARY_PATH=${HOMEBREW_PREFIX}/opt/libcs50/lib
140-
141-
%: %.c
142-
clang -O0 -std=c11 -Wall -Werror -Wextra -Wno-sign-compare -Wno-unused-parameter -Wno-unused-variable -Wshadow -I${INCLUDE_PATH} -o $@ $< -L${LIBRARY_PATH} -lcs50 -lcrypt -lm
143-
144-
Make sure that right before "clang" in that last line is a TAB character and not 4 spaces. Save the file.
145-
146113
Now execute the below to compile your program one last time.
147114

148115
make hello
@@ -219,12 +186,10 @@ To verify whether your program is indeed running according to the specification,
219186

220187
As soon as you're done, submit your `hello.c` implementation, below!
221188

222-
1. Toward CS50 IDE's top-left corner, within its "file browser" (not within a terminal window), control-click or right-click your `hello.c` file (that's within your `~/problems/hello` directory) and then select **Download**. You should find that your browser has downloaded `hello.c`.
223-
224-
2. Make sure you are signed in to **this** website!
189+
1. Make sure you are signed in to this website!
225190

226-
4. In the form below, choose the file that you just downloaded.
191+
1. In the form below, browse to your `Programming` directory to find `hello.c`.
227192

228-
4. Press "Submit for grading". Presto!
193+
1. Press "Submit for grading". Presto!
229194

230-
Your program will then again be checked using `check50` and the result will be recorded on this website. Should the check fail on this website, double-check if your code still works well in the IDE!
195+
Your program will then again be checked using `check50` and the result will be recorded on this website. Should the check fail on this website, double-check if your code still works well on your own computer by compiling and running!

0 commit comments

Comments
 (0)