{"id":427,"date":"2026-03-13T15:32:47","date_gmt":"2026-03-13T15:32:47","guid":{"rendered":"https:\/\/theroyalscode.com\/students\/k_rai\/?p=427"},"modified":"2026-03-13T15:32:47","modified_gmt":"2026-03-13T15:32:47","slug":"stopwatch-chessboard","status":"publish","type":"post","link":"https:\/\/theroyalscode.com\/students\/k_rai\/2026\/03\/13\/stopwatch-chessboard\/","title":{"rendered":"Stopwatch + ChessBoard"},"content":{"rendered":"\n<p>Where I left off last time the stop watch wouldn&#8217;t work that much and just Kept Increasing the number and not working as a timer <\/p>\n\n\n\n<figure class=\"wp-block-video\"><video height=\"170\" style=\"aspect-ratio: 182 \/ 170;\" width=\"182\" controls src=\"https:\/\/theroyalscode.com\/students\/k_rai\/wp-content\/uploads\/2026\/03\/Recording-2026-03-13-104532.mp4\"><\/video><\/figure>\n\n\n\n<p>I&#8217;ve decided to work on a chess project where I can use Ai to help me solve problems if I encounter them<\/p>\n\n\n\n<p>I first started with making my project in VS Code and called it Chessboard. Java <\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"541\" height=\"310\" src=\"https:\/\/theroyalscode.com\/students\/k_rai\/wp-content\/uploads\/2026\/03\/chess-1.png\" alt=\"\" class=\"wp-image-429\" srcset=\"https:\/\/theroyalscode.com\/students\/k_rai\/wp-content\/uploads\/2026\/03\/chess-1.png 541w, https:\/\/theroyalscode.com\/students\/k_rai\/wp-content\/uploads\/2026\/03\/chess-1-300x172.png 300w\" sizes=\"auto, (max-width: 541px) 100vw, 541px\" \/><\/figure>\n\n\n\n<p>The first line defines the Chessboard class <\/p>\n\n\n\n<p>The new piece [8][8] Represents the total 16 pieces the player starts with each row having eight on each<\/p>\n\n\n\n<p>The setup pieces calls for the pieces to sit in their position<\/p>\n\n\n\n<p>since each piece Represents a spot on the chess board so we can Represents this with an object by making a new file <\/p>\n\n\n\n<p>called Piece. Java to put the pieces<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"834\" height=\"477\" src=\"https:\/\/theroyalscode.com\/students\/k_rai\/wp-content\/uploads\/2026\/03\/chess-2.png\" alt=\"\" class=\"wp-image-430\" srcset=\"https:\/\/theroyalscode.com\/students\/k_rai\/wp-content\/uploads\/2026\/03\/chess-2.png 834w, https:\/\/theroyalscode.com\/students\/k_rai\/wp-content\/uploads\/2026\/03\/chess-2-300x172.png 300w, https:\/\/theroyalscode.com\/students\/k_rai\/wp-content\/uploads\/2026\/03\/chess-2-768x439.png 768w\" sizes=\"auto, (max-width: 834px) 100vw, 834px\" \/><\/figure>\n\n\n\n<p>The piece.java is responsible for the spot on the chess so thats why this file is location related <\/p>\n\n\n\n<p>this file is responsible for the pieces moving and how they look aka their color<\/p>\n\n\n\n<p>The codes in line 2 and 3 defines the posittion and color <\/p>\n\n\n\n<p>the returns color and postions puts them on the screen where you can see them<\/p>\n\n\n\n<p>the setPosition gets access and updates the piece&#8217;s location<\/p>\n\n\n\n<p>the isValidMove is there to make sure the rules of chess is being met and the player is not going all over the place<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Where I left off last time the stop watch wouldn&#8217;t work that much and just Kept Increasing the number and not working as a timer I&#8217;ve decided to work on a chess project where I can use Ai to help me solve problems if I encounter them I first started with making my project in [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":415,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-427","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-free-friday"],"_links":{"self":[{"href":"https:\/\/theroyalscode.com\/students\/k_rai\/wp-json\/wp\/v2\/posts\/427","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/theroyalscode.com\/students\/k_rai\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/theroyalscode.com\/students\/k_rai\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/k_rai\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/k_rai\/wp-json\/wp\/v2\/comments?post=427"}],"version-history":[{"count":1,"href":"https:\/\/theroyalscode.com\/students\/k_rai\/wp-json\/wp\/v2\/posts\/427\/revisions"}],"predecessor-version":[{"id":431,"href":"https:\/\/theroyalscode.com\/students\/k_rai\/wp-json\/wp\/v2\/posts\/427\/revisions\/431"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/k_rai\/wp-json\/wp\/v2\/media\/415"}],"wp:attachment":[{"href":"https:\/\/theroyalscode.com\/students\/k_rai\/wp-json\/wp\/v2\/media?parent=427"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/k_rai\/wp-json\/wp\/v2\/categories?post=427"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/k_rai\/wp-json\/wp\/v2\/tags?post=427"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}