{"id":109,"date":"2026-01-16T15:29:57","date_gmt":"2026-01-16T15:29:57","guid":{"rendered":"https:\/\/theroyalscode.com\/students\/l_rankins\/?p=109"},"modified":"2026-01-16T15:29:57","modified_gmt":"2026-01-16T15:29:57","slug":"blog-make-up-1","status":"publish","type":"post","link":"https:\/\/theroyalscode.com\/students\/l_rankins\/2026\/01\/16\/blog-make-up-1\/","title":{"rendered":"BLOG MAKE UP 1:"},"content":{"rendered":"\n<p>I made a RPG<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\ndef showInstructions():\n  print('''\nRPG Game\n========\nCommands:\n  go &#91;direction]\n  get &#91;item]\n''')\n\ndef showStatus():\n\n  print('---------------------------')\n  print('You are in the ' + currentRoom)\n\n  print('Inventory : ' + str(inventory))\n\n  if \"item\" in rooms&#91;currentRoom]:\n    print('You see a ' + rooms&#91;currentRoom]&#91;'item'])\n  print(\"---------------------------\")\n\n\ninventory = &#91;]<\/code><\/pre>\n\n\n\n<p><strong>This is the code that prints the commands you can use and shows your status<\/strong> <strong>and inventory<\/strong>.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>rooms = {\n\n            'Hall' : {\n                  'south' : 'Kitchen',\n                  'east'  : 'Dining Room',\n                  'item'  : 'key'\n                },\n\n            'Kitchen' : {\n                  'north' : 'Hall',\n                  'item'  : 'monster',\n                },\n            'Dining Room' : {\n                  'west' : 'Hall',\n                  'south': 'Garden',\n                  'item' : 'potion',\n                  'north' : 'Pantry',\n               },\n            'Garden' : {\n                  'north' : 'Dining Room'\n               },\n            'Pantry' : {\n                  'south' : 'Dining Room',\n                  'item' : 'cookie',\n            }\n         }<\/code><\/pre>\n\n\n\n<p><strong>These are the rooms you can go to<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>currentRoom = 'Hall'\n\nshowInstructions()\n\n\nwhile True:\n\n  showStatus()\n\n\n  move = ''\n  while move == '':\n    move = input('>')\n\n      \n  move = move.lower().split(\" \", 1)\n\n\n  if move&#91;0] == 'go':\n\n    if move&#91;1] in rooms&#91;currentRoom]:\n\n      currentRoom = rooms&#91;currentRoom]&#91;move&#91;1]]\n\n    else:\n        print('You can\\'t go that way!')\n\n\n  if move&#91;0] == 'get' :\n\n    if \"item\" in rooms&#91;currentRoom] and move&#91;1] in rooms&#91;currentRoom]&#91;'item']:\n\n      inventory.append(move&#91;1])\n\n      print(move&#91;1] + ' got!')\n\n      del rooms&#91;currentRoom]&#91;'item']\n\n    else:\n\n      print('Can\\'t get ' + move&#91;1] + '!')\n      \n\n  if currentRoom == 'Garden' and 'key' in inventory and 'potion' in inventory:\n    print('You escaped the house with the ultra rare key and magic potion... YOU WIN!')\n    break\n\n\n  elif 'item' in rooms&#91;currentRoom] and 'monster' in rooms&#91;currentRoom]&#91;'item']:\n    print('A monster has got you... GAME OVER!')\n    break\n```\n<\/code><\/pre>\n\n\n\n<p><strong>This is the code that lets you select rooms and also has code for if you lose or win.<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I made a RPG This is the code that prints the commands you can use and shows your status and [&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":"","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-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":"","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-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":"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":""},"mobile":{"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":""}},"footnotes":""},"categories":[1],"tags":[],"class_list":["post-109","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/theroyalscode.com\/students\/l_rankins\/wp-json\/wp\/v2\/posts\/109","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/theroyalscode.com\/students\/l_rankins\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/theroyalscode.com\/students\/l_rankins\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/l_rankins\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/l_rankins\/wp-json\/wp\/v2\/comments?post=109"}],"version-history":[{"count":1,"href":"https:\/\/theroyalscode.com\/students\/l_rankins\/wp-json\/wp\/v2\/posts\/109\/revisions"}],"predecessor-version":[{"id":113,"href":"https:\/\/theroyalscode.com\/students\/l_rankins\/wp-json\/wp\/v2\/posts\/109\/revisions\/113"}],"wp:attachment":[{"href":"https:\/\/theroyalscode.com\/students\/l_rankins\/wp-json\/wp\/v2\/media?parent=109"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/l_rankins\/wp-json\/wp\/v2\/categories?post=109"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/l_rankins\/wp-json\/wp\/v2\/tags?post=109"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}