mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-12-15 21:28:07 +00:00
24 lines
559 B
Plaintext
24 lines
559 B
Plaintext
created: 20240415102801809
|
|
modified: 20240416092855340
|
|
tags:
|
|
title: test-collatz
|
|
type: text/vnd.tiddlywiki
|
|
|
|
\procedure collatz(n)
|
|
<% if [<n>match[1]] %>
|
|
1
|
|
<% elseif [<n>remainder[2]match[1]] %>
|
|
<<n>> <$button>→</$button> <$transclude $variable="collatz" n = {{{ [<n>multiply[3]add[1]] }}}/>
|
|
<% else %>
|
|
<<n>> <$button>→</$button> <$transclude $variable="collatz" n = {{{ [<n>divide[2]] }}}/>
|
|
<% endif %>
|
|
\end
|
|
|
|
\procedure test(x:10)
|
|
<$let tv-UNSAFE-max-widget-tree-depth="2000">
|
|
<$transclude $variable=collatz n=<<x>>/>
|
|
</$let>
|
|
\end
|
|
|
|
<<test 77031>>
|