You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: hello/index.md
+12-47Lines changed: 12 additions & 47 deletions
Original file line number
Diff line number
Diff line change
@@ -22,53 +22,41 @@ Go to your Terminal. You should find that its "prompt" resembles the below.
22
22
23
23
jharvard@somewhere ~ %
24
24
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
-
31
25
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.
32
26
33
27
Now execute
34
28
35
-
cd ~/Documents/problems/
29
+
cd ~/Documents/Programming/
36
30
37
31
to move yourself into (i.e., open) that directory. Your prompt should now resemble the below.
38
32
39
-
problems %
33
+
jharvard@somewhere Programming %
40
34
41
35
If not, retrace your steps and see if you can determine where you went wrong.
42
36
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**.
44
38
45
39
In your new file, type the C code for "Hello, World" as seen above. Save it once more.
46
40
47
41
### Instructions for Windows
48
42
49
43
Go to your Terminal. You should find that its "prompt" resembles the below.
50
44
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:~$
58
46
59
47
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.
60
48
61
49
Now execute
62
50
63
-
cd /mnt/c/Users/<Windows User Name>/Documents/Development
51
+
cd /mnt/c/Users/<Windows User Name>/Documents/Programming/
64
52
65
53
to move yourself into (i.e., open) that directory. Your prompt should now resemble the below.
66
54
67
-
Development %
55
+
jharvard@COMPUTER:Programming$
68
56
69
57
If not, retrace your steps and see if you can determine where you went wrong.
70
58
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**.
72
60
73
61
In your new file, type the C code for "Hello, World" as seen above. Save it once more.
74
62
@@ -79,7 +67,7 @@ Next, type precisely the below (in lowercase), then hit Enter:
79
67
80
68
ls
81
69
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?
83
71
84
72
85
73
## Compiling programs
@@ -122,27 +110,6 @@ Hello there again!
122
110
123
111
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.
124
112
125
-
Create a new file called `Makefile` (no dot! no extension) and enter into it the following lines:
Make sure that right before "clang" in that last line is a TAB character and not 4 spaces. Save the file.
145
-
146
113
Now execute the below to compile your program one last time.
147
114
148
115
make hello
@@ -219,12 +186,10 @@ To verify whether your program is indeed running according to the specification,
219
186
220
187
As soon as you're done, submit your `hello.c` implementation, below!
221
188
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!
225
190
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`.
227
192
228
-
4. Press "Submit for grading". Presto!
193
+
1. Press "Submit for grading". Presto!
229
194
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