{"id":58915,"date":"2021-08-23T09:00:27","date_gmt":"2021-08-23T09:00:27","guid":{"rendered":"https:\/\/www.cryptocabaret.com\/?p=58915"},"modified":"2021-08-23T09:00:27","modified_gmt":"2021-08-23T09:00:27","slug":"write-a-chess-game-using-bit-fields-and-masks","status":"publish","type":"post","link":"https:\/\/www.cryptocabaret.com\/?p=58915","title":{"rendered":"Write a chess game using bit-fields and masks"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" typeof=\"foaf:Image\" src=\"https:\/\/www.cryptocabaret.com\/wp-content\/uploads\/2021\/08\/life-chess-games.png\" width=\"520\" height=\"292\" alt=\"Chess pieces on a chess board\" title=\"Chess pieces on a chess board\"><\/p>\n<p>Let&#8217;s say you were writing a chess game in C. One way to track the pieces on the board is by defining a structure that defines each possible piece on the board, and its color, so every square contains an element from that structure. For example, you might have a structure that looks like this:<\/p>\n<p><a href=\"https:\/\/opensource.com\/article\/21\/8\/binary-bit-fields-masks\">read more<\/a><\/p>\n<p class=\"wpematico_credit\"><small>Powered by <a href=\"http:\/\/www.wpematico.com\" target=\"_blank\" rel=\"noopener\">WPeMatico<\/a><\/small><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Let&#8217;s say you were writing a chess game in C. One way to track the pieces on the board is by defining a structure that defines each possible piece on the board, and its color, so every square contains an element from that structure. For example, you might have a structure that looks like this: [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":58916,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[307],"tags":[],"class_list":["post-58915","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-open-source"],"_links":{"self":[{"href":"https:\/\/www.cryptocabaret.com\/index.php?rest_route=\/wp\/v2\/posts\/58915","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.cryptocabaret.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.cryptocabaret.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.cryptocabaret.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.cryptocabaret.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=58915"}],"version-history":[{"count":0,"href":"https:\/\/www.cryptocabaret.com\/index.php?rest_route=\/wp\/v2\/posts\/58915\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.cryptocabaret.com\/index.php?rest_route=\/wp\/v2\/media\/58916"}],"wp:attachment":[{"href":"https:\/\/www.cryptocabaret.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=58915"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.cryptocabaret.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=58915"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.cryptocabaret.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=58915"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}