Advertisement
caubert

simpleCountingAlgorithm

Jan 24th, 2020
926
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 0.24 KB | None | 0 0
  1. {{ $n := (parseArgs 1 "" (carg "int" "int") ).Get 0 }}
  2. {{ if lt $n 0 }} {{ $n = mult $n -1 }} {{ end }}
  3. {{ $x := add $n 3 }}
  4. {{ range $i := seq 0 (add $n 1) }} {{ mult $x (mult -1 $i) }} {{ $x = add $x (mult $i $n) }} {{ end }}
  5. {{- $x }}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement