sample-code: Add shebang comments to samples with a main() function
This commit is contained in:
1
sample-code/fib.cl
Normal file → Executable file
1
sample-code/fib.cl
Normal file → Executable file
@@ -1,3 +1,4 @@
|
||||
#!/usr/bin/env -S conlang -r false
|
||||
// Calculate Fibonacci numbers
|
||||
|
||||
fn main() {
|
||||
|
||||
3
sample-code/fizzbuzz.cl
Normal file → Executable file
3
sample-code/fizzbuzz.cl
Normal file → Executable file
@@ -1,7 +1,8 @@
|
||||
#!/usr/bin/env -S conlang -r false
|
||||
// FizzBuzz, using the unstable variadic-`print` builtin
|
||||
|
||||
fn main() {
|
||||
fizzbuzz(10, 20)
|
||||
fizzbuzz(0, 30)
|
||||
}
|
||||
|
||||
// Outputs FizzBuzz for numbers between `start` and `end`, inclusive
|
||||
|
||||
3
sample-code/hello.cl
Normal file → Executable file
3
sample-code/hello.cl
Normal file → Executable file
@@ -1,3 +1,6 @@
|
||||
#!/usr/bin/env -S conlang -r false
|
||||
//! Prints "Hello, world!"
|
||||
|
||||
fn main() {
|
||||
println("Hello, world!")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user