Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions exercises/practice/grade-school/.docs/instructions.append.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Instructions append

## Words

Define a `school` tuple to hold the roster — how you store the
students inside it is up to you — then implement the words below.

- `<school> ( -- school )` — construct an empty school.
- `add-student ( school name grade -- ? )` — add `name` to
`grade`. Return `t` on success, or `f` if `name` has already
been added (to this or any other grade), in which case the
roster is left unchanged.
- `roster ( school -- names )` — all students, sorted by grade
and then alphabetically by name.
- `grade ( school n -- names )` — the students in grade `n`,
sorted alphabetically by name.
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
USING: kernel ;
IN: grade-school

TUPLE: school students ;
! Define a `school` tuple to hold the roster, then implement the
! words below.

: <school> ( -- school )
"unimplemented" throw ;
Expand Down
Loading