{"id":699,"date":"2024-11-19T11:17:46","date_gmt":"2024-11-19T11:17:46","guid":{"rendered":"http:\/\/monkey.ploogie.co.uk\/?page_id=699"},"modified":"2024-11-19T11:17:46","modified_gmt":"2024-11-19T11:17:46","slug":"mwnci-shuffle-function","status":"publish","type":"page","link":"https:\/\/monkey.ploogie.co.uk\/index.php\/mwnci-shuffle-function\/","title":{"rendered":"Mwnci shuffle() Function"},"content":{"rendered":"<h2>Syntax<\/h2>\n<p>shuffle<strong>(<em>array<\/em>)<\/strong><\/p>\n<h2>Description<\/h2>\n<p>The <i>shuffle()<\/i> function returns a new array with all the elements in a random order.<\/p>\n<h2>Example<\/h2>\n<pre>\r\na=[\"Apples\", \"Bananas\", \"Oranges\", \"Pears\"]\r\nb=shuffle(a)\r\nprintln(\"a=\", a)\r\nprintln(\"b=\", b)\r\nc=[1,2,3,4,5,6,7,8,9,10]\r\nprintln(shuffle(c))\r\n\r\n\r\na=[\"Apples\", \"Bananas\", \"Oranges\", \"Pears\"]\r\nb=[\"Bananas\", \"Oranges\", \"Pears\", \"Apples\"]\r\n[10, 6, 1, 9, 8, 3, 2, 7, 5, 4]\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Syntax shuffle(array) Description The shuffle() function returns a new array with all the elements in a random order. Example a=[&#8220;Apples&#8221;, &#8220;Bananas&#8221;, &#8220;Oranges&#8221;, &#8220;Pears&#8221;] b=shuffle(a) println(&#8220;a=&#8221;, a) println(&#8220;b=&#8221;, b) c=[1,2,3,4,5,6,7,8,9,10] println(shuffle(c)) a=[&#8220;Apples&#8221;, &#8220;Bananas&#8221;, &#8220;Oranges&#8221;, &#8220;Pears&#8221;] b=[&#8220;Bananas&#8221;, &#8220;Oranges&#8221;, &#8220;Pears&#8221;, &#8220;Apples&#8221;] [10, 6, 1, 9, 8, 3, 2, 7, 5, 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-699","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/pages\/699","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=699"}],"version-history":[{"count":1,"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/pages\/699\/revisions"}],"predecessor-version":[{"id":700,"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/pages\/699\/revisions\/700"}],"wp:attachment":[{"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/media?parent=699"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}