{"id":319,"date":"2024-10-04T12:55:49","date_gmt":"2024-10-04T11:55:49","guid":{"rendered":"http:\/\/monkey.ploogie.co.uk\/?page_id=319"},"modified":"2024-10-04T12:55:49","modified_gmt":"2024-10-04T11:55:49","slug":"mwnci-random-function","status":"publish","type":"page","link":"https:\/\/monkey.ploogie.co.uk\/index.php\/mwnci-random-function\/","title":{"rendered":"Mwnci random() Function"},"content":{"rendered":"<h2><span id=\"Syntax\" class=\"mw-headline\">Syntax<\/span><\/h2>\n<p>random(<i><b>integer<\/b><\/i>)<\/p>\n<h2><span id=\"Description\" class=\"mw-headline\">Description<\/span><\/h2>\n<p>The <i>random()<\/i> function will return a pseudo random number from 0 to <i>integer<\/i>-1<\/p>\n<h2><span id=\"Example\" class=\"mw-headline\">Example<\/span><\/h2>\n<pre>a=[]\r\nforeach n in 1..10 {\r\n    a=push(a, random(10))\r\n}\r\nprintln(a)\r\n\r\n\r\n[2, 6, 7, 8, 0, 8, 6, 1, 6, 4]\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Syntax random(integer) Description The random() function will return a pseudo random number from 0 to integer-1 Example a=[] foreach n in 1..10 { a=push(a, random(10)) } println(a) [2, 6, 7, 8, 0, 8, 6, 1, 6, 4]<\/p>\n","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-319","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/pages\/319","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/comments?post=319"}],"version-history":[{"count":1,"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/pages\/319\/revisions"}],"predecessor-version":[{"id":320,"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/pages\/319\/revisions\/320"}],"wp:attachment":[{"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/media?parent=319"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}