{"id":1882,"date":"2022-03-25T22:23:31","date_gmt":"2022-03-25T22:23:31","guid":{"rendered":"https:\/\/www.jameshatton.co.uk\/blog\/?p=1882"},"modified":"2022-03-25T22:23:31","modified_gmt":"2022-03-25T22:23:31","slug":"collatz-conjecture-in-scratch","status":"publish","type":"post","link":"https:\/\/www.jameshatton.co.uk\/blog\/2022\/03\/25\/collatz-conjecture-in-scratch\/","title":{"rendered":"Collatz Conjecture in Scratch"},"content":{"rendered":"\n<p>It&#8217;s not the first time I have extolled the virtues of Scratch. It is a fantastic platform by which people can be introduced into programming. I fancied doing something creative this evening and playing about in Scratch. I was going to make a little game but then I thought about illustrating an aspect of the Collatz conjecture in Scratch.<\/p>\n\n\n\n<!--more-->\n\n\n\n<p>I decided to do this as a code-along where I code and just narrate my thoughts while coding. It&#8217;s a nice way of coding because it is quite organic (versus a formally planned approach) and so you end up generating small issues and then by troubleshooting them, get a better understanding of why and how things do and don&#8217;t work. Whilst dinner was in the oven, I prepared a quick death-by-powerpoint slideshow, setup the video stream, watched an episode of Picard, and then jumped right in.<\/p>\n\n\n\n<p>Apologies for any mumbling etc. in the video but this was quite impromptu but I think I survived it. As ever, hopefully somebody, somewhere will have some benefit. Enjoy.<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-rich is-provider-embed-handler wp-block-embed-embed-handler wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<span class=\"embed-youtube\" style=\"text-align:center; display: block;\"><iframe loading=\"lazy\" class=\"youtube-player\" width=\"840\" height=\"473\" src=\"https:\/\/www.youtube.com\/embed\/pxGxcsCkueY?version=3&#038;rel=1&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;fs=1&#038;hl=en-GB&#038;autohide=2&#038;wmode=transparent\" allowfullscreen=\"true\" style=\"border:0;\" sandbox=\"allow-scripts allow-same-origin allow-popups allow-presentation allow-popups-to-escape-sandbox\"><\/iframe><\/span>\n<\/div><\/figure>\n\n\n\n<p>The code for the project is also available at <a href=\"https:\/\/scratch.mit.edu\/projects\/666120461\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/scratch.mit.edu\/projects\/666120461<\/a> and is shown below:<\/p>\n\n\n\n<iframe loading=\"lazy\" src=\"https:\/\/scratch.mit.edu\/projects\/666120461\/embed\" allowtransparency=\"true\" width=\"485\" height=\"402\" frameborder=\"0\" scrolling=\"no\" allowfullscreen><\/iframe>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>It&#8217;s not the first time I have extolled the virtues of Scratch. It is a fantastic platform by which people can be introduced into programming. I fancied doing something creative this evening and playing about in Scratch. I was going to make a little game but then I thought about illustrating an aspect of the Collatz conjecture in Scratch.<\/p>\n","protected":false},"author":1,"featured_media":1884,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[20],"tags":[76,77,78,46],"class_list":["post-1882","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-stem","tag-collatz","tag-maths","tag-programming","tag-scratch"],"featured_image_src":"https:\/\/i0.wp.com\/www.jameshatton.co.uk\/blog\/wp-content\/uploads\/2022\/03\/collatz_thumb.png?fit=494%2C376&ssl=1","author_info":{"display_name":"james","author_link":"https:\/\/www.jameshatton.co.uk\/blog\/author\/james\/"},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/www.jameshatton.co.uk\/blog\/wp-content\/uploads\/2022\/03\/collatz_thumb.png?fit=494%2C376&ssl=1","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p89zH1-um","jetpack-related-posts":[],"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/www.jameshatton.co.uk\/blog\/wp-json\/wp\/v2\/posts\/1882","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.jameshatton.co.uk\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.jameshatton.co.uk\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.jameshatton.co.uk\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.jameshatton.co.uk\/blog\/wp-json\/wp\/v2\/comments?post=1882"}],"version-history":[{"count":2,"href":"https:\/\/www.jameshatton.co.uk\/blog\/wp-json\/wp\/v2\/posts\/1882\/revisions"}],"predecessor-version":[{"id":1885,"href":"https:\/\/www.jameshatton.co.uk\/blog\/wp-json\/wp\/v2\/posts\/1882\/revisions\/1885"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.jameshatton.co.uk\/blog\/wp-json\/wp\/v2\/media\/1884"}],"wp:attachment":[{"href":"https:\/\/www.jameshatton.co.uk\/blog\/wp-json\/wp\/v2\/media?parent=1882"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.jameshatton.co.uk\/blog\/wp-json\/wp\/v2\/categories?post=1882"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.jameshatton.co.uk\/blog\/wp-json\/wp\/v2\/tags?post=1882"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}