{"id":27973,"date":"2023-05-29T10:00:19","date_gmt":"2023-05-29T05:30:19","guid":{"rendered":"https:\/\/thecaferobot.com\/learn\/?p=27973"},"modified":"2024-07-10T12:25:33","modified_gmt":"2024-07-10T07:55:33","slug":"nokia-snake-game-on-arduino-3-steps-with-pictures","status":"publish","type":"post","link":"https:\/\/thecaferobot.com\/learn\/nokia-snake-game-on-arduino-3-steps-with-pictures\/","title":{"rendered":"\u0627\u062c\u0631\u0627\u06cc \u0628\u0627\u0632\u06cc \u0645\u0627\u0631 (Snake) \u0646\u0648\u06a9\u06cc\u0627 \u0628\u0627 \u0622\u0631\u062f\u0648\u06cc\u0646\u0648 [\u0633\u0647 \u06af\u0627\u0645 \u0628\u0627 \u0639\u06a9\u0633]"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"27973\" class=\"elementor elementor-27973\">\n\t\t\t\t\t\t<div class=\"elementor-inner\">\n\t\t\t\t<div class=\"elementor-section-wrap\">\n\t\t\t\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-caa7346 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"caa7346\" data-element_type=\"section\">\r\n\t\t\t\r\n\t\t\t\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\r\n\t\t\t\t\t\t\t\t<div class=\"elementor-row\">\r\n\t\t\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-2373242\" data-id=\"2373242\" data-element_type=\"column\">\r\n\r\n\t\t\t\t\t<div class=\"elementor-column-wrap elementor-element-populated\">\r\n\t\t\t\t\t\t\t<div class=\"elementor-widget-wrap\">\r\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-018412a elementor-widget elementor-widget-heading\" data-id=\"018412a\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">\u0645\u0642\u062f\u0645\u0647<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-6e552e7 elementor-widget elementor-widget-text-editor\" data-id=\"6e552e7\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-text-editor elementor-clearfix\">\n\t\t\t\t<p>\u0647\u0645\u06af\u06cc \u0628\u0627\u0632\u06cc \u062e\u0627\u0637\u0631\u0647\u200c\u0627\u0646\u06af\u06cc\u0632 Snake (\u0645\u0627\u0631) \u0631\u0627 \u062f\u0631 \u06af\u0648\u0634\u06cc\u200c\u0647\u0627\u06cc \u0642\u062f\u06cc\u0645\u06cc \u0646\u0648\u06a9\u06cc\u0627 \u0628\u0647 \u06cc\u0627\u062f \u062f\u0627\u0631\u06cc\u062f. \u06af\u0627\u0647\u06cc \u0627\u0648\u0642\u0627\u062a \u062f\u0644\u062a\u0627\u0646 \u0628\u0631\u0627\u06cc \u0627\u06cc\u0646 \u0628\u0627\u0632\u06cc \u0647\u0627\u06cc \u062e\u0627\u0637\u0631\u0647\u200c\u0627\u0646\u06af\u06cc\u0632 \u062a\u0646\u06af \u0645\u06cc\u200c\u0634\u0648\u062f \u0627\u0645\u0627 \u062f\u0633\u062a\u0631\u0633\u06cc \u0628\u0647 \u06af\u0648\u0634\u06cc\u200c\u0647\u0627\u06cc \u0646\u0648\u06a9\u06cc\u0627 \u0628\u0631\u0627\u06cc \u0627\u0646\u062c\u0627\u0645 \u0628\u0627\u0632\u06cc \u0645\u0642\u062f\u0648\u0631 \u0646\u0645\u06cc\u200c\u0628\u0627\u0634\u062f. \u062f\u0631 \u0627\u06cc\u0646 \u0635\u0648\u0631\u062a \u0634\u0645\u0627 \u0628\u0647 \u0633\u0627\u062f\u06af\u06cc \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u06cc\u062f \u062a\u0648\u0633\u0637 \u0628\u0631\u062f \u0622\u0631\u062f\u0648\u06cc\u0646\u0648 \u0648 \u06cc\u06a9 \u0646\u0645\u0627\u06cc\u0634\u06af\u0631 \u062f\u0644\u062e\u0648\u0627\u0647\u060c \u0627\u06cc\u0646 \u0628\u0627\u0632\u06cc \u0631\u0627 \u0628\u0631\u0627\u06cc \u062e\u0648\u062f\u062a\u0627\u0646 \u0633\u0627\u062e\u062a\u0647 \u0648 \u0627\u0632 \u0622\u0646 \u0644\u0630\u062a \u0628\u0628\u0631\u06cc\u062f.<br \/>\u0645\u0627\u0631\u06cc \u06a9\u0647 \u0628\u0627 \u062e\u0648\u0631\u062f\u0646 \u063a\u0630\u0627 \u0628\u0632\u0631\u06af\u200c\u062a\u0631 \u0645\u06cc\u200c\u0634\u062f \u0648 \u0628\u0627\u0632\u06cc \u062a\u0627 \u062c\u0627\u06cc\u06cc \u0627\u062f\u0627\u0645\u0647 \u067e\u06cc\u062f\u0627 \u0645\u06cc\u200c\u06a9\u0631\u062f \u06a9\u0647 \u0645\u0627\u0631 \u0628\u0647 \u062e\u0648\u062f\u0634 \u0628\u0631\u062e\u0648\u0631\u062f \u0646\u06a9\u0646\u062f. \u0647\u0631 \u0686\u0647 \u0627\u06cc\u0646 \u0645\u0627\u0631 \u0628\u0632\u0631\u06af \u062a\u0631 \u0645\u06cc\u200c\u0634\u062f\u060c \u0627\u062f\u0627\u0645\u0647 \u0628\u0627\u0632\u06cc \u0648 \u06a9\u0646\u062a\u0631\u0644 \u0622\u0646 \u0633\u062e\u062a\u200c\u062a\u0631 \u0648 \u0647\u0645\u0686\u0646\u06cc\u0646 \u0631\u06a9\u0648\u0631\u062f \u0634\u0645\u0627 \u0646\u06cc\u0632 \u0628\u06cc\u0634\u062a\u0631 \u0645\u06cc\u200c\u0634\u062f.<\/p>\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-0c2b007 elementor-widget elementor-widget-image\" data-id=\"0c2b007\" data-element_type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-image\">\n\t\t\t\t\t\t\t\t\t\t\t\t<img width=\"1140\" height=\"713\" src=\"https:\/\/thecaferobot.com\/learn\/wp-content\/uploads\/2023\/05\/Snake-Game-introduction-1200x750.jpg\" class=\"attachment-large size-large\" alt=\"\u0628\u0627\u0632\u06cc \u0645\u0627\u0631 snake \u0628\u0627 \u0622\u0631\u062f\u0648\u06cc\u0646\u0648 - \u0645\u0642\u062f\u0645\u0647\" loading=\"lazy\" srcset=\"https:\/\/thecaferobot.com\/learn\/wp-content\/uploads\/2023\/05\/Snake-Game-introduction-600x375.jpg 600w, https:\/\/thecaferobot.com\/learn\/wp-content\/uploads\/2023\/05\/Snake-Game-introduction-768x480.jpg 768w\" sizes=\"(max-width: 1140px) 100vw, 1140px\" \/>\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-61b60c3 elementor-widget elementor-widget-heading\" data-id=\"61b60c3\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<h3 class=\"elementor-heading-title elementor-size-default\">\u0622\u0646\u0686\u0647 \u062f\u0631 \u0627\u06cc\u0646 \u0622\u0645\u0648\u0632\u0634 \u06cc\u0627\u062f \u0645\u06cc\u200c\u06af\u06cc\u0631\u06cc\u062f<\/h3>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b516ae2 elementor-widget elementor-widget-text-editor\" data-id=\"b516ae2\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-text-editor elementor-clearfix\">\n\t\t\t\t<p>\u0647\u0645\u0627\u0646\u0637\u0648\u0631 \u06a9\u0647 \u0628\u06cc\u0627\u0646 \u0634\u062f\u060c \u062f\u0631 \u0627\u06cc\u0646 \u0622\u0645\u0648\u0632\u0634 \u0642\u0635\u062f \u062f\u0627\u0631\u06cc\u0645 \u062a\u0648\u0633\u0637 \u0628\u0631\u062f \u0622\u0631\u062f\u0648\u06cc\u0646\u0648\u060c \u0628\u0627\u0632\u06cc Snake (\u0645\u0627\u0631\u0628\u0627\u0632\u06cc) \u06af\u0648\u0634\u06cc \u0646\u0648\u06a9\u06cc\u0627 \u0631\u0627 \u0634\u0628\u06cc\u0647\u200c\u0633\u0627\u0632\u06cc \u06a9\u0646\u06cc\u0645. \u0628\u0631\u0627\u06cc \u0627\u06cc\u0646 \u06a9\u0627\u0631 \u0627\u0632 \u06cc\u06a9 \u062c\u0648\u06cc\u200c\u0627\u0633\u062a\u06cc\u06a9 \u0648 \u06cc\u06a9 \u0646\u0645\u0627\u06cc\u0634\u06af\u0631 \u0646\u06cc\u0632 \u06a9\u0645\u06a9 \u0645\u06cc\u200c\u06af\u06cc\u0631\u06cc\u0645. \u0627\u06cc\u0646 \u06a9\u0627\u0631 \u0631\u0627 \u0628\u0647 \u062f\u0648 \u0631\u0648\u0634 \u0648 \u0628\u0647 \u0648\u0633\u06cc\u0644\u0647 \u062f\u0648 \u0646\u0645\u0627\u06cc\u0634\u06af\u0631 \u0645\u062a\u0641\u0627\u0648\u062a \u0627\u062c\u0631\u0627 \u0645\u06cc\u200c\u06a9\u0646\u06cc\u0645:<\/p><ul><li>\u0627\u062c\u0631\u0627\u06cc \u0628\u0627\u0632\u06cc \u0628\u0627 \u0646\u0645\u0627\u06cc\u0634\u06af\u0631 \u0645\u0627\u062a\u0631\u06cc\u0633 LED \u062f\u0631\u0627\u06cc\u0648\u0631 Max7219<\/li><li>\u0627\u062c\u0631\u0627\u06cc \u0628\u0627\u0632\u06cc \u062a\u0648\u0633\u0637 \u0646\u0645\u0627\u06cc\u0634\u06af\u0631 LCD \u06a9\u0627\u0631\u0627\u06a9\u062a\u0631\u06cc 1602<\/li><\/ul>\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-61bda7c elementor-widget elementor-widget-image\" data-id=\"61bda7c\" data-element_type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-image\">\n\t\t\t\t\t\t\t\t\t\t\t\t<img width=\"1140\" height=\"713\" src=\"https:\/\/thecaferobot.com\/learn\/wp-content\/uploads\/2023\/05\/Snake-Game-target-1200x750.jpg\" class=\"attachment-large size-large\" alt=\"\u0628\u0627\u0632\u06cc \u0645\u0627\u0631 snake \u0628\u0627 \u0622\u0631\u062f\u0648\u06cc\u0646\u0648 - \u0646\u0645\u0627\u06cc\u0634\u06af\u0631\u0647\u0627\" loading=\"lazy\" srcset=\"https:\/\/thecaferobot.com\/learn\/wp-content\/uploads\/2023\/05\/Snake-Game-target-600x375.jpg 600w, https:\/\/thecaferobot.com\/learn\/wp-content\/uploads\/2023\/05\/Snake-Game-target-768x480.jpg 768w\" sizes=\"(max-width: 1140px) 100vw, 1140px\" \/>\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-4563131 elementor-widget elementor-widget-heading\" data-id=\"4563131\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">\u0644\u0648\u0627\u0632\u0645\u06cc \u06a9\u0647 \u0628\u0647 \u0622\u0646 \u0627\u062d\u062a\u06cc\u0627\u062c \u062f\u0627\u0631\u06cc\u062f<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-0174a72 elementor-widget elementor-widget-text-editor\" data-id=\"0174a72\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-text-editor elementor-clearfix\">\n\t\t\t\t<p>\u062c\u0647\u062a \u0627\u062f\u0627\u0645\u0647 \u0622\u0645\u0648\u0632\u0634 \u0628\u0647 \u0642\u0637\u0639\u0627\u062a \u0648 \u0644\u0648\u0627\u0632\u0645 \u0632\u06cc\u0631 \u0646\u06cc\u0627\u0632 \u062f\u0627\u0631\u06cc\u062f:<\/p>\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-0b5e735 elementor-widget elementor-widget-image\" data-id=\"0b5e735\" data-element_type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-image\">\n\t\t\t\t\t\t\t\t\t\t\t\t<img width=\"1140\" height=\"713\" src=\"https:\/\/thecaferobot.com\/learn\/wp-content\/uploads\/2023\/05\/Snake-Game-Required-Materials-1200x750.jpg\" class=\"attachment-large size-large\" alt=\"\u0628\u0627\u0632\u06cc \u0645\u0627\u0631 snake \u0628\u0627 \u0622\u0631\u062f\u0648\u06cc\u0646\u0648 - \u0644\u0648\u0627\u0632\u0645 \u0645\u0648\u0631\u062f \u0646\u06cc\u0627\u0632\" loading=\"lazy\" srcset=\"https:\/\/thecaferobot.com\/learn\/wp-content\/uploads\/2023\/05\/Snake-Game-Required-Materials-600x375.jpg 600w, https:\/\/thecaferobot.com\/learn\/wp-content\/uploads\/2023\/05\/Snake-Game-Required-Materials-768x480.jpg 768w\" sizes=\"(max-width: 1140px) 100vw, 1140px\" \/>\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-94f8427 elementor-widget elementor-widget-heading\" data-id=\"94f8427\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<h3 class=\"elementor-heading-title elementor-size-default\">\u0642\u0637\u0639\u0627\u062a \u0645\u0648\u0631\u062f\u0646\u06cc\u0627\u0632<\/h3>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-85b9cfc elementor-widget elementor-widget-html\" data-id=\"85b9cfc\" data-element_type=\"widget\" data-widget_type=\"html.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<div class=\"table-2\">\r\n<table width=\"100%\" class=\"zebra\">\r\n<tbody>\r\n\r\n<tr>\r\n\t<td width=\"70%\"> \u0628\u0631\u062f \u0622\u0631\u062f\u0648\u06cc\u0646\u0648 Uno\r\n<\/td>\r\n\t<td class=\"center\" width=\"10%\">\u00d7<\/td>\r\n    <td class=\"center\" width=\"10%\">1<\/td>\r\n\t<td class=\"center\" width=\"10%\"><a href=\"http:\/\/thecaferobot.com\/store\/arduino-uno-r3\r\n\" target=\"_blank\"><i class=\"fa fa-shopping-cart\" style=\"\"><\/i><\/a><\/td>\r\n<\/tr>\r\n<tr>\r\n\t<td width=\"70%\"> \u0628\u0631\u062f \u0628\u0648\u0631\u062f 400 \u062d\u0641\u0631\u0647 \u0627\u06cc 5.5 * 8.5 \u0633\u0627\u0646\u062a\u06cc \u0645\u062a\u0631\r\n<\/td>\r\n\t<td class=\"center\" width=\"10%\">\u00d7<\/td>\r\n    <td class=\"center\" width=\"10%\">1<\/td>\r\n\t<td class=\"center\" width=\"10%\"><a href=\"https:\/\/thecaferobot.com\/store\/bread-board-8-5-8-5cm  \r\n\" target=\"_blank\"><i class=\"fa fa-shopping-cart\" style=\"\"><\/i><\/a><\/td>\r\n<\/tr>\r\n<tr>\r\n\t<td width=\"70%\"> \u0645\u0627\u0698\u0648\u0644 \u0635\u0641\u062d\u0647 \u0646\u0645\u0627\u06cc\u0634 LED \u0645\u0627\u062a\u0631\u06cc\u0633\u06cc 8X8 \u062a\u06af \u0631\u0646\u06af \u062f\u0627\u0631\u0627\u06cc \u0686\u06cc\u067e \u062f\u0631\u0627\u06cc\u0648\u0631 MAX7219\r\n<\/td>\r\n\t<td class=\"center\" width=\"10%\">\u00d7<\/td>\r\n    <td class=\"center\" width=\"10%\">1<\/td>\r\n\t<td class=\"center\" width=\"10%\"><a href=\"https:\/\/thecaferobot.com\/store\/max7219-dot-matrix\r\n\" target=\"_blank\"><i class=\"fa fa-shopping-cart\" style=\"\"><\/i><\/a><\/td>\r\n<\/tr>\r\n<tr>\r\n\t<td width=\"70%\"> \u0634\u06cc\u0644\u062f \u0646\u0645\u0627\u06cc\u0634\u06af\u0631 LCD \u06a9\u0627\u0631\u0627\u06a9\u062a\u0631\u06cc 1602 \u0622\u0631\u062f\u0648\u06cc\u0646\u0648\r\n<\/td>\r\n\t<td class=\"center\" width=\"10%\">\u00d7<\/td>\r\n    <td class=\"center\" width=\"10%\">1<\/td>\r\n\t<td class=\"center\" width=\"10%\"><a href=\"https:\/\/thecaferobot.com\/store\/arduino-lcd1602-character-lcd-keypad-shield\r\n\" target=\"_blank\"><i class=\"fa fa-shopping-cart\" style=\"\"><\/i><\/a><\/td>\r\n<\/tr>\r\n<tr>\r\n\t<td width=\"70%\"> \u0645\u0627\u0698\u0648\u0644 \u062c\u0648\u06cc \u0627\u0633\u062a\u06cc\u06a9 \u062f\u0648 \u0645\u062d\u0648\u0631\u0647\r\n<\/td>\r\n\t<td class=\"center\" width=\"10%\">\u00d7<\/td>\r\n    <td class=\"center\" width=\"10%\">1<\/td>\r\n\t<td class=\"center\" width=\"10%\"><a href=\"https:\/\/thecaferobot.com\/store\/dual-axis-joystick\r\n\" target=\"_blank\"><i class=\"fa fa-shopping-cart\" style=\"\"><\/i><\/a><\/td>\r\n<\/tr>\r\n<tr>\r\n\t<td width=\"70%\"> \u0648\u0644\u0648\u0645 10 \u06a9\u06cc\u0644\u0648 \u0627\u0647\u0645 \u0628\u0633\u062a\u0647 10 \u062a\u0627\u06cc\u06cc\r\n<\/td>\r\n\t<td class=\"center\" width=\"10%\">\u00d7<\/td>\r\n    <td class=\"center\" width=\"10%\">1<\/td>\r\n\t<td class=\"center\" width=\"10%\"><a href=\"https:\/\/thecaferobot.com\/store\/10k-volume\r\n\" target=\"_blank\"><i class=\"fa fa-shopping-cart\" style=\"\"><\/i><\/a><\/td>\r\n<\/tr>\r\n<tr>\r\n\t<td width=\"70%\"> \u0633\u06cc\u0645 \u062c\u0627\u0645\u067e\u0631 \u0646\u0631\u06cc \u0628\u0647 \u0646\u0631\u06cc 20 \u0633\u0627\u0646\u062a\u06cc \u0645\u062a\u0631\u06cc \u0628\u0633\u062a\u0647 40 \u062a\u0627\u06cc\u06cc\r\n<\/td>\r\n\t<td class=\"center\" width=\"10%\">\u00d7<\/td>\r\n    <td class=\"center\" width=\"10%\">1<\/td>\r\n\t<td class=\"center\" width=\"10%\"><a href=\"https:\/\/thecaferobot.com\/store\/male-male-40p-21cm\r\n\" target=\"_blank\"><i class=\"fa fa-shopping-cart\" style=\"\"><\/i><\/a><\/td>\r\n<\/tr>\r\n<tr>\r\n\t<td width=\"70%\"> \u0633\u06cc\u0645 \u062c\u0627\u0645\u067e\u0631 \u0646\u0631\u06cc \u0628\u0647 \u0645\u0627\u062f\u06af\u06cc 20 \u0633\u0627\u0646\u062a\u06cc \u0645\u062a\u0631\u06cc \u0628\u0633\u062a\u0647 40 \u062a\u0627\u06cc\u06cc\r\n<\/td>\r\n\t<td class=\"center\" width=\"10%\">\u00d7<\/td>\r\n    <td class=\"center\" width=\"10%\">1<\/td>\r\n\t<td class=\"center\" width=\"10%\"><a href=\"https:\/\/thecaferobot.com\/store\/female-male-40p-21cm\r\n\" target=\"_blank\"><i class=\"fa fa-shopping-cart\" style=\"\"><\/i><\/a><\/td>\r\n<\/tr>\r\n\r\n<\/tbody>\r\n<\/table>\r\n<\/div>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-46e7598 elementor-widget elementor-widget-heading\" data-id=\"46e7598\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<h3 class=\"elementor-heading-title elementor-size-default\">\u0646\u0631\u0645 \u0627\u0641\u0632\u0627\u0631\u0647\u0627\u06cc \u0645\u0648\u0631\u062f\u0646\u06cc\u0627\u0632<\/h3>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-35a6d20 elementor-widget elementor-widget-html\" data-id=\"35a6d20\" data-element_type=\"widget\" data-widget_type=\"html.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<div class=\"table-2\">\r\n<table width=\"100%\" class=\"zebra\">\r\n<tbody>\r\n\r\n<tr>\r\n\t<td width=\"90%\">Arduino IDE<\/td>\r\n\t<td class=\"center\" width=\"10%\"><a href=\"https:\/\/www.arduino.cc\/en\/Main\/Software\" target=\"_blank\"><i class=\"fa fa-info\" style=\"\"><\/i><\/a><\/td>\r\n<\/tr>\r\n\r\n\r\n<\/tbody>\r\n<\/table>\r\n<\/div>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-5c143ec elementor-widget elementor-widget-heading\" data-id=\"5c143ec\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">\u0627\u062c\u0631\u0627\u06cc \u0628\u0627\u0632\u06cc Snake  \u062a\u0648\u0633\u0637 \u0646\u0645\u0627\u06cc\u0634\u06af\u0631 \u0645\u0627\u062a\u0631\u06cc\u0633 LED \u0628\u0627 \u062f\u0631\u0627\u06cc\u0648\u0631 Max7219  \u0648 \u0622\u0631\u062f\u0648\u06cc\u0646\u0648<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-0fc308c elementor-widget elementor-widget-heading\" data-id=\"0fc308c\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<h3 class=\"elementor-heading-title elementor-size-default\">\u06af\u0627\u0645 \u0627\u0648\u0644: \u0633\u06cc\u0645\u200c\u0628\u0646\u062f\u06cc <\/h3>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-6328761 elementor-widget elementor-widget-text-editor\" data-id=\"6328761\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-text-editor elementor-clearfix\">\n\t\t\t\t<p>\u0627\u0628\u062a\u062f\u0627 \u062a\u0648\u0633\u0637 \u0645\u062f\u0627\u0631 \u0632\u06cc\u0631 \u0642\u0637\u0639\u0627\u062a \u0631\u0627 \u0628\u0647 \u0622\u0631\u062f\u0648\u06cc\u0646\u0648 \u0645\u062a\u0635\u0644 \u06a9\u0646\u06cc\u062f:<\/p>\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-d77eaf3 elementor-widget elementor-widget-image\" data-id=\"d77eaf3\" data-element_type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-image\">\n\t\t\t\t\t\t\t\t\t\t\t\t<img width=\"1140\" height=\"713\" src=\"https:\/\/thecaferobot.com\/learn\/wp-content\/uploads\/2023\/05\/Snake-Game-circuit1-1200x750.jpg\" class=\"attachment-large size-large\" alt=\"Snake-game Interface Circuit\" loading=\"lazy\" srcset=\"https:\/\/thecaferobot.com\/learn\/wp-content\/uploads\/2023\/05\/Snake-Game-circuit1-600x375.jpg 600w, https:\/\/thecaferobot.com\/learn\/wp-content\/uploads\/2023\/05\/Snake-Game-circuit1-768x480.jpg 768w\" sizes=\"(max-width: 1140px) 100vw, 1140px\" \/>\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-f01ea4c elementor-widget elementor-widget-alert\" data-id=\"f01ea4c\" data-element_type=\"widget\" data-widget_type=\"alert.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"elementor-alert elementor-alert-info\" role=\"alert\">\n\t\t\t<span class=\"elementor-alert-title\">\u0646\u06a9\u062a\u0647<\/span>\n\t\t\t\t\t\t\t<span class=\"elementor-alert-description\">\u067e\u062a\u0627\u0646\u0633\u06cc\u0648\u0645\u062a\u0631 \u0628\u0631\u0627\u06cc \u062a\u063a\u06cc\u06cc\u0631 \u0633\u0631\u0639\u062a \u0628\u0627\u0632\u06cc \u062a\u0639\u0628\u06cc\u0647 \u0634\u062f\u0647 \u0627\u0633\u062a. <br>\n\u0647\u0631 \u0686\u0647 \u0633\u0631\u0639\u062a \u0628\u0627\u0632\u06cc \u0631\u0627 \u0627\u0641\u0632\u0627\u06cc\u0634 \u062f\u0647\u06cc\u062f\u060c \u0633\u062e\u062a\u06cc \u0628\u0627\u0632\u06cc \u0646\u06cc\u0632 \u0628\u06cc\u0634\u062a\u0631 \u0645\u06cc\u200c\u0634\u0648\u062f. \n<\/span>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-1da24da elementor-widget elementor-widget-heading\" data-id=\"1da24da\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<h3 class=\"elementor-heading-title elementor-size-default\">\u06af\u0627\u0645 \u062f\u0648\u0645: \u06a9\u062f \u0628\u0631\u0646\u0627\u0645\u0647 <\/h3>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-c68d408 elementor-widget elementor-widget-text-editor\" data-id=\"c68d408\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-text-editor elementor-clearfix\">\n\t\t\t\t<p>\u062f\u0631 \u0627\u062f\u0627\u0645\u0647 \u0648 \u067e\u0633 \u0627\u0632 \u0627\u062a\u0635\u0627\u0644 \u0622\u0631\u062f\u0648\u06cc\u0646\u0648 \u0628\u0647 \u06a9\u0627\u0645\u067e\u06cc\u0648\u062a\u0631\u060c \u0628\u0631\u0646\u0627\u0645\u0647 \u0632\u06cc\u0631 \u0631\u0627 \u0628\u0631 \u0631\u0648\u06cc \u0622\u0631\u062f\u0648\u06cc\u0646\u0648\u06cc \u062e\u0648\u062f \u0622\u067e\u0644\u0648\u062f \u0646\u0645\u0627\u0626\u06cc\u062f :<\/p>\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-fae7c88 elementor-widget elementor-widget-html\" data-id=\"fae7c88\" data-element_type=\"widget\" data-widget_type=\"html.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<pre class=\"line-numbers lang-arduino\"><code>\r\n\/*\r\n  Made on 01 Sep 2021\r\n  https:\/\/electropeak.com\/learn\/\r\n*\/\r\n\r\n#include \"LedControl.h\" \/\/ LedControl library is used for controlling a LED matrix. Find it using Library Manager or download zip here: https:\/\/github.com\/wayoda\/LedControl\r\n\r\n\/\/ there are defined all the pins\r\nstruct Pin {\r\n  static const short joystickX = A5;   \/\/ joystick X axis pin\r\n  static const short joystickY = A4;   \/\/ joystick Y axis pin\r\n  static const short joystickVCC = 1; \/\/ virtual VCC for the joystick (Analog 1) (to make the joystick connectable right next to the arduino nano)\r\n  static const short joystickGND = 2; \/\/ virtual GND for the joystick (Analog 0) (to make the joystick connectable right next to the arduino nano)\r\n\r\n  static const short potentiometer = A3; \/\/ potentiometer for snake speed control\r\n\r\n  static const short CLK = 8;   \/\/ clock for LED matrix\r\n  static const short CS  = 9;  \/\/ chip-select for LED matrix\r\n  static const short DIN = 10; \/\/ data-in for LED matrix\r\n};\r\n\r\n\/\/ LED matrix brightness: between 0(darkest) and 15(brightest)\r\nconst short intensity = 8;\r\n\r\n\/\/ lower = faster message scrolling\r\nconst short messageSpeed = 5;\r\n\r\n\/\/ initial snake length (1...63, recommended 3)\r\nconst short initialSnakeLength = 3;\r\n\r\n\r\nvoid setup() {\r\n  Serial.begin(115200);  \/\/ set the same baud rate on your Serial Monitor\r\n  initialize();         \/\/ initialize pins & LED matrix\r\n  calibrateJoystick(); \/\/ calibrate the joystick home (do not touch it)\r\n  showSnakeMessage(); \/\/ scrolls the 'snake' message around the matrix\r\n}\r\n\r\n\r\nvoid loop() {\r\n  generateFood();    \/\/ if there is no food, generate one\r\n  scanJoystick();    \/\/ watches joystick movements & blinks with food\r\n  calculateSnake();  \/\/ calculates snake parameters\r\n  handleGameStates();\r\n\r\n  \/\/ uncomment this if you want the current game board to be printed to the serial (slows down the game a bit)\r\n  \/\/ dumpGameBoard();\r\n}\r\n\r\n\r\n\r\n\r\n\r\n\/\/ --------------------------------------------------------------- \/\/\r\n\/\/ -------------------- supporting variables --------------------- \/\/\r\n\/\/ --------------------------------------------------------------- \/\/\r\n\r\nLedControl matrix(Pin::DIN, Pin::CLK, Pin::CS, 1);\r\n\r\nstruct Point {\r\n  int row = 0, col = 0;\r\n  Point(int row = 0, int col = 0): row(row), col(col) {}\r\n};\r\n\r\nstruct Coordinate {\r\n  int x = 0, y = 0;\r\n  Coordinate(int x = 0, int y = 0): x(x), y(y) {}\r\n};\r\n\r\nbool win = false;\r\nbool gameOver = false;\r\n\r\n\/\/ primary snake head coordinates (snake head), it will be randomly generated\r\nPoint snake;\r\n\r\n\/\/ food is not anywhere yet\r\nPoint food(-1, -1);\r\n\r\n\/\/ construct with default values in case the user turns off the calibration\r\nCoordinate joystickHome(500, 500);\r\n\r\n\/\/ snake parameters\r\nint snakeLength = initialSnakeLength; \/\/ chosen by the user in the config section\r\nint snakeSpeed = 1; \/\/ will be set according to potentiometer value, cannot be 0\r\nint snakeDirection = 0; \/\/ if it is 0, the snake does not move\r\n\r\n\/\/ direction constants\r\nconst short up     = 1;\r\nconst short right  = 2;\r\nconst short down   = 3; \/\/ 'down - 2' must be 'up'\r\nconst short left   = 4; \/\/ 'left - 2' must be 'right'\r\n\r\n\/\/ threshold where movement of the joystick will be accepted\r\nconst int joystickThreshold = 160;\r\n\r\n\/\/ artificial logarithmity (steepness) of the potentiometer (-1 = linear, 1 = natural, bigger = steeper (recommended 0...1))\r\nconst float logarithmity = 0.4;\r\n\r\n\/\/ snake body segments storage\r\nint gameboard[8][8] = {};\r\n\r\n\r\n\r\n\r\n\/\/ --------------------------------------------------------------- \/\/\r\n\/\/ -------------------------- functions -------------------------- \/\/\r\n\/\/ --------------------------------------------------------------- \/\/\r\n\r\n\r\n\/\/ if there is no food, generate one, also check for victory\r\nvoid generateFood() {\r\n  if (food.row == -1 || food.col == -1) {\r\n    \/\/ self-explanatory\r\n    if (snakeLength >= 64) {\r\n      win = true;\r\n      return; \/\/ prevent the food generator from running, in this case it would run forever, because it will not be able to find a pixel without a snake\r\n    }\r\n\r\n    \/\/ generate food until it is in the right position\r\n    do {\r\n      food.col = random(8);\r\n      food.row = random(8);\r\n    } while (gameboard[food.row][food.col] > 0);\r\n  }\r\n}\r\n\r\n\r\n\/\/ watches joystick movements & blinks with food\r\nvoid scanJoystick() {\r\n  int previousDirection = snakeDirection; \/\/ save the last direction\r\n  long timestamp = millis();\r\n\r\n  while (millis() < timestamp + snakeSpeed) {\r\n    \/\/ calculate snake speed exponentially (10...1000ms)\r\n    float raw = mapf(analogRead(Pin::potentiometer), 0, 1023, 0, 1);\r\n    snakeSpeed = mapf(pow(raw, 3.5), 0, 1, 10, 1000); \/\/ change the speed exponentially\r\n    if (snakeSpeed == 0) snakeSpeed = 1; \/\/ safety: speed can not be 0\r\n\r\n    \/\/ determine the direction of the snake\r\n    analogRead(Pin::joystickY) < joystickHome.y - joystickThreshold ? snakeDirection = up    : 0;\r\n    analogRead(Pin::joystickY) > joystickHome.y + joystickThreshold ? snakeDirection = down  : 0;\r\n    analogRead(Pin::joystickX) < joystickHome.x - joystickThreshold ? snakeDirection = left  : 0;\r\n    analogRead(Pin::joystickX) > joystickHome.x + joystickThreshold ? snakeDirection = right : 0;\r\n\r\n    \/\/ ignore directional change by 180 degrees (no effect for non-moving snake)\r\n    snakeDirection + 2 == previousDirection && previousDirection != 0 ? snakeDirection = previousDirection : 0;\r\n    snakeDirection - 2 == previousDirection && previousDirection != 0 ? snakeDirection = previousDirection : 0;\r\n\r\n    \/\/ intelligently blink with the food\r\n    matrix.setLed(0, food.row, food.col, millis() % 100 < 50 ? 1 : 0);\r\n  }\r\n}\r\n\r\n\r\n\/\/ calculate snake movement data\r\nvoid calculateSnake() {\r\n  switch (snakeDirection) {\r\n    case up:\r\n      snake.row--;\r\n      fixEdge();\r\n      matrix.setLed(0, snake.row, snake.col, 1);\r\n      break;\r\n\r\n    case right:\r\n      snake.col++;\r\n      fixEdge();\r\n      matrix.setLed(0, snake.row, snake.col, 1);\r\n      break;\r\n\r\n    case down:\r\n      snake.row++;\r\n      fixEdge();\r\n      matrix.setLed(0, snake.row, snake.col, 1);\r\n      break;\r\n\r\n    case left:\r\n      snake.col--;\r\n      fixEdge();\r\n      matrix.setLed(0, snake.row, snake.col, 1);\r\n      break;\r\n\r\n    default: \/\/ if the snake is not moving, exit\r\n      return;\r\n  }\r\n\r\n  \/\/ if there is a snake body segment, this will cause the end of the game (snake must be moving)\r\n  if (gameboard[snake.row][snake.col] > 1 && snakeDirection != 0) {\r\n    gameOver = true;\r\n    return;\r\n  }\r\n\r\n  \/\/ check if the food was eaten\r\n  if (snake.row == food.row && snake.col == food.col) {\r\n    food.row = -1; \/\/ reset food\r\n    food.col = -1;\r\n\r\n    \/\/ increment snake length\r\n    snakeLength++;\r\n\r\n    \/\/ increment all the snake body segments\r\n    for (int row = 0; row < 8; row++) {\r\n      for (int col = 0; col < 8; col++) {\r\n        if (gameboard[row][col] > 0 ) {\r\n          gameboard[row][col]++;\r\n        }\r\n      }\r\n    }\r\n  }\r\n\r\n  \/\/ add new segment at the snake head location\r\n  gameboard[snake.row][snake.col] = snakeLength + 1; \/\/ will be decremented in a moment\r\n\r\n  \/\/ decrement all the snake body segments, if segment is 0, turn off the corresponding led \r\n  for (int row = 0; row < 8; row++) {\r\n    for (int col = 0; col < 8; col++) {\r\n      \/\/ if there is a body segment, decrement it's value\r\n      if (gameboard[row][col] > 0 ) {\r\n        gameboard[row][col]--;\r\n      }\r\n\r\n      \/\/ display the current pixel\r\n      matrix.setLed(0, row, col, gameboard[row][col] == 0 ? 0 : 1);\r\n    }\r\n  }\r\n}\r\n\r\n\r\n\/\/ causes the snake to appear on the other side of the screen if it gets out of the edge\r\nvoid fixEdge() {\r\n  snake.col < 0 ? snake.col += 8 : 0;\r\n  snake.col > 7 ? snake.col -= 8 : 0;\r\n  snake.row < 0 ? snake.row += 8 : 0;\r\n  snake.row > 7 ? snake.row -= 8 : 0;\r\n}\r\n\r\n\r\nvoid handleGameStates() {\r\n  if (gameOver || win) {\r\n    unrollSnake();\r\n\r\n    showScoreMessage(snakeLength - initialSnakeLength);\r\n\r\n    if (gameOver) showGameOverMessage();\r\n    else if (win) showWinMessage();\r\n\r\n    \/\/ re-init the game\r\n    win = false;\r\n    gameOver = false;\r\n    snake.row = random(8);\r\n    snake.col = random(8);\r\n    food.row = -1;\r\n    food.col = -1;\r\n    snakeLength = initialSnakeLength;\r\n    snakeDirection = 0;\r\n    memset(gameboard, 0, sizeof(gameboard[0][0]) * 8 * 8);\r\n    matrix.clearDisplay(0);\r\n  }\r\n}\r\n\r\n\r\nvoid unrollSnake() {\r\n  \/\/ switch off the food LED\r\n  matrix.setLed(0, food.row, food.col, 0);\r\n\r\n  delay(800);\r\n\r\n  \/\/ flash the screen 5 times\r\n  for (int i = 0; i < 5; i++) {\r\n    \/\/ invert the screen\r\n    for (int row = 0; row < 8; row++) {\r\n      for (int col = 0; col < 8; col++) {\r\n        matrix.setLed(0, row, col, gameboard[row][col] == 0 ? 1 : 0);\r\n      }\r\n    }\r\n\r\n    delay(20);\r\n\r\n    \/\/ invert it back\r\n    for (int row = 0; row < 8; row++) {\r\n      for (int col = 0; col < 8; col++) {\r\n        matrix.setLed(0, row, col, gameboard[row][col] == 0 ? 0 : 1);\r\n      }\r\n    }\r\n\r\n    delay(50);\r\n\r\n  }\r\n\r\n\r\n  delay(600);\r\n\r\n  for (int i = 1; i <= snakeLength; i++) {\r\n    for (int row = 0; row < 8; row++) {\r\n      for (int col = 0; col < 8; col++) {\r\n        if (gameboard[row][col] == i) {\r\n          matrix.setLed(0, row, col, 0);\r\n          delay(100);\r\n        }\r\n      }\r\n    }\r\n  }\r\n}\r\n\r\n\r\n\/\/ calibrate the joystick home for 10 times\r\nvoid calibrateJoystick() {\r\n  Coordinate values;\r\n\r\n  for (int i = 0; i < 10; i++) {\r\n    values.x += analogRead(Pin::joystickX);\r\n    values.y += analogRead(Pin::joystickY);\r\n  }\r\n\r\n  joystickHome.x = values.x \/ 10;\r\n  joystickHome.y = values.y \/ 10;\r\n}\r\n\r\n\r\nvoid initialize() {\r\n  pinMode(Pin::joystickVCC, OUTPUT);\r\n  digitalWrite(Pin::joystickVCC, HIGH);\r\n\r\n  pinMode(Pin::joystickGND, OUTPUT);\r\n  digitalWrite(Pin::joystickGND, LOW);\r\n\r\n  matrix.shutdown(0, false);\r\n  matrix.setIntensity(0, intensity);\r\n  matrix.clearDisplay(0);\r\n\r\n  randomSeed(analogRead(A5));\r\n  snake.row = random(8);\r\n  snake.col = random(8);\r\n}\r\n\r\n\r\nvoid dumpGameBoard() {\r\n  String buff = \"\\n\\n\\n\";\r\n  for (int row = 0; row < 8; row++) {\r\n    for (int col = 0; col < 8; col++) {\r\n      if (gameboard[row][col] < 10) buff += \" \";\r\n      if (gameboard[row][col] != 0) buff += gameboard[row][col];\r\n      else if (col == food.col && row == food.row) buff += \"@\";\r\n      else buff += \"-\";\r\n      buff += \" \";\r\n    }\r\n    buff += \"\\n\";\r\n  }\r\n  Serial.println(buff);\r\n}\r\n\r\n\r\n\r\n\r\n\r\n\/\/ --------------------------------------------------------------- \/\/\r\n\/\/ -------------------------- messages --------------------------- \/\/\r\n\/\/ --------------------------------------------------------------- \/\/\r\n\r\nconst PROGMEM bool snakeMessage[8][84] = {\r\n  {0,0,0,0,0,0,0,0, 0,1,1,0,0,0,0,1,1,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},\r\n  {0,0,0,0,0,0,0,0, 0,1,1,1,0,0,1,1,1,0,1,1,0,0,0,1,0,0,0,0,0,0,0,0,0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0},\r\n  {0,0,0,0,0,0,0,0, 0,1,1,0,1,1,0,1,1,0,1,1,0,0,0,1,0,0,0,0,0,0,0,0,1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},\r\n  {0,0,0,0,0,0,0,0, 0,1,1,0,1,1,0,1,1,0,1,1,0,0,0,1,0,0,0,0,0,0,0,0,1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},\r\n  {0,0,0,0,0,0,0,0, 0,1,1,0,1,1,0,1,1,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},\r\n  {0,0,0,0,0,0,0,0, 0,1,1,0,1,1,0,1,1,0,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},\r\n  {0,0,0,0,0,0,0,0, 0,1,1,0,0,0,0,1,1,0,1,1,0,0,1,0,0,0,0,1,1,0,0,0,1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},\r\n  {0,0,0,0,0,0,0,0, 0,1,1,0,0,0,0,1,1,0,1,1,0,0,0,1,0,0,0,1,1,0,0,0,1, 0,1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0}\r\n};\r\n\r\nconst PROGMEM bool gameOverMessage[8][90] = {\r\n  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},\r\n  {0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0},\r\n  {0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0},\r\n  {0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0},\r\n  {0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0},\r\n  {0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0},\r\n  {0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},\r\n  {0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0}\r\n};\r\n\r\nconst PROGMEM bool scoreMessage[8][58] = {\r\n  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},\r\n  {0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},\r\n  {0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0},\r\n  {0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0},\r\n  {0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},\r\n  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0},\r\n  {0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0},\r\n  {0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}\r\n};\r\n\r\nconst PROGMEM bool digits[][8][8] = {\r\n  {\r\n    {0, 0, 0, 0, 0, 0, 0, 0},\r\n    {0, 0, 1, 1, 1, 1, 0, 0},\r\n    {0, 1, 1, 0, 0, 1, 1, 0},\r\n    {0, 1, 1, 0, 1, 1, 1, 0},\r\n    {0, 1, 1, 1, 0, 1, 1, 0},\r\n    {0, 1, 1, 0, 0, 1, 1, 0},\r\n    {0, 1, 1, 0, 0, 1, 1, 0},\r\n    {0, 0, 1, 1, 1, 1, 0, 0}\r\n  },\r\n  {\r\n    {0, 0, 0, 0, 0, 0, 0, 0},\r\n    {0, 0, 0, 1, 1, 0, 0, 0},\r\n    {0, 0, 0, 1, 1, 0, 0, 0},\r\n    {0, 0, 1, 1, 1, 0, 0, 0},\r\n    {0, 0, 0, 1, 1, 0, 0, 0},\r\n    {0, 0, 0, 1, 1, 0, 0, 0},\r\n    {0, 0, 0, 1, 1, 0, 0, 0},\r\n    {0, 1, 1, 1, 1, 1, 1, 0}\r\n  },\r\n  {\r\n    {0, 0, 0, 0, 0, 0, 0, 0},\r\n    {0, 0, 1, 1, 1, 1, 0, 0},\r\n    {0, 1, 1, 0, 0, 1, 1, 0},\r\n    {0, 0, 0, 0, 0, 1, 1, 0},\r\n    {0, 0, 0, 0, 1, 1, 0, 0},\r\n    {0, 0, 1, 1, 0, 0, 0, 0},\r\n    {0, 1, 1, 0, 0, 0, 0, 0},\r\n    {0, 1, 1, 1, 1, 1, 1, 0}\r\n  },\r\n  {\r\n    {0, 0, 0, 0, 0, 0, 0, 0},\r\n    {0, 0, 1, 1, 1, 1, 0, 0},\r\n    {0, 1, 1, 0, 0, 1, 1, 0},\r\n    {0, 0, 0, 0, 0, 1, 1, 0},\r\n    {0, 0, 0, 1, 1, 1, 0, 0},\r\n    {0, 0, 0, 0, 0, 1, 1, 0},\r\n    {0, 1, 1, 0, 0, 1, 1, 0},\r\n    {0, 0, 1, 1, 1, 1, 0, 0}\r\n  },\r\n  {\r\n    {0, 0, 0, 0, 0, 0, 0, 0},\r\n    {0, 0, 0, 0, 1, 1, 0, 0},\r\n    {0, 0, 0, 1, 1, 1, 0, 0},\r\n    {0, 0, 1, 0, 1, 1, 0, 0},\r\n    {0, 1, 0, 0, 1, 1, 0, 0},\r\n    {0, 1, 1, 1, 1, 1, 1, 0},\r\n    {0, 0, 0, 0, 1, 1, 0, 0},\r\n    {0, 0, 0, 0, 1, 1, 0, 0}\r\n  },\r\n  {\r\n    {0, 0, 0, 0, 0, 0, 0, 0},\r\n    {0, 1, 1, 1, 1, 1, 1, 0},\r\n    {0, 1, 1, 0, 0, 0, 0, 0},\r\n    {0, 1, 1, 1, 1, 1, 0, 0},\r\n    {0, 0, 0, 0, 0, 1, 1, 0},\r\n    {0, 0, 0, 0, 0, 1, 1, 0},\r\n    {0, 1, 1, 0, 0, 1, 1, 0},\r\n    {0, 0, 1, 1, 1, 1, 0, 0}\r\n  },\r\n  {\r\n    {0, 0, 0, 0, 0, 0, 0, 0},\r\n    {0, 0, 1, 1, 1, 1, 0, 0},\r\n    {0, 1, 1, 0, 0, 1, 1, 0},\r\n    {0, 1, 1, 0, 0, 0, 0, 0},\r\n    {0, 1, 1, 1, 1, 1, 0, 0},\r\n    {0, 1, 1, 0, 0, 1, 1, 0},\r\n    {0, 1, 1, 0, 0, 1, 1, 0},\r\n    {0, 0, 1, 1, 1, 1, 0, 0}\r\n  },\r\n  {\r\n    {0, 0, 0, 0, 0, 0, 0, 0},\r\n    {0, 1, 1, 1, 1, 1, 1, 0},\r\n    {0, 1, 1, 0, 0, 1, 1, 0},\r\n    {0, 0, 0, 0, 1, 1, 0, 0},\r\n    {0, 0, 0, 0, 1, 1, 0, 0},\r\n    {0, 0, 0, 1, 1, 0, 0, 0},\r\n    {0, 0, 0, 1, 1, 0, 0, 0},\r\n    {0, 0, 0, 1, 1, 0, 0, 0}\r\n  },\r\n  {\r\n    {0, 0, 0, 0, 0, 0, 0, 0},\r\n    {0, 0, 1, 1, 1, 1, 0, 0},\r\n    {0, 1, 1, 0, 0, 1, 1, 0},\r\n    {0, 1, 1, 0, 0, 1, 1, 0},\r\n    {0, 0, 1, 1, 1, 1, 0, 0},\r\n    {0, 1, 1, 0, 0, 1, 1, 0},\r\n    {0, 1, 1, 0, 0, 1, 1, 0},\r\n    {0, 0, 1, 1, 1, 1, 0, 0}\r\n  },\r\n  {\r\n    {0, 0, 0, 0, 0, 0, 0, 0},\r\n    {0, 0, 1, 1, 1, 1, 0, 0},\r\n    {0, 1, 1, 0, 0, 1, 1, 0},\r\n    {0, 1, 1, 0, 0, 1, 1, 0},\r\n    {0, 0, 1, 1, 1, 1, 1, 0},\r\n    {0, 0, 0, 0, 0, 1, 1, 0},\r\n    {0, 1, 1, 0, 0, 1, 1, 0},\r\n    {0, 0, 1, 1, 1, 1, 0, 0}\r\n  }\r\n};\r\n\r\n\r\n\/\/ scrolls the 'snake' message around the matrix\r\nvoid showSnakeMessage() {\r\n  [&] {\r\n    for (int d = 0; d < sizeof(snakeMessage[0]) - 7; d++) {\r\n      for (int col = 0; col < 8; col++) {\r\n        delay(messageSpeed);\r\n        for (int row = 0; row < 8; row++) {\r\n          \/\/ this reads the byte from the PROGMEM and displays it on the screen\r\n          matrix.setLed(0, row, col, pgm_read_byte(&(snakeMessage[row][col + d])));\r\n        }\r\n      }\r\n\r\n      \/\/ if the joystick is moved, exit the message\r\n      if (analogRead(Pin::joystickY) < joystickHome.y - joystickThreshold\r\n              || analogRead(Pin::joystickY) > joystickHome.y + joystickThreshold\r\n              || analogRead(Pin::joystickX) < joystickHome.x - joystickThreshold\r\n              || analogRead(Pin::joystickX) > joystickHome.x + joystickThreshold) {\r\n        return; \/\/ return the lambda function\r\n      }\r\n    }\r\n  }();\r\n\r\n  matrix.clearDisplay(0);\r\n\r\n  \/\/ wait for joystick co come back\r\n  while (analogRead(Pin::joystickY) < joystickHome.y - joystickThreshold\r\n          || analogRead(Pin::joystickY) > joystickHome.y + joystickThreshold\r\n          || analogRead(Pin::joystickX) < joystickHome.x - joystickThreshold\r\n          || analogRead(Pin::joystickX) > joystickHome.x + joystickThreshold) {}\r\n\r\n}\r\n\r\n\r\n\/\/ scrolls the 'game over' message around the matrix\r\nvoid showGameOverMessage() {\r\n  [&] {\r\n    for (int d = 0; d < sizeof(gameOverMessage[0]) - 7; d++) {\r\n      for (int col = 0; col < 8; col++) {\r\n        delay(messageSpeed);\r\n        for (int row = 0; row < 8; row++) {\r\n          \/\/ this reads the byte from the PROGMEM and displays it on the screen\r\n          matrix.setLed(0, row, col, pgm_read_byte(&(gameOverMessage[row][col + d])));\r\n        }\r\n      }\r\n\r\n      \/\/ if the joystick is moved, exit the message\r\n      if (analogRead(Pin::joystickY) < joystickHome.y - joystickThreshold\r\n              || analogRead(Pin::joystickY) > joystickHome.y + joystickThreshold\r\n              || analogRead(Pin::joystickX) < joystickHome.x - joystickThreshold\r\n              || analogRead(Pin::joystickX) > joystickHome.x + joystickThreshold) {\r\n        return; \/\/ return the lambda function\r\n      }\r\n    }\r\n  }();\r\n\r\n  matrix.clearDisplay(0);\r\n\r\n  \/\/ wait for joystick co come back\r\n  while (analogRead(Pin::joystickY) < joystickHome.y - joystickThreshold\r\n          || analogRead(Pin::joystickY) > joystickHome.y + joystickThreshold\r\n          || analogRead(Pin::joystickX) < joystickHome.x - joystickThreshold\r\n          || analogRead(Pin::joystickX) > joystickHome.x + joystickThreshold) {}\r\n\r\n}\r\n\r\n\r\n\/\/ scrolls the 'win' message around the matrix\r\nvoid showWinMessage() {\r\n  \/\/ not implemented yet \/\/ TODO: implement it\r\n}\r\n\r\n\r\n\/\/ scrolls the 'score' message with numbers around the matrix\r\nvoid showScoreMessage(int score) {\r\n  if (score < 0 || score > 99) return;\r\n\r\n  \/\/ specify score digits\r\n  int second = score % 10;\r\n  int first = (score \/ 10) % 10;\r\n\r\n  [&] {\r\n    for (int d = 0; d < sizeof(scoreMessage[0]) + 2 * sizeof(digits[0][0]); d++) {\r\n      for (int col = 0; col < 8; col++) {\r\n        delay(messageSpeed);\r\n        for (int row = 0; row < 8; row++) {\r\n          if (d <= sizeof(scoreMessage[0]) - 8) {\r\n            matrix.setLed(0, row, col, pgm_read_byte(&(scoreMessage[row][col + d])));\r\n          }\r\n\r\n          int c = col + d - sizeof(scoreMessage[0]) + 6; \/\/ move 6 px in front of the previous message\r\n\r\n          \/\/ if the score is < 10, shift out the first digit (zero)\r\n          if (score < 10) c += 8;\r\n\r\n          if (c >= 0 && c < 8) {\r\n            if (first > 0) matrix.setLed(0, row, col, pgm_read_byte(&(digits[first][row][c]))); \/\/ show only if score is >= 10 (see above)\r\n          } else {\r\n            c -= 8;\r\n            if (c >= 0 && c < 8) {\r\n              matrix.setLed(0, row, col, pgm_read_byte(&(digits[second][row][c]))); \/\/ show always\r\n            }\r\n          }\r\n        }\r\n      }\r\n\r\n      \/\/ if the joystick is moved, exit the message\r\n      if (analogRead(Pin::joystickY) < joystickHome.y - joystickThreshold\r\n              || analogRead(Pin::joystickY) > joystickHome.y + joystickThreshold\r\n              || analogRead(Pin::joystickX) < joystickHome.x - joystickThreshold\r\n              || analogRead(Pin::joystickX) > joystickHome.x + joystickThreshold) {\r\n        return; \/\/ return the lambda function\r\n      }\r\n    }\r\n  }();\r\n\r\n  matrix.clearDisplay(0);\r\n\r\n  \/\/  \/\/ wait for joystick co come back\r\n  \/\/  while (analogRead(Pin::joystickY) < joystickHome.y - joystickThreshold\r\n  \/\/          || analogRead(Pin::joystickY) > joystickHome.y + joystickThreshold\r\n  \/\/          || analogRead(Pin::joystickX) < joystickHome.x - joystickThreshold\r\n  \/\/          || analogRead(Pin::joystickX) > joystickHome.x + joystickThreshold) {}\r\n\r\n}\r\n\r\n\r\n\/\/ standard map function, but with floats\r\nfloat mapf(float x, float in_min, float in_max, float out_min, float out_max) {\r\n  return (x - in_min) * (out_max - out_min) \/ (in_max - in_min) + out_min;\r\n}\r\n\r\n<\/code><\/pre>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-7100a3d elementor-widget elementor-widget-text-editor\" data-id=\"7100a3d\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-text-editor elementor-clearfix\">\n\t\t\t\t<p>\u062a\u0648\u0633\u0637 \u0628\u0631\u0646\u0627\u0645\u0647 \u0628\u0627\u0644\u0627 \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u06cc\u062f \u0628\u0627\u0632\u06cc Snake \u0631\u0627 \u0628\u0631 \u0631\u0648\u06cc \u0646\u0645\u0627\u06cc\u0634\u06af\u0631 \u0648 \u0628\u0647 \u0648\u0633\u06cc\u0644\u0647 \u06cc\u06a9 \u0639\u062f\u062f \u062c\u0648\u06cc\u200c\u0627\u0633\u062a\u06cc\u06a9 \u0627\u062c\u0631\u0627 \u06a9\u0646\u06cc\u062f. \u0628\u0627 \u062d\u0631\u06a9\u062a \u062c\u0648\u06cc\u200c\u0627\u0633\u062a\u06cc\u06a9 \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u06cc\u062f \u062d\u0631\u06a9\u062a \u0645\u0627\u0631 \u0631\u0627 \u06a9\u0646\u062a\u0631\u0644 \u06a9\u0646\u06cc\u062f. \u063a\u0630\u0627\u06cc \u0645\u0627\u0631 \u0628\u0647 \u0635\u0648\u0631\u062a \u062f\u0627\u062a \u0648 \u0646\u0642\u0637\u0647 \u0628\u0631 \u0631\u0648\u06cc \u0646\u0645\u0627\u06cc\u0634\u06af\u0631 \u0646\u0634\u0627\u0646 \u062f\u0627\u062f\u0647 \u0645\u06cc\u200c\u0634\u0648\u062f \u0648 \u0645\u0627\u0631 \u0628\u0627 \u0647\u0631 \u0628\u0627\u0631 \u062e\u0648\u0631\u062f\u0646 \u0647\u0631 \u06a9\u062f\u0627\u0645 \u06cc\u06a9 \u0627\u0632 \u0622\u0646\u0647\u0627\u060c \u0628\u0632\u0631\u06af\u062a\u0631 \u0645\u06cc\u200c\u0634\u0648\u062f. <br \/><strong>\u0686\u0646\u062f \u0646\u06a9\u062a\u0647 \u062f\u0631 \u0631\u0627\u0628\u0637\u0647 \u0628\u0627 \u0628\u0631\u0646\u0627\u0645\u0647 \u0628\u0627\u0644\u0627 \u0642\u0627\u0628\u0644 \u062a\u0648\u062c\u0647 \u0645\u06cc\u200c\u200e\u0628\u0627\u0634\u062f<\/strong>:<br \/>\u2022 \u067e\u0627\u06cc\u0647 \u0647\u0627\u06cc 8\u060c 9 \u0648 10 \u0628\u0647 \u0639\u0646\u0648\u0627\u0646 \u062e\u0631\u0648\u062c\u06cc \u0647\u0627\u06cc \u0622\u0631\u062f\u0648\u06cc\u0646\u0648 \u0628\u0647 \u0646\u0645\u0627\u06cc\u0634\u06af\u0631 \u0645\u0627\u062a\u0631\u06cc\u0633 LED \u0645\u062a\u0635\u0644 \u0645\u06cc\u200c\u06af\u0631\u062f\u0646\u062f. <br \/>\u2022 \u067e\u062a\u0627\u0646\u0633\u06cc\u0648\u0645\u062a\u0631 \u0628\u0631\u0627\u06cc \u06a9\u0646\u062a\u0631\u0644 \u0633\u0631\u0639\u062a \u0628\u0627\u0632\u06cc \u0628\u0647 \u0648\u0631\u0648\u062f\u06cc \u0622\u0646\u0627\u0644\u0648\u06af A3 \u0645\u062a\u0635\u0644 \u0645\u06cc\u200c\u06af\u0631\u062f\u062f. <br \/>\u2022 \u0645\u062d\u0648\u0631 x \u062c\u0648\u06cc\u200c\u0627\u0633\u062a\u06cc\u06a9 \u0628\u0647 A5 \u0648 \u0645\u062d\u0648\u0631 y \u062c\u0648\u06cc\u200c\u0627\u0633\u062a\u06cc\u06a9 \u0628\u0647 \u067e\u0627\u06cc\u0647 A4 \u0645\u062a\u0635\u0644 \u0645\u06cc\u200c\u06af\u0631\u062f\u062f.<\/p>\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-2dbb607 elementor-widget elementor-widget-heading\" data-id=\"2dbb607\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<h3 class=\"elementor-heading-title elementor-size-default\">\u06af\u0627\u0645 \u0633\u0648\u0645: \u0645\u0627\u0631 \u0628\u0627\u0632\u06cc<\/h3>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-4d450d6 elementor-widget elementor-widget-text-editor\" data-id=\"4d450d6\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-text-editor elementor-clearfix\">\n\t\t\t\t<p>\u062d\u0627\u0644 \u062f\u0631 \u0627\u06cc\u0646 \u0645\u0631\u062d\u0644\u0647 \u0648 \u067e\u0633 \u0627\u0632 \u0622\u067e\u0644\u0648\u062f \u0628\u0631\u0646\u0627\u0645\u0647\u060c \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u06cc\u062f \u0628\u0627\u0632\u06cc \u0631\u0627 \u0634\u0631\u0648\u0639 \u06a9\u0646\u06cc\u062f. <br \/>\u0628\u0627 \u062a\u06a9\u0627\u0646 \u062f\u0627\u062f\u0646 \u062c\u0648\u06cc\u200c\u0627\u0633\u062a\u06cc\u06a9\u060c \u0628\u0627\u0632\u06cc \u0634\u0631\u0648\u0639 \u0645\u06cc\u200c\u0634\u0648\u062f. \u0628\u0627\u0632\u06cc \u062a\u0627 \u062c\u0627\u06cc\u06cc \u0627\u062f\u0627\u0645\u0647 \u067e\u06cc\u062f\u0627 \u0645\u06cc\u200c\u06a9\u0646\u062f \u06a9\u0647 \u0633\u0631 \u0645\u0627\u0631 \u0628\u0627 \u0628\u062f\u0646\u0634 \u0628\u0631\u062e\u0648\u0631\u062f \u0646\u062f\u0627\u0634\u062a\u0647 \u0628\u0627\u0634\u062f. <\/p>\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-970b7d1 elementor-widget elementor-widget-alert\" data-id=\"970b7d1\" data-element_type=\"widget\" data-widget_type=\"alert.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"elementor-alert elementor-alert-info\" role=\"alert\">\n\t\t\t<span class=\"elementor-alert-title\">\u0646\u06a9\u062a\u0647<\/span>\n\t\t\t\t\t\t\t<span class=\"elementor-alert-description\">\u0631\u06a9\u0648\u0631\u062f \u0634\u0645\u0627 \u062f\u0631 \u0627\u0646\u062a\u0647\u0627\u06cc \u0628\u0627\u0632\u06cc \u062f\u0631 \u0635\u0641\u062d\u0647 \u0646\u0645\u0627\u06cc\u0634\u06af\u0631 \u0646\u0645\u0627\u06cc\u0634 \u062f\u0627\u062f\u0647 \u0645\u06cc\u200c\u0634\u0648\u062f. <\/span>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-acd2e0c elementor-widget elementor-widget-text-editor\" data-id=\"acd2e0c\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-text-editor elementor-clearfix\">\n\t\t\t\t<p>\u0641\u06cc\u0644\u0645 \u0632\u06cc\u0631 \u0646\u0634\u0627\u0646 \u062f\u0647\u0646\u062f\u0647 \u0646\u062d\u0648\u0647 \u0648 \u0631\u0648\u0634 \u0627\u0646\u062c\u0627\u0645 \u0628\u0627\u0632\u06cc \u0645\u06cc\u200c\u0628\u0627\u0634\u062f:<\/p>\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-8dd23f2 elementor-aspect-ratio-169 elementor-widget elementor-widget-video\" data-id=\"8dd23f2\" data-element_type=\"widget\" data-settings=\"{&quot;video_type&quot;:&quot;hosted&quot;,&quot;controls&quot;:&quot;yes&quot;,&quot;aspect_ratio&quot;:&quot;169&quot;}\" data-widget_type=\"video.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"e-hosted-video elementor-wrapper elementor-fit-aspect-ratio elementor-open-inline\">\n\t\t\t\t\t<video class=\"elementor-video\" src=\"https:\/\/thecaferobot.com\/learn\/wp-content\/uploads\/2023\/05\/Snake-arduino-max7219-12.mp4\" controls=\"\" controlsList=\"nodownload\"><\/video>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-eca009c elementor-widget elementor-widget-heading\" data-id=\"eca009c\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">\u0627\u062c\u0631\u0627\u06cc \u0628\u0627\u0632\u06cc Snake \u0628\u0627 \u0646\u0645\u0627\u06cc\u0634\u06af\u0631 LCD \u06a9\u0627\u0631\u0627\u06a9\u062a\u0631\u06cc 1602 \u0648 \u0622\u0631\u062f\u0648\u06cc\u0646\u0648<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-cc83982 elementor-widget elementor-widget-text-editor\" data-id=\"cc83982\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-text-editor elementor-clearfix\">\n\t\t\t\t<p>\u0627\u06cc\u0646 \u0628\u0627\u0631 \u0647\u0645\u0627\u0646 \u0628\u0627\u0632\u06cc \u0631\u0627 \u062a\u0648\u0633\u0637 \u06cc\u06a9 \u0646\u0645\u0627\u06cc\u0634\u06af\u0631 \u062f\u06cc\u06af\u0631 \u0627\u062c\u0631\u0627 \u0648 \u067e\u06cc\u0627\u062f\u0647\u200c\u0633\u0627\u0632\u06cc \u0645\u06cc\u200c\u06a9\u0646\u06cc\u0645.<\/p>\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-537832e elementor-widget elementor-widget-heading\" data-id=\"537832e\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<h3 class=\"elementor-heading-title elementor-size-default\">\u06af\u0627\u0645 \u0627\u0648\u0644: \u0633\u06cc\u0645\u200c\u0628\u0646\u062f\u06cc <\/h3>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-d231338 elementor-widget elementor-widget-text-editor\" data-id=\"d231338\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-text-editor elementor-clearfix\">\n\t\t\t\t<p>\u0627\u0628\u062a\u062f\u0627 \u062a\u0648\u0633\u0637 \u0645\u062f\u0627\u0631 \u0632\u06cc\u0631 \u0642\u0637\u0639\u0627\u062a \u0631\u0627 \u0628\u0647 \u0622\u0631\u062f\u0648\u06cc\u0646\u0648 \u0645\u062a\u0635\u0644 \u06a9\u0646\u06cc\u062f:<\/p>\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-9620303 elementor-widget elementor-widget-image\" data-id=\"9620303\" data-element_type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-image\">\n\t\t\t\t\t\t\t\t\t\t\t\t<img width=\"1140\" height=\"713\" src=\"https:\/\/thecaferobot.com\/learn\/wp-content\/uploads\/2023\/05\/Snake-Game-circuit2-1200x750.jpg\" class=\"attachment-large size-large\" alt=\"\" loading=\"lazy\" srcset=\"https:\/\/thecaferobot.com\/learn\/wp-content\/uploads\/2023\/05\/Snake-Game-circuit2-600x375.jpg 600w, https:\/\/thecaferobot.com\/learn\/wp-content\/uploads\/2023\/05\/Snake-Game-circuit2-768x480.jpg 768w\" sizes=\"(max-width: 1140px) 100vw, 1140px\" \/>\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-821a8e4 elementor-widget elementor-widget-alert\" data-id=\"821a8e4\" data-element_type=\"widget\" data-widget_type=\"alert.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"elementor-alert elementor-alert-info\" role=\"alert\">\n\t\t\t<span class=\"elementor-alert-title\">\u0646\u06a9\u062a\u0647<\/span>\n\t\t\t\t\t\t\t<span class=\"elementor-alert-description\">\u0628\u0647 \u0635\u0648\u0631\u062a \u0628\u0627\u0644\u0627\u060c \u0645\u0627\u0698\u0648\u0644 LCD \u0631\u0627 \u0628\u0631 \u0631\u0648\u06cc \u0622\u0631\u062f\u0648\u06cc\u0646\u0648 Uno \u0642\u0631\u0627\u0631 \u062f\u0647\u06cc\u062f. <\/span>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-0f0581e elementor-widget elementor-widget-alert\" data-id=\"0f0581e\" data-element_type=\"widget\" data-widget_type=\"alert.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"elementor-alert elementor-alert-info\" role=\"alert\">\n\t\t\t<span class=\"elementor-alert-title\">\u0646\u06a9\u062a\u0647<\/span>\n\t\t\t\t\t\t\t<span class=\"elementor-alert-description\">4 \u062f\u06a9\u0645\u0647 \u0648\u0633\u0637 \u0628\u0631\u0627\u06cc \u06a9\u0646\u062a\u0631\u0644 \u062c\u0647\u062a \u062d\u0631\u06a9\u062a \u0645\u0627\u0631 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0645\u06cc\u200c\u0634\u0648\u0646\u062f. \u0686\u0647\u0627\u0631 \u062c\u0647\u062a \u0628\u0627\u0644\u0627\u060c \u067e\u0627\u06cc\u06cc\u0646\u060c \u0631\u0627\u0633\u062a \u0648 \u0686\u067e \u0631\u0627 \u0627\u0632 \u0627\u06cc\u0646 \u0637\u0631\u06cc\u0642 \u0641\u0631\u0645\u0627\u0646 \u0645\u06cc\u200c\u062f\u0647\u06cc\u062f.<br> \n\u062f\u0631 \u0636\u0645\u0646 \u062f\u06a9\u0645\u0647 RST \u0646\u06cc\u0632 \u062c\u0647\u062a \u0631\u06cc\u0633\u062a \u06a9\u0631\u062f\u0646 \u0628\u0627\u0632\u06cc \u06a9\u0627\u0631\u0628\u0631\u062f \u062f\u0627\u0631\u062f. <br>\n\u0627\u0646\u062a\u062e\u0627\u0628 \u06af\u0632\u06cc\u0646\u0647 \u0647\u0627 \u0648 \u0634\u0631\u0648\u0639 \u0628\u0627\u0632\u06cc \u0646\u06cc\u0632 \u0628\u0627 \u062f\u06a9\u0645\u0647 SELECT \u0627\u0646\u062c\u0627\u0645 \u0645\u06cc\u200c\u0634\u0648\u062f. \n<\/span>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-2cb840b elementor-widget elementor-widget-heading\" data-id=\"2cb840b\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<h3 class=\"elementor-heading-title elementor-size-default\">\u06af\u0627\u0645 \u062f\u0648\u0645: \u06a9\u062f \u0628\u0631\u0646\u0627\u0645\u0647 <\/h3>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-3a43857 elementor-widget elementor-widget-text-editor\" data-id=\"3a43857\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-text-editor elementor-clearfix\">\n\t\t\t\t<p>\u062f\u0631 \u0627\u062f\u0627\u0645\u0647 \u0648 \u067e\u0633 \u0627\u0632 \u0627\u062a\u0635\u0627\u0644 \u0622\u0631\u062f\u0648\u06cc\u0646\u0648 \u0628\u0647 \u06a9\u0627\u0645\u067e\u06cc\u0648\u062a\u0631\u060c \u0628\u0631\u0646\u0627\u0645\u0647 \u0632\u06cc\u0631 \u0631\u0627 \u0628\u0631 \u0631\u0648\u06cc \u0622\u0631\u062f\u0648\u06cc\u0646\u0648\u06cc \u062e\u0648\u062f \u0622\u067e\u0644\u0648\u062f \u0646\u0645\u0627\u0626\u06cc\u062f :<\/p>\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-8dc0e56 elementor-widget elementor-widget-html\" data-id=\"8dc0e56\" data-element_type=\"widget\" data-widget_type=\"html.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<pre class=\"line-numbers lang-arduino\"><code>\r\n\/*\r\n  Made on 01 Sep 2021\r\n  https:\/\/electropeak.com\/learn\/\r\n*\/\r\n\r\n#include <LiquidCrystal.h>  \r\nbyte mySnake[8][8] = \r\n{\r\n{ B00000,\r\n  B00000,\r\n  B00011,\r\n  B00110,\r\n  B01100,\r\n  B11000,\r\n  B00000,\r\n},\r\n{ B00000,\r\n  B11000,\r\n  B11110,\r\n  B00011,\r\n  B00001,\r\n  B00000,\r\n  B00000,\r\n},\r\n{ B00000,\r\n  B00000,\r\n  B00000,\r\n  B00000,\r\n  B00000,\r\n  B11111,\r\n  B01110,\r\n},\r\n{ B00000,\r\n  B00000,\r\n  B00011,\r\n  B01111,\r\n  B11000,\r\n  B00000,\r\n  B00000,\r\n},\r\n{ B00000,\r\n  B11100,\r\n  B11111,\r\n  B00001,\r\n  B00000,\r\n  B00000,\r\n  B00000,\r\n},\r\n{ B00000,\r\n  B00000,\r\n  B00000,\r\n  B11000,\r\n  B01101,\r\n  B00111,\r\n  B00000,\r\n},\r\n{ B00000,\r\n  B00000,\r\n  B01110,\r\n  B11011,\r\n  B11111,\r\n  B01110,\r\n  B00000,\r\n},\r\n{ B00000,\r\n  B00000,\r\n  B00000,\r\n  B01000,\r\n  B10000,\r\n  B01000,\r\n  B00000,\r\n}\r\n};\r\nboolean levelz[5][2][16] = {\r\n{{false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false},\r\n{false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false}},\r\n{{true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true},\r\n{true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true}},\r\n{{true,false,false,false,true,false,false,false,false,false,false,true,false,false,false,true},\r\n{true,false,false,false,false,false,false,false,true,false,false,false,false,false,false,true}},\r\n{{true,false,true,false,false,false,false,false,false,true,false,false,false,true,false,false},\r\n{false,false,false,false,true,false,false,true,false,false,false,true,false,false,false,true}}\r\n};\r\nLiquidCrystal lcd(8, 9, 4, 5, 6, 7);\r\nunsigned long time, timeNow; \r\nint gameSpeed;\r\nboolean skip, gameOver, gameStarted;\r\nint olddir;\r\nint selectedLevel,levels;\r\nint adc_key_val[5] ={50, 200, 400, 600, 800 };\r\nint NUM_KEYS = 5;\r\nint adc_key_in;\r\nint key=-1;\r\nint oldkey=-1;\r\nboolean x[16][80];\r\nbyte myChar[8];\r\nbyte nullChar[8] = { 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 };\r\nboolean special;\r\nstruct partdef\r\n{\r\n  int row,column,dir; \/\/0 - up, 1 - down, 2 - right, 3 - left\r\n  struct partdef *next;\r\n}; \r\ntypedef partdef part;\r\npart *head, *tail;\r\nint i,j,collected;\r\nlong pc,pr;\r\nvoid drawMatrix()\r\n{\r\n  int cc=0;\r\n  if (!gameOver)\r\n  {\r\n  x[pr][pc] = true;\r\n  \/\/for (i=0;i<8;i++) lcd.createChar(i, nullChar);\r\n  for(int r=0;r<2;r++)\r\n  {\r\n    for(int c=0;c<16;c++)\r\n    {\r\n      special = false;\r\n      for(int i=0;i<8;i++)\r\n      {\r\n        byte b=B00000;\r\n        if (x[r*8+i][c*5+0]) {b+=B10000; special = true;}\r\n        if (x[r*8+i][c*5+1]) {b+=B01000; special = true;}\r\n        if (x[r*8+i][c*5+2]) {b+=B00100; special = true;}\r\n        if (x[r*8+i][c*5+3]) {b+=B00010; special = true;}\r\n        if (x[r*8+i][c*5+4]) {b+=B00001; special = true;}\r\n        myChar[i] = b;\r\n      }\r\n      if (special) \r\n      {\r\n        lcd.createChar(cc, myChar);\r\n        lcd.setCursor(c,r);\r\n        lcd.write(byte(cc));\r\n  cc++;\r\n      }\r\n      else \r\n      {\r\n        lcd.setCursor(c,r);\r\n        if (levelz[selectedLevel][r][c]) lcd.write(255);\r\n        else lcd.write(254);\r\n      }\r\n    }\r\n  } \r\n  }\r\n}\r\nvoid freeList()\r\n{\r\n  part *p,*q;\r\n  p = tail;\r\n  while (p!=NULL)\r\n  {\r\n    q = p;\r\n    p = p->next;\r\n    free(q);\r\n  }\r\n  head = tail = NULL;\r\n}\r\nvoid gameOverFunction()\r\n{\r\n  delay(1000);\r\n  lcd.clear();\r\n  freeList();\r\n  lcd.setCursor(3,0);\r\n  lcd.print(\"Game Over!\");\r\n  lcd.setCursor(4,1);\r\n  lcd.print(\"Score: \");\r\n  lcd.print(collected);\r\n  delay(1000);\r\n}\r\nvoid growSnake()\r\n{\r\n  part *p;\r\n  p = (part*)malloc(sizeof(part));\r\n  p->row = tail->row;\r\n  p->column = tail->column;\r\n  p->dir = tail->dir;\r\n  p->next = tail;\r\n  tail = p;\r\n}\r\nvoid newPoint()\r\n{\r\n  part *p;\r\n  p = tail;\r\n  boolean newp = true;\r\n  while (newp)\r\n  {\r\n    pr = random(16);\r\n    pc = random(80);\r\n    newp = false;\r\n    if (levelz[selectedLevel][pr \/ 8][pc \/ 5]) newp=true;\r\n    while (p->next != NULL && !newp) \r\n    {\r\n      if (p->row == pr && p->column == pc) newp = true;\r\n      p = p->next;\r\n    }\r\n  }\r\n  \r\n  if (collected < 13 && gameStarted) growSnake();\r\n}\r\nvoid moveHead()\r\n{\r\n  switch(head->dir) \/\/ 1 step in direction\r\n  {\r\n    case 0: head->row--; break;\r\n    case 1: head->row++; break;\r\n    case 2: head->column++; break;\r\n    case 3: head->column--; break;\r\n    default : break;\r\n  }\r\n  if (head->column >= 80) head->column = 0;\r\n  if (head->column < 0) head->column = 79;\r\n  if (head->row >= 16) head->row = 0;\r\n  if (head->row < 0) head->row = 15;\r\n  \r\n  if (levelz[selectedLevel][head->row \/ 8][head->column \/ 5]) gameOver = true; \/\/ wall collision check\r\n  \r\n  part *p;\r\n  p = tail;\r\n  while (p != head && !gameOver) \/\/ self collision \r\n  {\r\n    if (p->row == head->row && p->column == head->column) gameOver = true;\r\n    p = p->next;\r\n  }\r\n  if (gameOver)\r\n    gameOverFunction();\r\n  else\r\n  {\r\n  x[head->row][head->column] = true;\r\n  \r\n  if (head->row == pr && head->column == pc) \/\/ point pickup check\r\n  {\r\n    collected++;\r\n    if (gameSpeed < 25) gameSpeed+=3;\r\n    newPoint();\r\n  }\r\n  }\r\n}\r\nvoid moveAll()\r\n{\r\n  part *p;\r\n  p = tail;\r\n  x[p->row][p->column] = false;\r\n  while (p->next != NULL) \r\n  {\r\n    p->row = p->next->row;\r\n    p->column = p->next->column;\r\n    p->dir = p->next->dir;\r\n    p = p->next;\r\n  }\r\n  moveHead();\r\n}\r\nvoid createSnake(int n) \/\/ n = size of snake\r\n{\r\n  for (i=0;i<16;i++)\r\n    for (j=0;j<80;j++)\r\n      x[i][j] = false;\r\n    \r\n  part *p, *q;\r\n  tail = (part*)malloc(sizeof(part));\r\n  tail->row = 7;\r\n  tail->column = 39 + n\/2;\r\n  tail->dir = 3;\r\n  q = tail;\r\n  x[tail->row][tail->column] = true;\r\n  for (i = 0; i < n-1; i++) \/\/ build snake from tail to head\r\n  {\r\n    p = (part*)malloc(sizeof(part));\r\n    p->row = q->row;\r\n    p->column = q->column - 1; \/\/initial snake id placed horizoltally\r\n    x[p->row][p->column] = true;\r\n    p->dir = q->dir;\r\n    q->next = p;\r\n    q = p;\r\n  }\r\n  if (n>1)\r\n  {\r\n    p->next = NULL;\r\n    head  = p;\r\n  }\r\n  else \r\n  {\r\n    tail->next = NULL;\r\n    head = tail;\r\n  }\r\n}\r\nvoid startF()\r\n{\r\n  gameOver = false;\r\n  gameStarted = false;\r\n  selectedLevel = 1;\r\n  \r\n  lcd.clear();\r\n  lcd.setCursor(0,0);\r\n  lcd.print(\"Select level: 1\");\r\n  for(i=0;i<8;i++)\r\n  {\r\n    lcd.createChar(i,mySnake[i]);\r\n    lcd.setCursor(i+4,1);\r\n    lcd.write(byte(i));\r\n  }\r\n  collected = 0;\r\n  gameSpeed = 8;\r\n  createSnake(3);\r\n  time = 0;\r\n}\r\nvoid setup()\r\n{\r\n  levels = 5; \/\/number of lvls\r\n  lcd.begin(16, 2);\r\n  startF();\r\n}\r\nvoid loop()\r\n{\r\n  if (!gameOver && !gameStarted)\r\n  {\r\n   adc_key_in = analogRead(0);    \/\/ read the value from the sensor \r\n   key = get_key(adc_key_in);  \/\/ convert into key press\r\n   if (key != oldkey)   \/\/ if keypress is detected\r\n   {\r\n     delay(50);  \/\/ wait for debounce time\r\n     adc_key_in = analogRead(0);    \/\/ read the value from the sensor \r\n     key = get_key(adc_key_in);    \/\/ convert into key press\r\n     if (key != oldkey)    \r\n     {   \r\n       oldkey = key;\r\n       if (key >=0)\r\n       {\r\n         olddir = head->dir;\r\n         if (key==1 && selectedLevel<levels) selectedLevel++;\r\n         if (key==2 && selectedLevel>1) selectedLevel--;\r\n         if (key==4) \r\n         {\r\n           lcd.clear();\r\n           selectedLevel--;\r\n           newPoint();\r\n           gameStarted = true;\r\n         }\r\n         else\r\n         {\r\n           lcd.setCursor(14,0);\r\n           lcd.print(selectedLevel);\r\n         }\r\n       }\r\n     }\r\n   }\r\n  }\r\n  if (!gameOver && gameStarted)\r\n  {\r\n   skip = false; \/\/skip the second moveAll() function call if the first was made\r\n   \r\n   adc_key_in = analogRead(0);    \/\/ read the value from the sensor \r\n   key = get_key(adc_key_in);  \/\/ convert into key press\r\n   if (key != oldkey)   \/\/ if keypress is detected\r\n   {\r\n     delay(50);  \/\/ wait for debounce time\r\n     adc_key_in = analogRead(0);    \/\/ read the value from the sensor \r\n     key = get_key(adc_key_in);    \/\/ convert into key press\r\n     if (key != oldkey)    \r\n     {   \r\n       oldkey = key;\r\n       if (key >=0)\r\n       {\r\n         olddir = head->dir;\r\n         if (key==0 && head->dir!=3) head->dir = 2;\r\n         if (key==1 && head->dir!=1) head->dir = 0;\r\n         if (key==2 && head->dir!=0) head->dir = 1;\r\n         if (key==3 && head->dir!=2) head->dir = 3;\r\n         \r\n         if (olddir != head->dir)\r\n         {\r\n           skip = true;\r\n           delay(1000\/gameSpeed);\r\n           moveAll();\r\n           drawMatrix();\r\n         }\r\n       }\r\n     }\r\n   }\r\n   if (!skip)\r\n   {\r\n     timeNow = millis();\r\n     if (timeNow - time > 1000 \/ gameSpeed)\r\n     {\r\n       moveAll();\r\n       drawMatrix();\r\n       time = millis();\r\n     }\r\n   }\r\n  }\r\n  if(gameOver)\r\n  {\r\n    \r\n   adc_key_in = analogRead(0);    \/\/ read the value from the sensor \r\n   key = get_key(adc_key_in);  \/\/ convert into key press\r\n   if (key != oldkey)   \/\/ if keypress is detected\r\n   {\r\n     delay(50);  \/\/ wait for debounce time\r\n     adc_key_in = analogRead(0);    \/\/ read the value from the sensor \r\n     key = get_key(adc_key_in);    \/\/ convert into key press\r\n     if (key != oldkey)    \r\n     {   \r\n       oldkey = key;\r\n       if (key >=0)\r\n       {\r\n          startF();\r\n       }\r\n     }\r\n   }\r\n   \r\n  }\r\n}\r\nint get_key(unsigned int input)\r\n{\r\n    int k;\r\n    for (k = 0; k < NUM_KEYS; k++)\r\n    {\r\n      if (input < adc_key_val[k])\r\n      {\r\n        return k;\r\n      }\r\n    }   \r\n    if (k >= NUM_KEYS)k = -1;  \/\/ No valid key pressed\r\n    return k;\r\n}\r\n\r\n<\/code><\/pre>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-8697e2b elementor-widget elementor-widget-text-editor\" data-id=\"8697e2b\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-text-editor elementor-clearfix\">\n\t\t\t\t<p>\u062a\u0648\u0633\u0637 \u0628\u0631\u0646\u0627\u0645\u0647 \u0628\u0627\u0644\u0627 \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u06cc\u062f \u0628\u0627\u0632\u06cc Snake \u0631\u0627 \u0628\u0631 \u0631\u0648\u06cc \u0646\u0645\u0627\u06cc\u0634\u06af\u0631 \u0648 \u0628\u0647 \u0648\u0633\u06cc\u0644\u0647 \u062f\u06a9\u0645\u0647 \u0647\u0627\u06cc \u0631\u0648\u06cc \u0645\u0627\u0698\u0648\u0644 \u0627\u062c\u0631\u0627 \u06a9\u0646\u06cc\u062f.<\/p>\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-8d8f6f7 elementor-widget elementor-widget-heading\" data-id=\"8d8f6f7\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<h3 class=\"elementor-heading-title elementor-size-default\">\u06af\u0627\u0645 \u0633\u0648\u0645: \u0645\u0627\u0631 \u0628\u0627\u0632\u06cc<\/h3>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-f44d2c3 elementor-widget elementor-widget-text-editor\" data-id=\"f44d2c3\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-text-editor elementor-clearfix\">\n\t\t\t\t<p>\u062d\u0627\u0644 \u062f\u0631 \u0627\u06cc\u0646 \u0645\u0631\u062d\u0644\u0647 \u0648 \u067e\u0633 \u0627\u0632 \u0622\u067e\u0644\u0648\u062f \u0628\u0631\u0646\u0627\u0645\u0647\u060c \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u06cc\u062f \u0628\u0627\u0632\u06cc \u0631\u0627 \u0634\u0631\u0648\u0639 \u06a9\u0646\u06cc\u062f. <br \/>\u062a\u0648\u0633\u0637 \u062f\u06a9\u0645\u0647 SELECT \u0648 \u0628\u0627 \u0627\u0646\u062a\u062e\u0627\u0628 \u0633\u0637\u062d \u0628\u0627\u0632\u06cc\u060c \u0628\u0627\u0632\u06cc \u0634\u0631\u0648\u0639 \u0645\u06cc\u200c\u0634\u0648\u062f. \u0628\u0627\u0632\u06cc \u062a\u0627 \u062c\u0627\u06cc\u06cc \u0627\u062f\u0627\u0645\u0647 \u067e\u06cc\u062f\u0627 \u0645\u06cc\u200c\u06a9\u0646\u062f \u06a9\u0647 \u0633\u0631 \u0645\u0627\u0631 \u0628\u0627 \u0628\u062f\u0646\u0634 \u0628\u0631\u062e\u0648\u0631\u062f \u0646\u062f\u0627\u0634\u062a\u0647 \u0628\u0627\u0634\u062f.<\/p>\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-60f30f9 elementor-widget elementor-widget-alert\" data-id=\"60f30f9\" data-element_type=\"widget\" data-widget_type=\"alert.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"elementor-alert elementor-alert-info\" role=\"alert\">\n\t\t\t<span class=\"elementor-alert-title\">\u0646\u06a9\u062a\u0647<\/span>\n\t\t\t\t\t\t\t<span class=\"elementor-alert-description\">\u0633\u0637\u062d \u0627\u06cc\u0646 \u0628\u0627\u0632\u06cc \u0631\u0627 \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u06cc\u062f \u0627\u0632 1 \u062a\u0627 5 \u0627\u0646\u062a\u062e\u0627\u0628 \u06a9\u0646\u06cc\u062f.  <\/span>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-0a108d2 elementor-widget elementor-widget-alert\" data-id=\"0a108d2\" data-element_type=\"widget\" data-widget_type=\"alert.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"elementor-alert elementor-alert-info\" role=\"alert\">\n\t\t\t<span class=\"elementor-alert-title\">\u0646\u06a9\u062a\u0647<\/span>\n\t\t\t\t\t\t\t<span class=\"elementor-alert-description\">\u0631\u06a9\u0648\u0631\u062f \u0634\u0645\u0627 \u062f\u0631 \u0627\u0646\u062a\u0647\u0627\u06cc \u0628\u0627\u0632\u06cc \u0628\u0631 \u0631\u0648\u06cc \u0646\u0645\u0627\u06cc\u0634\u06af\u0631 \u062b\u0628\u062a \u0645\u06cc\u200c\u0634\u0648\u062f. <\/span>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-4b8fa39 elementor-widget elementor-widget-text-editor\" data-id=\"4b8fa39\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-text-editor elementor-clearfix\">\n\t\t\t\t<p>\u0641\u06cc\u0644\u0645 \u0632\u06cc\u0631 \u0646\u0634\u0627\u0646 \u062f\u0647\u0646\u062f\u0647 \u0646\u062d\u0648\u0647 \u0648 \u0631\u0648\u0634 \u0627\u0646\u062c\u0627\u0645 \u0628\u0627\u0632\u06cc \u0645\u06cc\u200c\u0628\u0627\u0634\u062f:<\/p>\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-00bd806 elementor-aspect-ratio-169 elementor-widget elementor-widget-video\" data-id=\"00bd806\" data-element_type=\"widget\" data-settings=\"{&quot;video_type&quot;:&quot;hosted&quot;,&quot;controls&quot;:&quot;yes&quot;,&quot;aspect_ratio&quot;:&quot;169&quot;}\" data-widget_type=\"video.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"e-hosted-video elementor-wrapper elementor-fit-aspect-ratio elementor-open-inline\">\n\t\t\t\t\t<video class=\"elementor-video\" src=\"https:\/\/thecaferobot.com\/learn\/wp-content\/uploads\/2023\/05\/Snake-arduino-lcd-1602.mp4\" controls=\"\" controlsList=\"nodownload\"><\/video>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-7e0e6f8 elementor-widget elementor-widget-heading\" data-id=\"7e0e6f8\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">\u06cc\u06a9 \u06af\u0627\u0645 \u062c\u0644\u0648\u062a\u0631<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-5004e4c elementor-widget elementor-widget-text-editor\" data-id=\"5004e4c\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-text-editor elementor-clearfix\">\n\t\t\t\t<p>\u067e\u0633 \u0627\u0632 \u0627\u0646\u062c\u0627\u0645 \u06a9\u0627\u0645\u0644 \u0627\u06cc\u0646 \u0622\u0645\u0648\u0632\u0634\u060c \u0645\u0648\u0636\u0648\u0639\u0627\u062a \u0648 \u0637\u0631\u062d \u0647\u0627\u06cc \u0632\u06cc\u0631 \u0631\u0627 \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u06cc\u062f \u0628\u0647 \u0639\u0646\u0648\u0627\u0646 \u06af\u0627\u0645 \u0628\u0639\u062f\u06cc \u0627\u0646\u062c\u0627\u0645 \u062f\u0647\u06cc\u062f:<br \/>\u2022 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 OLED \u0648 \u062f\u06cc\u06af\u0631 LCD \u0647\u0627\u06cc \u0645\u0648\u062c\u0648\u062f \u0628\u0631 \u0631\u0648\u06cc \u0633\u0627\u06cc\u062a<br \/>\u2022 \u0627\u062c\u0631\u0627\u06cc \u0628\u0627\u0632\u06cc \u0647\u0627\u06cc \u062f\u06cc\u06af\u0631 \u0628\u0631 \u0631\u0648\u06cc \u0645\u0627\u062a\u0631\u06cc\u0633 LED \u0628\u0627 \u062f\u0631\u0627\u06cc\u0648\u0631 Max7219<br \/>\u2022 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 \u0645\u0627\u062a\u0631\u06cc\u0633 8*8 RGB WS2812<\/p>\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\r\n\t\t\t\t\t<\/div>\r\n\t\t\t\t<\/div>\r\n\t\t\t\t\t\t<\/div>\r\n\t\t\t\t\t<\/div>\r\n\t\t\t\t<\/section>\r\n\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>\u0645\u0642\u062f\u0645\u0647 \u0647\u0645\u06af\u06cc \u0628\u0627\u0632\u06cc \u062e\u0627\u0637\u0631\u0647\u200c\u0627\u0646\u06af\u06cc\u0632 Snake (\u0645\u0627\u0631) \u0631\u0627 \u062f\u0631 \u06af\u0648\u0634\u06cc\u200c\u0647\u0627\u06cc \u0642\u062f\u06cc\u0645\u06cc \u0646\u0648\u06a9\u06cc\u0627 \u0628\u0647 \u06cc\u0627\u062f \u062f\u0627\u0631\u06cc\u062f. \u06af\u0627\u0647\u06cc \u0627\u0648\u0642\u0627\u062a \u062f\u0644\u062a\u0627\u0646 \u0628\u0631\u0627\u06cc \u0627\u06cc\u0646 \u0628\u0627\u0632\u06cc \u0647\u0627\u06cc \u062e\u0627\u0637\u0631\u0647\u200c\u0627\u0646\u06af\u06cc\u0632 \u062a\u0646\u06af \u0645\u06cc\u200c\u0634\u0648\u062f \u0627\u0645\u0627 \u062f\u0633\u062a\u0631\u0633\u06cc \u0628\u0647 \u06af\u0648\u0634\u06cc\u200c\u0647\u0627\u06cc \u0646\u0648\u06a9\u06cc\u0627 \u0628\u0631\u0627\u06cc \u0627\u0646\u062c\u0627\u0645 \u0628\u0627\u0632\u06cc \u0645\u0642\u062f\u0648\u0631 \u0646\u0645\u06cc\u200c\u0628\u0627\u0634\u062f. \u062f\u0631 \u0627\u06cc\u0646 \u0635\u0648\u0631\u062a \u0634\u0645\u0627 \u0628\u0647 \u0633\u0627\u062f\u06af\u06cc \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u06cc\u062f \u062a\u0648\u0633\u0637 \u0628\u0631\u062f \u0622\u0631\u062f\u0648\u06cc\u0646\u0648 \u0648 \u06cc\u06a9 \u0646\u0645\u0627\u06cc\u0634\u06af\u0631 \u062f\u0644\u062e\u0648\u0627\u0647\u060c \u0627\u06cc\u0646 \u0628\u0627\u0632\u06cc \u0631\u0627 \u0628\u0631\u0627\u06cc \u062e\u0648\u062f\u062a\u0627\u0646 \u0633\u0627\u062e\u062a\u0647 \u0648 [&hellip;]<\/p>\n","protected":false},"author":19,"featured_media":27974,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[949,935],"tags":[4832,4649,4829,4828,4848],"platform":[1071],"bytype":[1074],"difficulty":[1078],"related_products":[2479,3691,2480],"featured_image_src":{"landsacpe":["https:\/\/thecaferobot.com\/learn\/wp-content\/uploads\/2023\/05\/snake-poster.jpg",1200,900,false],"list":["https:\/\/thecaferobot.com\/learn\/wp-content\/uploads\/2023\/05\/snake-poster.jpg",1200,900,false],"medium":["https:\/\/thecaferobot.com\/learn\/wp-content\/uploads\/2023\/05\/snake-poster-533x400.jpg",533,400,true],"full":["https:\/\/thecaferobot.com\/learn\/wp-content\/uploads\/2023\/05\/snake-poster.jpg",1200,900,false]},"_links":{"self":[{"href":"https:\/\/thecaferobot.com\/learn\/wp-json\/wp\/v2\/posts\/27973"}],"collection":[{"href":"https:\/\/thecaferobot.com\/learn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thecaferobot.com\/learn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thecaferobot.com\/learn\/wp-json\/wp\/v2\/users\/19"}],"replies":[{"embeddable":true,"href":"https:\/\/thecaferobot.com\/learn\/wp-json\/wp\/v2\/comments?post=27973"}],"version-history":[{"count":31,"href":"https:\/\/thecaferobot.com\/learn\/wp-json\/wp\/v2\/posts\/27973\/revisions"}],"predecessor-version":[{"id":32075,"href":"https:\/\/thecaferobot.com\/learn\/wp-json\/wp\/v2\/posts\/27973\/revisions\/32075"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/thecaferobot.com\/learn\/wp-json\/wp\/v2\/media\/27974"}],"wp:attachment":[{"href":"https:\/\/thecaferobot.com\/learn\/wp-json\/wp\/v2\/media?parent=27973"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thecaferobot.com\/learn\/wp-json\/wp\/v2\/categories?post=27973"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thecaferobot.com\/learn\/wp-json\/wp\/v2\/tags?post=27973"},{"taxonomy":"platform","embeddable":true,"href":"https:\/\/thecaferobot.com\/learn\/wp-json\/wp\/v2\/platform?post=27973"},{"taxonomy":"bytype","embeddable":true,"href":"https:\/\/thecaferobot.com\/learn\/wp-json\/wp\/v2\/bytype?post=27973"},{"taxonomy":"difficulty","embeddable":true,"href":"https:\/\/thecaferobot.com\/learn\/wp-json\/wp\/v2\/difficulty?post=27973"},{"taxonomy":"related_products","embeddable":true,"href":"https:\/\/thecaferobot.com\/learn\/wp-json\/wp\/v2\/related_products?post=27973"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}