Skip to content

Commit 3153939

Browse files
committed
2019/speller
1 parent d244884 commit 3153939

File tree

2 files changed

+13
-14
lines changed

2 files changed

+13
-14
lines changed

_pages/2019/spring/psets/4/speller/hashtable/speller.adoc

+7-8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
layout: 2018/fall
2+
layout: 2019/spring
33
---
44

55
= Speller
@@ -39,9 +39,8 @@ TIME IN TOTAL:
3939

4040
=== Downloading
4141

42-
Log into link:https://cs50.io/[CS50 IDE] and then, in a terminal window, execute each of the below.
42+
Log into link:https://ide.cs50.io/[CS50 IDE] and then, in a terminal window, execute each of the below.
4343

44-
1. Execute `update50` to ensure your IDE is up-to-date. That command might take a few minutes to finish.
4544
1. Execute `cd` to ensure that you're in `~/workspace/` (i.e., a directory called `workspace` that's in your home directory, aka `~`).
4645
1. Execute `mkdir pset4` to make (i.e., create) a directory called `pset4` in your home directory.
4746
1. Execute `cd pset4` to change into (i.e., open) that directory.
@@ -66,7 +65,7 @@ In `speller.c`, we've put together a program that's designed to spell-check a fi
6665

6766
==== `dictionary.h`
6867

69-
Open up `dictionary.h`, and you'll see some new syntax, including a few lines that mention `DICTIONARY_H`. No need to worry about those, but, if curious, those lines just ensure that, even though `dictionary.c` and `speller.c` (which you'll see in a moment) `#include` this file, `clang` will only compile it once.
68+
Open up `dictionary.h`, and you'll see some new syntax, including a few lines that mention `DICTIONARY_H`. No need to worry about those, but, if curious, those lines just ensure that, even though `dictionary.c` and `speller.c` (which you'll see in a moment) `#include` this file, `clang` will only compile it once.
7069

7170
Next notice how we `#include` a file called `stdbool.h`. That's the file in which `bool` itself is defined. You've not needed it before, since the CS50 Library used to `#include` that for you.
7271

@@ -92,7 +91,7 @@ And `const`, meanwhile, just says that those strings, when passed in as argument
9291

9392
Now open up `dictionary.c`. Notice how, atop the file, we've defined a `struct` called `node` that represents a node in a hash table. And we've declared a global array, `hashtable`, with enough room for `N` pointers to nodes, where `N` is initialized above that array to `26`, one bucket for each letter in the (English) alphabet.
9493

95-
A bit below those lines have we implemented a function called `hash` that hashes a word, returning `0` for any word that starts with an `a` (or `A`), `1` for any word that starts with a `b` (or `B`), `25` for any word that starts with a `z` (or `Z`), and so on for every letter in between.
94+
A bit below those lines have we implemented a function called `hash` that hashes a word, returning `0` for any word that starts with an `a` (or `A`), `1` for any word that starts with a `b` (or `B`), `25` for any word that starts with a `z` (or `Z`), and so on for every letter in between.
9695

9796
Below that have we written part of a function called `load` that will soon (thanks to you!) load a dictionary of words into the hash table. We've written some code that initializes all of the buckets (i.e., pointers) in `hashtable` to `NULL`. And we've written some code that opens `dictionary`, which is the file name of a dictionary to load. And we've also written some code that iterates over that dictionary and reads the words therein, one at a time, into a buffer (i.e., `string`) called `word`. But we stop short of inserting those words into `hashtable`. Thereafter, we do close the file, though, and then return `true` to indicate (we hope!) success.
9897

@@ -306,7 +305,7 @@ To test your code less manually (though still not exhaustively), you may also ex
306305

307306
[source]
308307
----
309-
check50 cs50/2018/fall/speller
308+
check50 cs50/2019/spring/speller
310309
----
311310

312311
Note that `check50` will also check for memory leaks, so be sure you've run `valgrind` as well.
@@ -326,7 +325,7 @@ And if you'd like to put your code to the test against classmates' code (just fo
326325

327326
[source]
328327
----
329-
check50 cs50/2018/fall/challenges/speller
328+
check50 cs50/2019/spring/challenges/speller
330329
----
331330

332331
Then visit the URL that `check50` outputs to see where you rank!
@@ -336,5 +335,5 @@ Then visit the URL that `check50` outputs to see where you rank!
336335
Execute the below, logging in with your GitHub username and password when prompted. For security, you'll see asterisks (`*`) instead of the actual characters in your password.
337336

338337
```
339-
submit50 cs50/2018/fall/speller
338+
submit50 cs50/2019/spring/speller
340339
```

_pages/2019/spring/psets/4/speller/trie/speller.adoc

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
layout: 2018/fall
2+
layout: 2019/spring
33
---
44

55
= Speller
@@ -51,7 +51,7 @@ Log into link:https://cs50.io/[CS50 IDE] and then, in a terminal window, execute
5151
1. Execute `ls`. You should see a directory called `speller`, which was inside of that ZIP file.
5252
1. Execute `cd speller` to change into that directory.
5353
1. Execute `ls`. You should see this problem's distribution:
54-
54+
5555
```
5656
dictionaries/ dictionary.c dictionary.h keys/ Makefile speller.c texts/
5757
```
@@ -66,7 +66,7 @@ In `speller.c`, we've put together a program that's designed to spell-check a fi
6666

6767
==== `dictionary.h`
6868

69-
Open up `dictionary.h`, and you'll see some new syntax, including a few lines that mention `DICTIONARY_H`. No need to worry about those, but, if curious, those lines just ensure that, even though `dictionary.c` and `speller.c` (which you'll see in a moment) `#include` this file, `clang` will only compile it once.
69+
Open up `dictionary.h`, and you'll see some new syntax, including a few lines that mention `DICTIONARY_H`. No need to worry about those, but, if curious, those lines just ensure that, even though `dictionary.c` and `speller.c` (which you'll see in a moment) `#include` this file, `clang` will only compile it once.
7070

7171
Next notice how we `#include` a file called `stdbool.h`. That's the file in which `bool` itself is defined. You've not needed it before, since the CS50 Library used to `#include` that for you.
7272

@@ -304,7 +304,7 @@ To test your code less manually (though still not exhaustively), you may also ex
304304

305305
[source]
306306
----
307-
check50 cs50/2018/fall/speller
307+
check50 cs50/2019/spring/speller
308308
----
309309

310310
Note that `check50` will also check for memory leaks, so be sure you've run `valgrind` as well.
@@ -324,7 +324,7 @@ And if you'd like to put your code to the test against classmates' code (just fo
324324

325325
[source]
326326
----
327-
check50 cs50/2018/fall/challenges/speller
327+
check50 cs50/2019/spring/challenges/speller
328328
----
329329

330330
Then visit the URL that `check50` outputs to see where you rank!
@@ -334,5 +334,5 @@ Then visit the URL that `check50` outputs to see where you rank!
334334
Execute the below, logging in with your GitHub username and password when prompted. For security, you'll see asterisks (`*`) instead of the actual characters in your password.
335335

336336
```
337-
submit50 cs50/2018/fall/speller
337+
submit50 cs50/2019/spring/speller
338338
```

0 commit comments

Comments
 (0)