-
-
Save jasondown/aaeb4f719dd790d01ad4818c8f5e38c4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let getEquipment equipment = | |
let rec buildList items listSoFar = | |
match items with | |
| [] -> listSoFar | |
| x::xs -> buildList xs (sprintf "%s %s " listSoFar x) | |
buildList equipment "Items: " | |
// Sample usage | |
["Sword"; "Shield"; "Potatoes"] |> getEquipment |> printfn "%s" | |
// prints Items: Sword Shield Potatoes |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment