Pick random element: Difference between revisions
Content deleted Content added
Simpler D version |
→{{header|TXR}}: Added. |
||
Line 310: | Line 310: | ||
} |
} |
||
set x [randelem {1 2 3 4 5}]</lang> |
set x [randelem {1 2 3 4 5}]</lang> |
||
=={{header|TXR}}== |
|||
{{trans|Tcl}} |
|||
<lang txr>@(do (defun randelem (vec) |
|||
(vecref vec (random nil (length vec))))) |
|||
@(bind x @(randelem #("a" "b" "c" "d")))</lang> |
|||
=={{header|TUSCRIPT}}== |
=={{header|TUSCRIPT}}== |