Skip to content
Merged
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
36 changes: 18 additions & 18 deletions exercises/practice/raindrops/test.fut
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
import "raindrops"

-- The sound for 1 is 1
-- the sound for 1 is 1
-- ==
-- input { 1 }
-- output { "1" }

-- The sound for 3 is Pling
-- the sound for 3 is Pling
-- ==
-- input { 3 }
-- output { "Pling" }

-- The sound for 5 is Plang
-- the sound for 5 is Plang
-- ==
-- input { 5 }
-- output { "Plang" }

-- The sound for 7 is Plong
-- the sound for 7 is Plong
-- ==
-- input { 7 }
-- output { "Plong" }

-- The sound for 6 is Pling as it has a factor 3
-- the sound for 6 is Pling as it has a factor 3
-- ==
-- input { 6 }
-- output { "Pling" }
Expand All @@ -30,65 +30,65 @@ import "raindrops"
-- input { 8 }
-- output { "8" }

-- The sound for 9 is Pling as it has a factor 3
-- the sound for 9 is Pling as it has a factor 3
-- ==
-- input { 9 }
-- output { "Pling" }

-- The sound for 10 is Plang as it has a factor 5
-- the sound for 10 is Plang as it has a factor 5
-- ==
-- input { 10 }
-- output { "Plang" }

-- The sound for 14 is Plong as it has a factor of 7
-- the sound for 14 is Plong as it has a factor of 7
-- ==
-- input { 14 }
-- output { "Plong" }

-- The sound for 15 is PlingPlang as it has factors 3 and 5
-- the sound for 15 is PlingPlang as it has factors 3 and 5
-- ==
-- input { 15 }
-- output { "PlingPlang" }

-- The sound for 21 is PlingPlong as it has factors 3 and 7
-- the sound for 21 is PlingPlong as it has factors 3 and 7
-- ==
-- input { 21 }
-- output { "PlingPlong" }

-- The sound for 25 is Plang as it has a factor 5
-- the sound for 25 is Plang as it has a factor 5
-- ==
-- input { 25 }
-- output { "Plang" }

-- The sound for 27 is Pling as it has a factor 3
-- the sound for 27 is Pling as it has a factor 3
-- ==
-- input { 27 }
-- output { "Pling" }

-- The sound for 35 is PlangPlong as it has factors 5 and 7
-- the sound for 35 is PlangPlong as it has factors 5 and 7
-- ==
-- input { 35 }
-- output { "PlangPlong" }

-- The sound for 49 is Plong as it has a factor 7
-- the sound for 49 is Plong as it has a factor 7
-- ==
-- input { 49 }
-- output { "Plong" }

-- The sound for 52 is 52
-- the sound for 52 is 52
-- ==
-- input { 52 }
-- output { "52" }

-- The sound for 105 is PlingPlangPlong as it has factors 3, 5 and 7
-- the sound for 105 is PlingPlangPlong as it has factors 3, 5 and 7
-- ==
-- input { 105 }
-- output { "PlingPlangPlong" }

-- The sound for 3125 is Plang as it has a factor 5
-- the sound for 3125 is Plang as it has a factor 5
-- ==
-- input { 3125 }
-- output { "Plang" }

let main (number: i32): []u8 =
let main (number: i32): []u8 =
convert number
3 changes: 3 additions & 0 deletions exercises/practice/reverse-string/.meta/tests.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,12 @@ description = "an even-sized word"

[1bed0f8a-13b0-4bd3-9d59-3d0593326fa2]
description = "wide characters"
include = false

[93d7e1b8-f60f-4f3c-9559-4056e10d2ead]
description = "grapheme cluster with pre-combined form"
include = false

[1028b2c1-6763-4459-8540-2da47ca512d9]
description = "grapheme clusters"
include = false
12 changes: 6 additions & 6 deletions exercises/practice/reverse-string/test.fut
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
import "reverse_string"

-- An empty string
-- an empty string
-- ==
-- input { "" }
-- output { "" }

-- A word
-- a word
-- ==
-- input { "robot" }
-- output { "tobor" }

-- A capitalized word
-- a capitalized word
-- ==
-- input { "Ramen" }
-- output { "nemaR" }

-- A sentence with punctuation
-- a sentence with punctuation
-- ==
-- input { "I'm hungry!" }
-- output { "!yrgnuh m'I" }

-- A palindrome
-- a palindrome
-- ==
-- input { "racecar" }
-- output { "racecar" }

-- An even-sized word
-- an even-sized word
-- ==
-- input { "drawer" }
-- output { "reward" }
Expand Down
5 changes: 5 additions & 0 deletions exercises/practice/roman-numerals/test.fut
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,11 @@ import "roman_numerals"
-- input { 3001 }
-- output { "MMMI" }

