1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-12-15 21:28:07 +00:00
Files
TiddlyWiki5/editions/tw5.com/tiddlers/test-collatz.tid
2024-04-16 11:55:01 +02:00

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>>