diff --git a/examples/session/index.step b/examples/session/index.step index c25e6a3..f541163 100644 --- a/examples/session/index.step +++ b/examples/session/index.step @@ -37,4 +37,27 @@ Here is a horse: ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠻⠤⣤⣤⣤⡤⠴⠛⠛⠛⠛⠉⠁⠀⠀⠀⠀⠈⠉⢿⣄⣀⣠⣤⡤⠶⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ``` +Twilight sparkle demands that you [memorize](.) the sacred powers of two! + +{{$list := $session.Get "list" | default (list 1)}} +{{range $list}} +- {{.}} +{{end}} +{{$last := last $list}} +{{if lt $last 1}} +graaaah computer explode xP +{{else}} + {{$list = $last | mul 2 | append $list}} + {{$session.Set "list" $list}} +{{end}} + +--- + +{{$counter := $session.Get "counter" | default 0}} +You have refreshed the page {{$counter}} times. +{{$counter = add $counter 1}} +{{$session.Set "counter" $counter}} + +{{if gt $counter 100}}Why?{{end}} + [Exit session](logout.step).