Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Prog ¶
func BytecodeCollatz ¶
func BytecodeCollatz() *Prog
interpreted version of: func collatz(n int) { for n > 1 { if n&1 != 0 { n = ((n * 3) + 1) / 2 } else { n = n / 2 } } }
func BytecodeSum ¶
bytecode version of: func sum(n int) int { total := 0 for i := 1; i <= n; i++ { total += i } return total }
Click to show internal directories.
Click to hide internal directories.