-
-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
exercises(zebra-puzzle): implement #575
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix minor formatting issues, otherwise LGTM.
Verified configlet sync
:
$ git log -1 --oneline
316e3e4b (HEAD -> add-zebra-puzzle, exercism/add-zebra-puzzle) Add `zebra-puzzle` exercise
$ bin/configlet sync -e zebra-puzzle
Updating cached 'problem-specifications' data...
Checking exercises...
The `zebra-puzzle` exercise has up-to-date docs, filepaths, metadata, and tests!
These were the only empty trailing parens in the repo. Before this commit, running in the repo root directory: $ git grep --break --heading '(): ' -- '*.nim' exercises/practice/zebra:puzzle/.meta/example.nim 25:iterator permutations[T](): array[5, T] = 31:proc solve(): Solution = 58:proc waterDrunkBy*(): Nationality = 61:proc zebraOwnedBy*(): Nationality = exercises/practice/zebra:puzzle/zebra_puzzle.nim 5:proc waterDrunkBy*(): Nationality = 8:proc zebraOwnedBy*(): Nationality =
There should be a hyphen in "compile-time solution", but not in "calculate at compile time". From e.g. the Google developer documentation style guide [1]: Use the noun runtime when referring to the environment in which software runs, such as a Ruby or Java runtime. Use the noun phrase run time when referring to the time during program execution when something occurs, as contrasted with compile time, for example. Recommended: The profiler collects data at run time, and the scheduler uses this data at compile time to improve performance for subsequent runs. [1] https://developers.google.com/style/word-list#runtime
Resolve compiler warning: Warning: Cannot prove that 'result' is initialized. This will become a compile time error in the future. [ProveInit]
The other example solutions in this repo use `proc` only if `func` is not possible: $ git grep --break --heading 'proc ' -- '*example.nim' exercises/practice/diffie:hellman/.meta/example.nim 19:proc privateKey*(p: int): int = exercises/practice/dnd:character/.meta/example.nim 15:proc ability*: int = 27:proc initCharacter*: Character = exercises/practice/gigasecond/.meta/example.nim 3:proc addGigasecond*(date: DateTime): DateTime = exercises/practice/linked:list/.meta/example.nim 16:proc push*[T](list: var LinkedList[T], val: T) = 26:proc unshift*[T](list: var LinkedList[T], val: T) = 36:proc pop*[T](list: var LinkedList[T]): T = 43:proc shift*[T](list: var LinkedList[T]): T = 58:proc delete*[T](list: var LinkedList[T], val: T) = exercises/practice/meetup/.meta/example.nim 9:proc meetup*(y: int, m: int, sched: Schedule, d: WeekDay): string = exercises/practice/nth:prime/.meta/example.nim 25:proc prime*(n: int): int = exercises/practice/prime:factors/.meta/example.nim 28:proc primeFactors*(n: int64): seq[int] = exercises/practice/react/.meta/example.nim 35:proc newComputeCell*(dependencies: seq[Cell], compute: ComputeFunc): Cell = 42:proc `value=`*(cell: Cell, val: int) = 51:proc addCallback*(cell: Cell, callback: Callback) = 54:proc removeCallback*(cell: Cell, callback: Callback) = exercises/practice/robot:name/.meta/example.nim 11:proc shuffledNames: seq[Name] = 34:proc getUnusedName: Name {.inline.} = 40:proc makeRobot*: Robot {.inline.} = 43:proc reset*(r: var Robot) {.inline.} =
I'll take the liberty of pushing the nits, to save us both a bit of time. See the commit messages. Please yell at me if you object to anything there. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. Merging.
Thanks! |
No description provided.