{"id":32002,"date":"2025-04-08T18:21:39","date_gmt":"2025-04-08T10:21:39","guid":{"rendered":"http:\/\/hazlina-backup-32002"},"modified":"2025-04-08T18:21:39","modified_gmt":"2025-04-08T10:21:39","slug":"bte1522-week-5-code-troubleshooting","status":"publish","type":"post","link":"\/hazlina-blog\/2025\/04\/08\/bte1522-week-5-code-troubleshooting\/","title":{"rendered":"BTE1522 \u2013 Week 5 \u2013 Code Troubleshooting"},"content":{"rendered":"<p class=\"\" data-start=\"158\" data-end=\"479\">This week in BTE1522, we focused on <strong data-start=\"194\" data-end=\"234\">troubleshooting the Slider Game code<\/strong> as part of our hands-on approach to learning Python programming. Over the past four weeks, students had completed Steps 1 through 7 of the game development process \u2014 from designing a simple game window to implementing the &#8220;Game Over&#8221; condition.<\/p>\n<p class=\"\" data-start=\"481\" data-end=\"543\">In <strong data-start=\"484\" data-end=\"494\">Week 5<\/strong>, we shifted our focus from building to refining.<\/p>\n<p class=\"\" data-start=\"545\" data-end=\"1014\"><strong data-start=\"548\" data-end=\"579\">Troubleshooting Score Logic<\/strong><br data-start=\"579\" data-end=\"582\" \/>The session began with a debugging challenge: fixing the issue where the score kept increasing continuously whenever the player collided with the enemy. The expected behavior was that the score should increase by <strong data-start=\"795\" data-end=\"805\">only 1<\/strong> per collision. This led to an exploration of <strong data-start=\"851\" data-end=\"868\">Boolean flags<\/strong> (such as <code data-start=\"878\" data-end=\"891\">collosion = False<\/code>) and control logic \u2014 helping students understand how to track and limit events in game logic using conditional statements.<\/p>\n<p class=\"\" data-start=\"1016\" data-end=\"1362\"><strong data-start=\"1018\" data-end=\"1050\">Implementing Countdown Timer<\/strong><br data-start=\"1050\" data-end=\"1053\" \/>Next, students were challenged to modify the game\u2019s default <strong data-start=\"1113\" data-end=\"1134\">up-counting timer<\/strong> into a <strong data-start=\"1142\" data-end=\"1161\">countdown timer<\/strong>. This exercise required them to revisit Python functions and logic structures. They learned how to set and decrease a timer, as well as how to trigger the &#8220;Game Over&#8221; condition when time reaches zero.<\/p>\n<p class=\"\" data-start=\"1364\" data-end=\"1693\"><strong data-start=\"1367\" data-end=\"1399\">Debugging as a Learning Tool<\/strong><br data-start=\"1399\" data-end=\"1402\" \/>Troubleshooting is a vital part of programming, and through this session, students experienced how <strong data-start=\"1501\" data-end=\"1541\">debugging helps deepen understanding<\/strong> of syntax, logic flow, and structure in Python. Debugging isn&#8217;t just about fixing errors \u2014 it&#8217;s about making your code smarter and your logic stronger.<\/p>\n<p class=\"\" data-start=\"1695\" data-end=\"2019\">This week\u2019s activity reinforced the idea that <strong data-start=\"1741\" data-end=\"1796\">learning to program by building and breaking things<\/strong> \u2014 then fixing them \u2014 is one of the most effective ways to understand a programming language. Students left the class not just with working code, but with improved problem-solving skills and a stronger foundation in Python.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-32013\" src=\"\/hazlina\/wp-content\/uploads\/2025\/04\/IMG_2358-1024x768.jpeg\" alt=\"\" width=\"840\" height=\"630\" srcset=\"\/hazlina\/wp-content\/uploads\/2025\/04\/IMG_2358-1024x768.jpeg 1024w, \/hazlina\/wp-content\/uploads\/2025\/04\/IMG_2358-300x225.jpeg 300w, \/hazlina\/wp-content\/uploads\/2025\/04\/IMG_2358-768x576.jpeg 768w, \/hazlina\/wp-content\/uploads\/2025\/04\/IMG_2358-1200x900.jpeg 1200w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-32012\" src=\"\/hazlina\/wp-content\/uploads\/2025\/04\/IMG_2359-1024x768.jpeg\" alt=\"\" width=\"840\" height=\"630\" srcset=\"\/hazlina\/wp-content\/uploads\/2025\/04\/IMG_2359-1024x768.jpeg 1024w, \/hazlina\/wp-content\/uploads\/2025\/04\/IMG_2359-300x225.jpeg 300w, \/hazlina\/wp-content\/uploads\/2025\/04\/IMG_2359-768x576.jpeg 768w, \/hazlina\/wp-content\/uploads\/2025\/04\/IMG_2359-1200x900.jpeg 1200w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-32011\" src=\"\/hazlina\/wp-content\/uploads\/2025\/04\/IMG_2360-1024x768.jpeg\" alt=\"\" width=\"840\" height=\"630\" srcset=\"\/hazlina\/wp-content\/uploads\/2025\/04\/IMG_2360-1024x768.jpeg 1024w, \/hazlina\/wp-content\/uploads\/2025\/04\/IMG_2360-300x225.jpeg 300w, \/hazlina\/wp-content\/uploads\/2025\/04\/IMG_2360-768x576.jpeg 768w, \/hazlina\/wp-content\/uploads\/2025\/04\/IMG_2360-1200x900.jpeg 1200w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-32010\" src=\"\/hazlina\/wp-content\/uploads\/2025\/04\/IMG_2361-1024x768.jpeg\" alt=\"\" width=\"840\" height=\"630\" srcset=\"\/hazlina\/wp-content\/uploads\/2025\/04\/IMG_2361-1024x768.jpeg 1024w, \/hazlina\/wp-content\/uploads\/2025\/04\/IMG_2361-300x225.jpeg 300w, \/hazlina\/wp-content\/uploads\/2025\/04\/IMG_2361-768x576.jpeg 768w, \/hazlina\/wp-content\/uploads\/2025\/04\/IMG_2361-1200x900.jpeg 1200w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-32009\" src=\"\/hazlina\/wp-content\/uploads\/2025\/04\/IMG_2363-1024x768.jpeg\" alt=\"\" width=\"840\" height=\"630\" srcset=\"\/hazlina\/wp-content\/uploads\/2025\/04\/IMG_2363-1024x768.jpeg 1024w, \/hazlina\/wp-content\/uploads\/2025\/04\/IMG_2363-300x225.jpeg 300w, \/hazlina\/wp-content\/uploads\/2025\/04\/IMG_2363-768x576.jpeg 768w, \/hazlina\/wp-content\/uploads\/2025\/04\/IMG_2363-1200x900.jpeg 1200w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-32008\" src=\"\/hazlina\/wp-content\/uploads\/2025\/04\/IMG_2364-1024x768.jpeg\" alt=\"\" width=\"840\" height=\"630\" srcset=\"\/hazlina\/wp-content\/uploads\/2025\/04\/IMG_2364-1024x768.jpeg 1024w, \/hazlina\/wp-content\/uploads\/2025\/04\/IMG_2364-300x225.jpeg 300w, \/hazlina\/wp-content\/uploads\/2025\/04\/IMG_2364-768x576.jpeg 768w, \/hazlina\/wp-content\/uploads\/2025\/04\/IMG_2364-1200x900.jpeg 1200w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-32007\" src=\"\/hazlina\/wp-content\/uploads\/2025\/04\/IMG_2365-1024x768.jpeg\" alt=\"\" width=\"840\" height=\"630\" srcset=\"\/hazlina\/wp-content\/uploads\/2025\/04\/IMG_2365-1024x768.jpeg 1024w, \/hazlina\/wp-content\/uploads\/2025\/04\/IMG_2365-300x225.jpeg 300w, \/hazlina\/wp-content\/uploads\/2025\/04\/IMG_2365-768x576.jpeg 768w, \/hazlina\/wp-content\/uploads\/2025\/04\/IMG_2365-1200x900.jpeg 1200w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-32006\" src=\"\/hazlina\/wp-content\/uploads\/2025\/04\/IMG_2366-1024x768.jpeg\" alt=\"\" width=\"840\" height=\"630\" srcset=\"\/hazlina\/wp-content\/uploads\/2025\/04\/IMG_2366-1024x768.jpeg 1024w, \/hazlina\/wp-content\/uploads\/2025\/04\/IMG_2366-300x225.jpeg 300w, \/hazlina\/wp-content\/uploads\/2025\/04\/IMG_2366-768x576.jpeg 768w, \/hazlina\/wp-content\/uploads\/2025\/04\/IMG_2366-1200x900.jpeg 1200w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-32005\" src=\"\/hazlina\/wp-content\/uploads\/2025\/04\/IMG_2367-1024x768.jpeg\" alt=\"\" width=\"840\" height=\"630\" srcset=\"\/hazlina\/wp-content\/uploads\/2025\/04\/IMG_2367-1024x768.jpeg 1024w, \/hazlina\/wp-content\/uploads\/2025\/04\/IMG_2367-300x225.jpeg 300w, \/hazlina\/wp-content\/uploads\/2025\/04\/IMG_2367-768x576.jpeg 768w, \/hazlina\/wp-content\/uploads\/2025\/04\/IMG_2367-1200x900.jpeg 1200w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-32004\" src=\"\/hazlina\/wp-content\/uploads\/2025\/04\/IMG_2368-1024x768.jpeg\" alt=\"\" width=\"840\" height=\"630\" srcset=\"\/hazlina\/wp-content\/uploads\/2025\/04\/IMG_2368-1024x768.jpeg 1024w, \/hazlina\/wp-content\/uploads\/2025\/04\/IMG_2368-300x225.jpeg 300w, \/hazlina\/wp-content\/uploads\/2025\/04\/IMG_2368-768x576.jpeg 768w, \/hazlina\/wp-content\/uploads\/2025\/04\/IMG_2368-1200x900.jpeg 1200w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-32003\" src=\"\/hazlina\/wp-content\/uploads\/2025\/04\/IMG_2374-1024x768.jpeg\" alt=\"\" width=\"840\" height=\"630\" srcset=\"\/hazlina\/wp-content\/uploads\/2025\/04\/IMG_2374-1024x768.jpeg 1024w, \/hazlina\/wp-content\/uploads\/2025\/04\/IMG_2374-300x225.jpeg 300w, \/hazlina\/wp-content\/uploads\/2025\/04\/IMG_2374-768x576.jpeg 768w, \/hazlina\/wp-content\/uploads\/2025\/04\/IMG_2374-1200x900.jpeg 1200w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This week in BTE1522, we focused on troubleshooting the Slider Game code as part of our hands-on approach to learning Python programming. Over the past four weeks, students had completed Steps 1 through 7 of the game development process \u2014 from designing a simple game window to implementing the &#8220;Game Over&#8221; condition. In Week 5, &hellip; <a href=\"\/hazlina\/2025\/04\/08\/bte1522-week-5-code-troubleshooting\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;BTE1522 &#8211; Week 5 &#8211; Code Troubleshooting&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[13],"class_list":["post-32002","post","type-post","status-publish","format-standard","hentry","category-information","tag-academia-python-prog"],"_links":{"self":[{"href":"\/hazlina-blog\/wp-json\/wp\/v2\/posts\/32002","targetHints":{"allow":["GET"]}}],"collection":[{"href":"\/hazlina-blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"\/hazlina-blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"\/hazlina-blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"\/hazlina-blog\/wp-json\/wp\/v2\/comments?post=32002"}],"version-history":[{"count":0,"href":"\/hazlina-blog\/wp-json\/wp\/v2\/posts\/32002\/revisions"}],"wp:attachment":[{"href":"\/hazlina-blog\/wp-json\/wp\/v2\/media?parent=32002"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"\/hazlina-blog\/wp-json\/wp\/v2\/categories?post=32002"},{"taxonomy":"post_tag","embeddable":true,"href":"\/hazlina-blog\/wp-json\/wp\/v2\/tags?post=32002"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}