<span class="mw-page-title-namespace">Blog</span><span class="mw-page-title-separator">:</span><span class="mw-page-title-main">Sandbox/buggy</span>
Elena & Fabrice's Web

buggy

From laussy.org's Blog about Sandbox.
Published: 17:02, 12 February 2021.

Nothing here

julia> while n!=1
           global counter+=1
           print("$(n)\u2192")
           if n%2==0
               global n÷=2
           else
               n=3n+1
           end
       end
       println("1.")

15→46→23→70→35→106→53→160→80→40→20→10→5→16→8→4→2→1.
julia> function collatz(n)
           global counter=0;
           while n!=1
               counter+=1;
               print("$(n)\u2192")
               if n%2==0
                   n÷=2
               else
                   n=3n+1
               end
           end
           println("1. ($(counter) steps)")
       end
collatz (generic function with 1 method)

julia> collatz(24)
24→12→6→3→10→5→16→8→4→2→1. (10 steps)

Gotcha troublemaker! The escaping $() sequence.

Should be the escaping $() sequence.

Nothing here either