A Collection of Code Snippets in as Many Programming Languages as Possible
This project is maintained by TheRenegadeCoder
Welcome to the Fibonacci in Odin page! Here, you'll find the source code for this program as well as a description of how the program works.
package main
import "core:fmt"
import "core:strconv"
import "core:os"
main :: proc() {
if len(os.args) != 2 {
usage()
return
}
input, check := strconv.parse_int(os.args[1], 10)
if !check {
usage()
return
}
use1 := 0
use2 := 1
use3 := 0
for i:=1 ; i <= input; i += 1 {
use3 = use1 + use2
use1 = use2
use2 = use3
fmt.print(i)
fmt.print(": ")
fmt.println(use1)
}
}
usage :: proc() {
fmt.println("Usage: please input the count of fibonacci numbers to output")
}
Fibonacci in Odin was written by:
If you see anything you'd like to change or update, please consider contributing.
No 'How to Implement the Solution' section available. Please consider contributing.
No 'How to Run the Solution' section available. Please consider contributing.