-- 3888 is MMMDCCCLXXXVIII
-- ==
-- input { 3888 }
-- output { "MMMDCCCLXXXVIII" }

-- 3999 is MMMCMXCIX
-- ==
-- input { 3999 }
Expand Down
22 changes: 11 additions & 11 deletions exercises/practice/scrabble-score/test.fut
Original file line number Diff line number Diff line change
@@ -1,56 +1,56 @@
import "scrabble_score"

-- Lowercase letter
-- lowercase letter
-- ==
-- input { "a" }
-- output { 1 }

-- Uppercase letter
-- uppercase letter
-- ==
-- input { "A" }
-- output { 1 }

-- Valuable letter
-- valuable letter
-- ==
-- input { "f" }
-- output { 4 }

-- Short word
-- short word
-- ==
-- input { "at" }
-- output { 2 }

-- Short, valuable word
-- short, valuable word
-- ==
-- input { "zoo" }
-- output { 12 }

-- Medium word
-- medium word
-- ==
-- input { "street" }
-- output { 6 }

-- Medium, valuable word
-- medium, valuable word
-- ==
-- input { "quirky" }
-- output { 22 }

-- Long, mixed-case word
-- long, mixed-case word
-- ==
-- input { "OxyphenButazone" }
-- output { 41 }

-- English-like word
-- english-like word
-- ==
-- input { "pinata" }
-- output { 8 }

-- Empty input
-- empty input
-- ==
-- input { "" }
-- output { 0 }

-- Entire alphabet available
-- entire alphabet available
-- ==
-- input { "abcdefghijklmnopqrstuvwxyz" }
-- output { 87 }
Expand Down
22 changes: 11 additions & 11 deletions exercises/practice/secret-handshake/test.fut
Original file line number Diff line number Diff line change
@@ -1,56 +1,56 @@
import "secret_handshake"

-- Wink for 1
-- wink for 1
-- ==
-- input { 1 }
-- output { "wink" }

-- Double blink for 10
-- double blink for 10
-- ==
-- input { 2 }
-- output { "double blink" }

-- Close your eyes for 100
-- close your eyes for 100
-- ==
-- input { 4 }
-- output { "close your eyes" }

-- Jump for 1000
-- jump for 1000
-- ==
-- input { 8 }
-- output { "jump" }

-- Combine two actions
-- combine two actions
-- ==
-- input { 3 }
-- output { "wink, double blink" }

-- Reverse two actions
-- reverse two actions
-- ==
-- input { 19 }
-- output { "double blink, wink" }

-- Reversing one action gives the same action
-- reversing one action gives the same action
-- ==
-- input { 24 }
-- output { "jump" }

-- Reversing no actions still gives no actions
-- reversing no actions still gives no actions
-- ==
-- input { 16 }
-- output { "" }

-- All possible actions
-- all possible actions
-- ==
-- input { 15 }
-- output { "wink, double blink, close your eyes, jump" }

-- Reverse all possible actions
-- reverse all possible actions
-- ==
-- input { 31 }
-- output { "jump, close your eyes, double blink, wink" }

-- Do nothing for zero
-- do nothing for zero
-- ==
-- input { 0 }
-- output { "" }
Expand Down
1 change: 1 addition & 0 deletions exercises/practice/space-age/.meta/tests.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,4 @@ description = "age on Neptune"

[57b96e2a-1178-40b7-b34d-f3c9c34e4bf4]
description = "invalid planet causes error"
include = false
16 changes: 8 additions & 8 deletions exercises/practice/space-age/test.fut
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@
import "space_age"

-- Age on Earth
-- age on Earth
-- ==
-- input { "Earth" 1000000000i64 }
-- output { 31.69 }

-- Age on Mercury
-- age on Mercury
-- ==
-- input { "Mercury" 2134835688i64 }
-- output { 280.88 }

-- Age on Venus
-- age on Venus
-- ==
-- input { "Venus" 189839836i64 }
-- output { 9.78 }

-- Age on Mars
-- age on Mars
-- ==
-- input { "Mars" 2129871239i64 }
-- output { 35.88 }

-- Age on Jupiter
-- age on Jupiter
-- ==
-- input { "Jupiter" 901876382i64 }
-- output { 2.41 }

-- Age on Saturn
-- age on Saturn
-- ==
-- input { "Saturn" 2000000000i64 }
-- output { 2.15 }

-- Age on Uranus
-- age on Uranus
-- ==
-- input { "Uranus" 1210123456i64 }
-- output { 0.46 }

-- Age on Neptune
-- age on Neptune
-- ==
-- input { "Neptune" 1821023456i64 }
-- output { 0.35 }
Expand Down
Loading