aboutsummaryrefslogtreecommitdiff
path: root/examples/features.sloth
diff options
context:
space:
mode:
authorCody <cody@codyq.dev>2023-06-26 23:53:44 -0500
committerCody <cody@codyq.dev>2023-06-26 23:53:44 -0500
commit9748e95027af7820e6d9f08eb20b0901fdedfa2a (patch)
tree248fd1952537edc9e107110a6dc5a432c676d021 /examples/features.sloth
parent27b7187c21f6ff4e469592a8ea5757ca6aee8577 (diff)
downloadsloth-9748e95027af7820e6d9f08eb20b0901fdedfa2a.tar.gz
Delete random examples
Diffstat (limited to 'examples/features.sloth')
-rw-r--r--examples/features.sloth42
1 files changed, 0 insertions, 42 deletions
diff --git a/examples/features.sloth b/examples/features.sloth
deleted file mode 100644
index 26be73c..0000000
--- a/examples/features.sloth
+++ /dev/null
@@ -1,42 +0,0 @@
-fn calories(input) {
- var elves = []
- var current = 0
-
- for line in input.lines() {
- if line.empty() {
- elves.append(current)
- current = 0
- continue
- }
-
- current += line as!! int
- }
-
- elves.sort()
- elves.reverse()
-
- return elves[0..3].sum()
-}
-
-fn fib(x: int) {
- if x < 2 {
- return x
- }
-
- return fib(x - 1) + fib (x - 2)
-}
-
-fn codes(input: String): List<String> {
- val chars = input.chars()
- .windowed(4)
- .map(it -> it as Set)
- .filter(-> $0.len() == 4)
- .map(it -> it.join())
- return chars
-}
-
-## Will convert celsius to fahrenheit
-fn fahrenheit(celsius) {
- return 32.0 + celsius * 1.8
-}
-