{"id":160,"date":"2026-09-18T14:08:34","date_gmt":"2026-09-18T14:08:34","guid":{"rendered":"https:\/\/theroyalscode.com\/students\/a_mehraban\/?p=160"},"modified":"2026-09-18T14:08:34","modified_gmt":"2026-09-18T14:08:34","slug":"free-friday-assigment","status":"publish","type":"post","link":"https:\/\/theroyalscode.com\/students\/a_mehraban\/2026\/09\/18\/free-friday-assigment\/","title":{"rendered":"Free friday assigment"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Hello so i work on cyberpatriot<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">i got 23 points <\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"901\" height=\"737\" src=\"https:\/\/theroyalscode.com\/students\/a_mehraban\/wp-content\/uploads\/2026\/09\/image.png\" alt=\"\" class=\"wp-image-161\" srcset=\"https:\/\/theroyalscode.com\/students\/a_mehraban\/wp-content\/uploads\/2026\/09\/image.png 901w, https:\/\/theroyalscode.com\/students\/a_mehraban\/wp-content\/uploads\/2026\/09\/image-300x245.png 300w, https:\/\/theroyalscode.com\/students\/a_mehraban\/wp-content\/uploads\/2026\/09\/image-768x628.png 768w\" sizes=\"auto, (max-width: 901px) 100vw, 901px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">what i did was there was some questions to answer you can see it down here .<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1010\" height=\"698\" src=\"https:\/\/theroyalscode.com\/students\/a_mehraban\/wp-content\/uploads\/2026\/09\/image-1.png\" alt=\"\" class=\"wp-image-162\" srcset=\"https:\/\/theroyalscode.com\/students\/a_mehraban\/wp-content\/uploads\/2026\/09\/image-1.png 1010w, https:\/\/theroyalscode.com\/students\/a_mehraban\/wp-content\/uploads\/2026\/09\/image-1-300x207.png 300w, https:\/\/theroyalscode.com\/students\/a_mehraban\/wp-content\/uploads\/2026\/09\/image-1-767x530.png 767w\" sizes=\"auto, (max-width: 1010px) 100vw, 1010px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">another one <\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"824\" height=\"657\" src=\"https:\/\/theroyalscode.com\/students\/a_mehraban\/wp-content\/uploads\/2026\/09\/image-2.png\" alt=\"\" class=\"wp-image-163\" srcset=\"https:\/\/theroyalscode.com\/students\/a_mehraban\/wp-content\/uploads\/2026\/09\/image-2.png 824w, https:\/\/theroyalscode.com\/students\/a_mehraban\/wp-content\/uploads\/2026\/09\/image-2-300x239.png 300w, https:\/\/theroyalscode.com\/students\/a_mehraban\/wp-content\/uploads\/2026\/09\/image-2-768x612.png 768w\" sizes=\"auto, (max-width: 824px) 100vw, 824px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">and i also try to make a game but i didn&#8217;t had time but i did some <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"540\" src=\"https:\/\/theroyalscode.com\/students\/a_mehraban\/wp-content\/uploads\/2026\/09\/image-3-1024x540.png\" alt=\"\" class=\"wp-image-164\" srcset=\"https:\/\/theroyalscode.com\/students\/a_mehraban\/wp-content\/uploads\/2026\/09\/image-3-1024x540.png 1024w, https:\/\/theroyalscode.com\/students\/a_mehraban\/wp-content\/uploads\/2026\/09\/image-3-300x158.png 300w, https:\/\/theroyalscode.com\/students\/a_mehraban\/wp-content\/uploads\/2026\/09\/image-3-766x404.png 766w, https:\/\/theroyalscode.com\/students\/a_mehraban\/wp-content\/uploads\/2026\/09\/image-3-1536x810.png 1536w, https:\/\/theroyalscode.com\/students\/a_mehraban\/wp-content\/uploads\/2026\/09\/image-3.png 1876w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">from this video <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"647\" src=\"https:\/\/theroyalscode.com\/students\/a_mehraban\/wp-content\/uploads\/2026\/09\/image-4-1024x647.png\" alt=\"\" class=\"wp-image-165\" srcset=\"https:\/\/theroyalscode.com\/students\/a_mehraban\/wp-content\/uploads\/2026\/09\/image-4-1024x647.png 1024w, https:\/\/theroyalscode.com\/students\/a_mehraban\/wp-content\/uploads\/2026\/09\/image-4-300x189.png 300w, https:\/\/theroyalscode.com\/students\/a_mehraban\/wp-content\/uploads\/2026\/09\/image-4-768x485.png 768w, https:\/\/theroyalscode.com\/students\/a_mehraban\/wp-content\/uploads\/2026\/09\/image-4.png 1357w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">i will do the rest tommrow <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import pygame\n\n# initializing the pygame engine\npygame.init()\n\n# constants\nWIDTH, HEIGHT = 800, 400\nGROUND_HEIGHT = 100\nFPS = 60\n\n# colors\nWHITE = (255, 255, 255)\n\n# CREATE THE GAME WINDOW\nscreen = pygame.display.set_mode((WIDTH, HEIGHT))\npygame.display.set_caption(\"subway surfers\")\n\n# Load the game assets (character and obstacles)\nplayer_img = pygame.image.load('player.png')\nobstacle_img = pygame.image.load('obstacle.png')\n\n# Player variables\nplayer_x = WIDTH \/\/ 2\nplayer_y = HEIGHT - GROUND_HEIGHT - player_img.get_height()\nplayer_speed = 5\nplayer_jump = False\njump_height = 20\n\n# obstacles variables\nobstacle_x = WIDTH\nobstacle_y = HEIGHT - GROUND_HEIGHT - obstacle_img.get_height()\nobstacle_speed = 3\n\n# score\nscore = 0\n\n# game loop\nrunning = True\nclock = pygame.time.Clock()\n\nwhile running:\n    for event in pygame.event.get():\n        if event.type == pygame.QUIT:\n            running = False\n\n        # handle player input\n        keys = pygame.key.get_pressed()\n        if keys&#91;pygame.K_LEFT]:\n            player_x -= player_speed\n        if keys&#91;pygame.K_RIGHT]:\n            player_x += player_speed\n        if keys&#91;pygame.K_SPACE] and not player_jump:\n            player_jump = True\n\n        # player jumping and falling\n        if player_jump:\n            player_y -= jump_height\n            jump_height -= 1\n            if jump_height &lt; -15:\n                player_jump = False\n                jump_height = 15\n        else:\n            if player_y &lt; HEIGHT - GROUND_HEIGHT - player_img.get_height():\n                player_y += jump_height\n                jump_height += 1\n            else:\n                player_y = HEIGHT - GROUND_HEIGHT - player_img.get_height()\n                jump_height = 15\n\n# move the obstacle\nobstacle_x -= obstacle_speed\n\n# check for collision\nplayer_rect = pygame.Rect(player_x, player_y, player_img.get_width(), player_img.get_height())\nobstacle_rect = pygame.Rect(obstacle_x, obstacle_y, obstacle_img.get_width(), obstacle_img.get_height())\n\nif player_rect.colliderect(obstacle_rect):\n    running = False\n\n# update the score\nscore += 1\n\n# draw everthing\nscreen.fill(WHITE)\nscreen.blit(player_img, (player_x, player_y))\nscreen.blit(obstacle_img , (obstacle_x, obstacle_y))\n\n# display score\nfont = pygame.font.Font(None, 36)\nscore_text = font.render(f\"Score: {score}\", True, (0,0,0))\nscreen.blit(score_text, (10,10))\npygame.display.flip()\n\n# check if obstacle is off the screen\n\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Hello so i work on cyberpatriot i got 23 points what i did was there was some questions to answer [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[1],"tags":[],"class_list":["post-160","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/theroyalscode.com\/students\/a_mehraban\/wp-json\/wp\/v2\/posts\/160","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/theroyalscode.com\/students\/a_mehraban\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/theroyalscode.com\/students\/a_mehraban\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/a_mehraban\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/a_mehraban\/wp-json\/wp\/v2\/comments?post=160"}],"version-history":[{"count":1,"href":"https:\/\/theroyalscode.com\/students\/a_mehraban\/wp-json\/wp\/v2\/posts\/160\/revisions"}],"predecessor-version":[{"id":166,"href":"https:\/\/theroyalscode.com\/students\/a_mehraban\/wp-json\/wp\/v2\/posts\/160\/revisions\/166"}],"wp:attachment":[{"href":"https:\/\/theroyalscode.com\/students\/a_mehraban\/wp-json\/wp\/v2\/media?parent=160"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/a_mehraban\/wp-json\/wp\/v2\/categories?post=160"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/a_mehraban\/wp-json\/wp\/v2\/tags?post=160"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}