{"id":5499,"date":"2022-09-01T00:01:53","date_gmt":"2022-09-01T07:01:53","guid":{"rendered":"https:\/\/c-for-dummies.com\/blog\/?p=5499"},"modified":"2022-09-10T07:53:43","modified_gmt":"2022-09-10T14:53:43","slug":"cyclops-numbers","status":"publish","type":"post","link":"https:\/\/c-for-dummies.com\/blog\/?p=5499","title":{"rendered":"Cyclops Numbers"},"content":{"rendered":"<h2>Difficulty: &#9733; &#9733; &#9733; &#9734;<\/h2>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/c-for-dummies.com\/blog\/wp-content\/uploads\/2022\/08\/09-exercise1-cyclops.png\" alt=\"\" width=\"150\" height=\"174\" class=\"alignleft size-full wp-image-5500\" \/>Oh, leave it to the propeller heads to devise a clever and fun name for something the rest of us never pay attention to. This time it&#8217;s a <em>cyclops number<\/em>, which is any decimal integer value with an odd number of digits and a big fat zero in the middle &mdash; like a cyclops&#8217; eye.<br \/>\n<!--more--><br \/>\nThe digits in a cyclops number need not reflect each other; it isn&#8217;t a palindrome number (which apparently is another thing in math). No, it&#8217;s just an integer value with an odd number of digits so that it has a center digit. That center digit &mdash; and only that digit &mdash; must be zero.<\/p>\n<p>Your task for this month&#8217;s Exercise is to write code that outputs the first 100 cyclops numbers. Start at zero, even though you need at least a three-digit value to have the first cyclops number. When the code matches the cyclops number pattern, output its value.<\/p>\n<p>Figure 1 shows the output from my solution, where I crafted a fancy table to output the results on a single screen. (I cover the table&#8217;s logic in <a href=\"https:\/\/c-for-dummies.com\/blog\/?p=5511\">an upcoming Lesson<\/a>.) You don&#8217;t need to output the values in such a table, just a long list is enough.<\/p>\n<div id=\"attachment_5502\" style=\"width: 594px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/c-for-dummies.com\/blog\/wp-content\/uploads\/2022\/09\/Screen-Shot-2022-08-20-at-10.09.32.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-5502\" src=\"https:\/\/c-for-dummies.com\/blog\/wp-content\/uploads\/2022\/09\/Screen-Shot-2022-08-20-at-10.09.32-1024x420.png\" alt=\"Table output\" width=\"584\" height=\"240\" class=\"size-large wp-image-5502\" srcset=\"https:\/\/c-for-dummies.com\/blog\/wp-content\/uploads\/2022\/09\/Screen-Shot-2022-08-20-at-10.09.32-1024x420.png 1024w, https:\/\/c-for-dummies.com\/blog\/wp-content\/uploads\/2022\/09\/Screen-Shot-2022-08-20-at-10.09.32-300x123.png 300w, https:\/\/c-for-dummies.com\/blog\/wp-content\/uploads\/2022\/09\/Screen-Shot-2022-08-20-at-10.09.32-768x315.png 768w, https:\/\/c-for-dummies.com\/blog\/wp-content\/uploads\/2022\/09\/Screen-Shot-2022-08-20-at-10.09.32-500x205.png 500w, https:\/\/c-for-dummies.com\/blog\/wp-content\/uploads\/2022\/09\/Screen-Shot-2022-08-20-at-10.09.32.png 1140w\" sizes=\"auto, (max-width: 584px) 100vw, 584px\" \/><\/a><p id=\"caption-attachment-5502\" class=\"wp-caption-text\">Figure 1. Fancy table output showing the first 100 cyclops numbers.<\/p><\/div>\n<p>Please try this Exercise on  your own before you peek at <a href=\"https:\/\/c-for-dummies.com\/blog\/?p=5509\">my solution<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>These scary numbers have a big zero in the middle! <a href=\"https:\/\/c-for-dummies.com\/blog\/?p=5499\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-5499","post","type-post","status-publish","format-standard","hentry","category-exercise"],"_links":{"self":[{"href":"https:\/\/c-for-dummies.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/5499","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/c-for-dummies.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/c-for-dummies.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/c-for-dummies.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/c-for-dummies.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5499"}],"version-history":[{"count":6,"href":"https:\/\/c-for-dummies.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/5499\/revisions"}],"predecessor-version":[{"id":5530,"href":"https:\/\/c-for-dummies.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/5499\/revisions\/5530"}],"wp:attachment":[{"href":"https:\/\/c-for-dummies.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5499"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/c-for-dummies.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5499"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/c-for-dummies.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5499"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}