{"id":1592,"date":"2024-05-21T14:03:00","date_gmt":"2024-05-21T12:03:00","guid":{"rendered":"http:\/\/labodemaths.fr\/WordPress3\/?p=1592"},"modified":"2024-05-22T10:09:05","modified_gmt":"2024-05-22T08:09:05","slug":"snt-microbit-et-jeu-d-epatience","status":"publish","type":"post","link":"https:\/\/labodemaths.fr\/WordPress3\/snt-microbit-et-jeu-d-epatience\/","title":{"rendered":"SNT: Microbit et jeu de patience"},"content":{"rendered":"\n<h4>Mission 1 : Utilisation de l&rsquo;acc\u00e9l\u00e9rom\u00e8tre sur la carte microbit<\/h4>\n\n\n\n<p>le lien vers l&rsquo;interface : <a href=\"https:\/\/python.microbit.org\/v\/beta\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/python.microbit.org\/v\/beta<\/a><\/p>\n\n\n\n<p>Programmer votre carte Microbit pour que si on la penche \u00e0 gauche, elle affiche une fl\u00e8che vers la gauche.<\/p>\n\n\n\n<h4>Mission 2 : <meta charset=\"utf-8\">Utilisation de l&rsquo; acc\u00e9l\u00e9rom\u00e8tre sur la carte microbit<\/h4>\n\n\n\n<p><meta charset=\"utf-8\">Programmer votre carte Microbit pour qu&rsquo;elle affiche une fl\u00e8che dans la direction o\u00f9 on la penche.<\/p>\n\n\n\n<h4>Mission 3 : Mise en place d&rsquo;un jeu de patience<\/h4>\n\n\n\n<p>Programmer votre carte Microbit pour qu&rsquo;elle affiche au hasard 2 leds d&rsquo;intensit\u00e9s diff\u00e9rentes. <\/p>\n\n\n\n<h4>Mission 4 : programmation d&rsquo;un jeu de patience<\/h4>\n\n\n\n<p>Compl\u00e9ter le code suivant pour mettre en place un jeu de patience sur Microbit :<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>from microbit import *\nimport random\nx_bille=random.randint(...,...)\ny_bille=random.randint(...,...)\nx_sortie=random.randint(...,...)\ny_sortie=random.randint(...,...)\n# on ve\u0301rifie que les 2 leds ne sont pas superpose\u0301es\nwhile (x_bille,y_bille).....(x_sortie,y_sortie):\n    x_sortie=random.randint(...,...)\n    y_sortie=random.randint(...,...)\n\nwhile True:\n    gesture = accelerometer.current_gesture()\n    if gesture == \"up\" and y_bille........:\n        y_bille=........\n    if gesture == \"down\" and y_bille........:\n        y_bille=........\n    if gesture == \"right\" and x_bille........:\n        x_bille=........\n    if gesture == \"left\" and x_bille........:\n        x_bille=........\n    if (x_bille,y_bille).......(x_sortie,y_sortie):\n        display.show(Image.HAPPY)\n        sleep(2000)\n    display.clear()\n    display.set_pixel(x_bille,y_bille,5)\n    display.set_pixel(x_sortie,y_sortie,9)\n    sleep(200)\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Mission 1 : Utilisation de l&rsquo;acc\u00e9l\u00e9rom\u00e8tre sur la carte microbit le lien vers l&rsquo;interface :&#8230;<\/p>\n<div class=\"more-link-wrapper\"><a class=\"more-link\" href=\"https:\/\/labodemaths.fr\/WordPress3\/snt-microbit-et-jeu-d-epatience\/\">Read the post<span class=\"screen-reader-text\">SNT: Microbit et jeu de patience<\/span><\/a><\/div>\n","protected":false},"author":2,"featured_media":1591,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[56],"tags":[],"_links":{"self":[{"href":"https:\/\/labodemaths.fr\/WordPress3\/wp-json\/wp\/v2\/posts\/1592"}],"collection":[{"href":"https:\/\/labodemaths.fr\/WordPress3\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/labodemaths.fr\/WordPress3\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/labodemaths.fr\/WordPress3\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/labodemaths.fr\/WordPress3\/wp-json\/wp\/v2\/comments?post=1592"}],"version-history":[{"count":5,"href":"https:\/\/labodemaths.fr\/WordPress3\/wp-json\/wp\/v2\/posts\/1592\/revisions"}],"predecessor-version":[{"id":2290,"href":"https:\/\/labodemaths.fr\/WordPress3\/wp-json\/wp\/v2\/posts\/1592\/revisions\/2290"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/labodemaths.fr\/WordPress3\/wp-json\/wp\/v2\/media\/1591"}],"wp:attachment":[{"href":"https:\/\/labodemaths.fr\/WordPress3\/wp-json\/wp\/v2\/media?parent=1592"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/labodemaths.fr\/WordPress3\/wp-json\/wp\/v2\/categories?post=1592"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/labodemaths.fr\/WordPress3\/wp-json\/wp\/v2\/tags?post=1592"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}