{"id":12983,"date":"2021-01-08T17:24:59","date_gmt":"2021-01-08T16:24:59","guid":{"rendered":"https:\/\/www.codemotion.com\/magazine\/?p=12983"},"modified":"2022-01-05T20:03:24","modified_gmt":"2022-01-05T19:03:24","slug":"faas-wars-serverless-robot","status":"publish","type":"post","link":"https:\/\/www.codemotion.com\/magazine\/backend\/faas-wars-serverless-robot\/","title":{"rendered":"Are You Ready for the FaaS Wars?"},"content":{"rendered":"\t\t\t\t<div class=\"wp-block-uagb-table-of-contents uagb-toc__align-left uagb-toc__columns-1  uagb-block-c6778ee9      \"\n\t\t\t\t\tdata-scroll= \"1\"\n\t\t\t\t\tdata-offset= \"30\"\n\t\t\t\t\tstyle=\"\"\n\t\t\t\t>\n\t\t\t\t<div class=\"uagb-toc__wrap\">\n\t\t\t\t\t\t<div class=\"uagb-toc__title\">\n\t\t\t\t\t\t\tTable Of Contents\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"uagb-toc__list-wrap \">\n\t\t\t\t\t\t<ol class=\"uagb-toc__list\"><li class=\"uagb-toc__list\"><a href=\"#robots-and-serverless-apis\" class=\"uagb-toc-link__trigger\">Robots and Serverless APIs<\/a><li class=\"uagb-toc__list\"><a href=\"#meet-your-serverless-robot\" class=\"uagb-toc-link__trigger\">Meet your Serverless Robot<\/a><li class=\"uagb-toc__list\"><a href=\"#taking-command-of-your-faasfighter\" class=\"uagb-toc-link__trigger\">Taking Command of Your FaaSfighter<\/a><li class=\"uagb-toc__list\"><a href=\"#getting-your-serverless-robot-moving\" class=\"uagb-toc-link__trigger\">Getting your Serverless Robot moving<\/a><li class=\"uagb-toc__list\"><a href=\"#events-and-reactions\" class=\"uagb-toc-link__trigger\">Events and Reactions<\/a><li class=\"uagb-toc__list\"><a href=\"#improve-your-fighter\" class=\"uagb-toc-link__trigger\">Improve your Fighter<\/a><li class=\"uagb-toc__list\"><a href=\"#make-your-serverless-robot-stateful\" class=\"uagb-toc-link__trigger\">Make your Serverless Robot Stateful<\/a><li class=\"uagb-toc__list\"><a href=\"#making-use-of-saved-history\" class=\"uagb-toc-link__trigger\">Making use of saved History<\/a><li class=\"uagb-toc__list\"><a href=\"#a-few-final-refinements-for-our-serverless-robot\" class=\"uagb-toc-link__trigger\">A few final refinements for our Serverless Robot<\/a><li class=\"uagb-toc__list\"><a href=\"#in-conclusion\" class=\"uagb-toc-link__trigger\">In Conclusion&#8230;<\/a><\/ol>\t\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\r\n\r\n\r\n<p>Organised by Nimbella and promoted by several members of the Apache OpenWhisk community, <a class=\"ek-link\" href=\"https:\/\/faaswars.nimbella.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">FaaS Wars<\/a> is a programming competition that allows participants to learn how to use &#8216;serverless&#8217; in a fun way. Competitors strive against each other for cash prizes for creating the best <a class=\"ek-link\" href=\"https:\/\/www.codemotion.com\/magazine\/dev-hub\/cloud-manager\/going-serverless-the-easy-way\/\">serverless<\/a> virtual robot.<\/p>\r\n\r\n\r\n\r\n<p>The basic concept of the competition is simple: participants write <span id=\"urn:enhancement-aff8e8f5\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/code_cryptography\">code<\/span> to manoeuvre a <strong>FaaSfighter<\/strong> robot across a field of combat, firing lasers at another competitor\u2019s robot. To win, a robot must hit the enemy robot five times in a minute-long \u2018battle\u2019, and also avoid being hit by its opponent\u2019s lasers.<\/p>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\" id=\"h-robots-and-serverless-apis\">Robots and Serverless APIs<\/h2>\r\n\r\n\r\n\r\n<p>Before you can begin your campaign, you need to first use <a class=\"ek-link\" href=\"https:\/\/www.codemotion.com\/magazine\/dev-hub\/cloud-manager\/cloud-nimbella-aws\/\">Nimbella<\/a> to build a <strong>serverless <span id=\"urn:enhancement-f3109a8c\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/application_programming_interface\">API<\/span><\/strong> with which to control your robot\u2019s movements. An event describing the state of the game is received by the API, which responds by giving the FaaSfighter robot orders. The tutorial below explains how to build your fighter and offers battle strategies that gradually increase in \u2018smartness\u2019.<\/p>\r\n\r\n\r\n\r\n<p><a class=\"ek-link\" href=\"https:\/\/www.codemotion.com\/magazine\/tag\/javascript\/\">JavaScript<\/a> is used to implement the API in the examples that follow. However, any other language that is compatible with Nimbella can be used, such as <a class=\"ek-link\" href=\"https:\/\/www.codemotion.com\/magazine\/dev-hub\/big-data-analyst\/logging-in-python-a-broad-gentle-introduction\/\">Python<\/a> and <a class=\"ek-link\" href=\"https:\/\/www.codemotion.com\/magazine\/Glossary\/golang\/\">Go<\/a>.<\/p>\r\n\r\n\r\n\r\n<p>A \u2018Nimbella action\u2019 is the name given to an <a class=\"ek-link\" href=\"https:\/\/www.codemotion.com\/magazine\/dev-hub\/backend-dev\/api-economy-code-api-money\/\">API<\/a> that is implemented on a serverless basis. A <span id=\"urn:enhancement-18f311df\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/json\">JSON<\/span> object that encodes the state of the game (&#8220;the event&#8221;) is sent as input to the action. The output returned &#8211; the \u2018orders\u2019 &#8211; is in JSON as well. The below examples can easily be translated into your chosen language.<\/p>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\" id=\"h-meet-your-serverless-robot\">Meet your Serverless Robot<\/h2>\r\n\r\n\r\n\r\n<p>The <span id=\"urn:enhancement-4a909aae\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/primitive_data_type\">built-in<\/span> editor in <a href=\"https:\/\/faaswars.nimbella.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">FaaS Wars<\/a> is used to write the <span id=\"urn:enhancement-4c81ca70\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/code_cryptography\">code<\/span> that will control your robot. Your <span id=\"urn:enhancement-db0e9f96\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/code_cryptography\">code<\/span> operates as a function with this format:<\/p>\r\n\r\n\r\n\r\n<div class=\"wp-block-image\">\r\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"805\" height=\"88\" class=\"wp-image-12984\" src=\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2021\/01\/Screenshot-2021-01-03-at-17.46.31.png\" alt=\"serverless robot\" srcset=\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2021\/01\/Screenshot-2021-01-03-at-17.46.31.png 805w, https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2021\/01\/Screenshot-2021-01-03-at-17.46.31-300x33.png 300w, https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2021\/01\/Screenshot-2021-01-03-at-17.46.31-768x84.png 768w\" sizes=\"auto, (max-width: 805px) 100vw, 805px\" \/><\/figure>\r\n<\/div>\r\n\r\n\r\n\r\n<p>The return needs to be a JSON dictionary with the property <code>body<\/code> that contains an array of orders destined for your fighter (more details follow). At this stage, the robot is not yet mobile but sits still, vulnerable to the lurking opposition.<\/p>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\" id=\"h-taking-command-of-your-faasfighter\">Taking Command of Your FaaSfighter<\/h2>\r\n\r\n\r\n\r\n<p>The following <span id=\"urn:enhancement-352a50bb\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/subroutine\">function<\/span> sends the robot a single order at each point in the game, producing an array that incorporates the instruction\u00a0 to &#8220;yell&#8221; the relevant instruction or information while in battle. This particular example communicates the time at which the order is given.<\/p>\r\n\r\n\r\n\r\n<div class=\"wp-block-image\">\r\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"798\" height=\"104\" class=\"wp-image-12999\" src=\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2021\/01\/Screenshot-2021-01-03-at-18.13.04.png\" alt=\"serverless robot\" srcset=\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2021\/01\/Screenshot-2021-01-03-at-18.13.04.png 798w, https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2021\/01\/Screenshot-2021-01-03-at-18.13.04-300x39.png 300w, https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2021\/01\/Screenshot-2021-01-03-at-18.13.04-768x100.png 768w\" sizes=\"auto, (max-width: 798px) 100vw, 798px\" \/><\/figure>\r\n<\/div>\r\n\r\n\r\n\r\n<p>Adopting this action as your first battle strategy will result in your robot being a great timekeeper until a robot with more useful skills destroys it, or the battle time runs out. It\u2019s always great to know what time it is, but it\u2019s not the most effective of battle strategies.\u00a0 Nonetheless, your robot is now active, even if all it can do is tell the time!<\/p>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\" id=\"h-getting-your-serverless-robot-moving\">Getting your Serverless Robot moving<\/h2>\r\n\r\n\r\n\r\n<p>The next step is to get your robot moving on the battlefield. As discussed above, an array of commands is returned by the action, so a single function execution allows you to give several orders. \u200b This action tells the robot to move forward before turning to the left:<\/p>\r\n\r\n\r\n\r\n<div class=\"wp-block-image\">\r\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"813\" height=\"153\" class=\"wp-image-12986\" src=\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2021\/01\/Screenshot-2021-01-03-at-17.54.20.png\" alt=\"serverless robot\" srcset=\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2021\/01\/Screenshot-2021-01-03-at-17.54.20.png 813w, https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2021\/01\/Screenshot-2021-01-03-at-17.54.20-300x56.png 300w, https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2021\/01\/Screenshot-2021-01-03-at-17.54.20-768x145.png 768w\" sizes=\"auto, (max-width: 813px) 100vw, 813px\" \/><\/figure>\r\n<\/div>\r\n\r\n\r\n\r\n<p>Running this code results in the robot moving around in a square as it repeatedly follows the instruction to move forward 50 <span id=\"urn:enhancement-c7757fcd\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/pixel\">pixels<\/span> before turning 90 degrees to the left. If another player hits the robot, it may be forced off course and take a new, random orientation.<\/p>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\" id=\"h-events-and-reactions\">Events and Reactions<\/h2>\r\n\r\n\r\n\r\n<p>Throughout the game, the robot is continuously receiving information about its environment from the <code>args<\/code> parameter. At the top of your list of things to check should be <code>args.event<\/code><\/p>\r\n\r\n\r\n\r\n<p>Your robot can react to four different event types:<\/p>\r\n\r\n\r\n\r\n<ul class=\"wp-block-list\">\r\n<li><code>idle<\/code>: the robot is inactive because it has run out of <span id=\"urn:enhancement-2c5274df\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/command_computing\">commands<\/span><\/li>\r\n<li><code>enemy-spot<\/code>: the enemy has been sighted directly in front of the robot\u2019s laser turret.<\/li>\r\n<li><code>hit<\/code>: an enemy laser has hit the robot.<\/li>\r\n<li><code>wall-collide<\/code>: the robot cannot move forward as it has collided with a wall.<\/li>\r\n<\/ul>\r\n\r\n\r\n\r\n<p>The next essential ability is the capacity to \u2018shoot\u2019 at opponents. A switch added to the event serves this purpose. An array is again used to collate the orders for execution. The <span id=\"urn:enhancement-cea00f00\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/code_cryptography\">code<\/span> now looks like this:<\/p>\r\n\r\n\r\n\r\n<div class=\"wp-block-image\">\r\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"806\" height=\"311\" class=\"wp-image-12987\" src=\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2021\/01\/Screenshot-2021-01-03-at-17.54.35.png\" alt=\"\" srcset=\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2021\/01\/Screenshot-2021-01-03-at-17.54.35.png 806w, https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2021\/01\/Screenshot-2021-01-03-at-17.54.35-300x116.png 300w, https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2021\/01\/Screenshot-2021-01-03-at-17.54.35-768x296.png 768w\" sizes=\"auto, (max-width: 806px) 100vw, 806px\" \/><\/figure>\r\n<\/div>\r\n\r\n\r\n\r\n<p>This function returns an array of orders. Each of these orders operates in the manner of a map, for which the key is a command to execute.<\/p>\r\n\r\n\r\n\r\n<p>Two different order types exist. <strong>Movement orders<\/strong> execute sequentially, i.e., your robot must take one action at a time \u2013 it cannot move right and left simultaneously, or make a turn and move forward at the same time .<\/p>\r\n\r\n\r\n\r\n<p id=\"h-the-movement-orders-available-are\">The movement orders available are<strong>:<\/strong><\/p>\r\n\r\n\r\n\r\n<ul class=\"wp-block-list\">\r\n<li><code>move_forwards &lt;number&gt;<\/code>: move forward the number of pixels specified;<\/li>\r\n<li><code>move_backwards &lt;number&gt;<\/code>: move back the specified number of pixels;<\/li>\r\n<li><code>move_opposite &lt;number&gt;<\/code>: move the opposite way (helpful when you reach a wall!);<\/li>\r\n<li><code>turn_left &lt;degrees&gt;<\/code>: turn the specified number of degrees to the left;<\/li>\r\n<li><code>turn_right &lt;degrees&gt;<\/code>: turn right by the number of degrees specified.<\/li>\r\n<\/ul>\r\n\r\n\r\n\r\n<p><strong>Attack orders<\/strong> on the other hand, execute concurrently. Your robot can yell and shoot simultaneously, and the turret can also be moved.<\/p>\r\n\r\n\r\n\r\n<p id=\"h-the-attack-orders-are\">The attack orders are:<\/p>\r\n\r\n\r\n\r\n<ul class=\"wp-block-list\">\r\n<li><code>yell &lt;message&gt;<\/code>: display a message;<\/li>\r\n<li><code>shot: true<\/code>: an order to shoot when the value is true;<\/li>\r\n<li><code>turn_turret_left &lt;degrees&gt;<\/code>: rotate the turret to the left by a specified number of degrees;<\/li>\r\n<li><code>turn_turret_right &lt;degrees&gt;<\/code>: rotate the turret to the right by the number of degrees specified;<\/li>\r\n<li><code>data: &lt;object&gt;<\/code>: store the object for future events.<\/li>\r\n<\/ul>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\" id=\"h-improve-your-fighter\">Improve your Fighter<\/h2>\r\n\r\n\r\n\r\n<p>Now you are ready to see your robot in action, and to deal with situations in which the robot collides with a wall or is shot by the enemy. When a new robot is created, a default fighter is established using this control program:<\/p>\r\n\r\n\r\n\r\n<div class=\"wp-block-image\">\r\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"806\" height=\"470\" class=\"wp-image-12988\" src=\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2021\/01\/Screenshot-2021-01-03-at-17.56.22.png\" alt=\"\" srcset=\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2021\/01\/Screenshot-2021-01-03-at-17.56.22.png 806w, https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2021\/01\/Screenshot-2021-01-03-at-17.56.22-300x175.png 300w, https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2021\/01\/Screenshot-2021-01-03-at-17.56.22-768x448.png 768w\" sizes=\"auto, (max-width: 806px) 100vw, 806px\" \/><\/figure>\r\n<\/div>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\" id=\"h-make-your-serverless-robot-stateful\">Make your Serverless Robot Stateful<\/h2>\r\n\r\n\r\n\r\n<p>Up to this point, you\u2019ve created a simple robot that follows a square pattern and fires when the enemy is seen. Give the robot a better chance of winning by using the robot\u2019s ability to \u2018remember\u2019 the current state of play, and to consider information about its environment, to make it a bit smarter. \u200b<\/p>\r\n\r\n\r\n\r\n<p>In the examples below, we use the following skeleton for the action. You will replace the place holder <code>\/\/ insert here<\/code> with code snippets we will introduce later.<\/p>\r\n\r\n\r\n\r\n<div class=\"wp-block-image\">\r\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"802\" height=\"205\" class=\"wp-image-12989\" src=\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2021\/01\/Screenshot-2021-01-03-at-17.56.35.png\" alt=\"\" srcset=\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2021\/01\/Screenshot-2021-01-03-at-17.56.35.png 802w, https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2021\/01\/Screenshot-2021-01-03-at-17.56.35-300x77.png 300w, https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2021\/01\/Screenshot-2021-01-03-at-17.56.35-768x196.png 768w\" sizes=\"auto, (max-width: 802px) 100vw, 802px\" \/><\/figure>\r\n<\/div>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\" id=\"h-the-input-event\">The input event<\/h3>\r\n\r\n\r\n\r\n<p>As you have already seen, your serverless API receives the function parameter, called <code><span id=\"urn:enhancement-3af5444d\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/entry_point\">args<\/span><\/code> in the examples, as the event. Information about the game, your robot\u2019s position and that of its opponent are all included in this event, with the schema as follows:<\/p>\r\n\r\n\r\n\r\n<div class=\"wp-block-image\">\r\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"802\" height=\"246\" class=\"wp-image-12990\" src=\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2021\/01\/Screenshot-2021-01-03-at-17.56.48.png\" alt=\"serverless robot\" srcset=\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2021\/01\/Screenshot-2021-01-03-at-17.56.48.png 802w, https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2021\/01\/Screenshot-2021-01-03-at-17.56.48-300x92.png 300w, https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2021\/01\/Screenshot-2021-01-03-at-17.56.48-768x236.png 768w\" sizes=\"auto, (max-width: 802px) 100vw, 802px\" \/><\/figure>\r\n<\/div>\r\n\r\n\r\n\r\n<p>The event specifies the Faasfighter&#8217;s position (<code>x<\/code> and <code>y<\/code>), how many attacks are possible before the robot is defeated (<code>energy<\/code>), the angles of the tank (<code>tank_angle<\/code>) and the turret (<code>turret_angle<\/code>), and the total angle \u00a0&#8211; in effect, your laser beam\u2019s angle.<\/p>\r\n\r\n\r\n\r\n<p>Once your robot can see its opponent, more details can be found in the enemy_spot\u00a0 object. This, and other information about the state of the game, can be held in data, but learning how to look for the enemy comes first. One easy option is simply to turn the turret a full 360 degree circle, using the code:<\/p>\r\n\r\n\r\n\r\n<div class=\"wp-block-image\">\r\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"801\" height=\"84\" class=\"wp-image-12991\" src=\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2021\/01\/Screenshot-2021-01-03-at-17.57.53.png\" alt=\"serverless robot\" srcset=\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2021\/01\/Screenshot-2021-01-03-at-17.57.53.png 801w, https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2021\/01\/Screenshot-2021-01-03-at-17.57.53-300x31.png 300w, https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2021\/01\/Screenshot-2021-01-03-at-17.57.53-768x81.png 768w\" sizes=\"auto, (max-width: 801px) 100vw, 801px\" \/><\/figure>\r\n<\/div>\r\n\r\n\r\n\r\n<p>By beginning the battle, enabling <strong>Debug<\/strong>\u00a0 and clicking on <strong>Trace<\/strong> repeatedly, the event <code>enemy-spot<\/code> (the turret is aligned with the enemy) will eventually become obvious<\/p>\r\n\r\n\r\n\r\n<p>Here is an example <code>enemy-spot<\/code> object:<\/p>\r\n\r\n\r\n\r\n<div class=\"wp-block-image\">\r\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"805\" height=\"380\" class=\"wp-image-12992\" src=\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2021\/01\/Screenshot-2021-01-03-at-17.58.01.png\" alt=\"serverless robot\" srcset=\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2021\/01\/Screenshot-2021-01-03-at-17.58.01.png 805w, https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2021\/01\/Screenshot-2021-01-03-at-17.58.01-300x142.png 300w, https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2021\/01\/Screenshot-2021-01-03-at-17.58.01-768x363.png 768w\" sizes=\"auto, (max-width: 805px) 100vw, 805px\" \/><\/figure>\r\n<\/div>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\" id=\"h-making-use-of-saved-history\">Making use of saved History<\/h2>\r\n\r\n\r\n\r\n<p>In the example above, you\u2019ll see that the opponent has been sighted at a distance of 207 pixels and an angle of 346 degrees, but now what? It might be useful to remember the enemy\u2019s last known location, so we can aim the turret accordingly. To do that, we need to save the angle. This can be achieved using the data\u00a0command:<\/p>\r\n\r\n\r\n\r\n<div class=\"wp-block-image\">\r\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"77\" class=\"wp-image-12993\" src=\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2021\/01\/Screenshot-2021-01-03-at-17.58.11.png\" alt=\"\" srcset=\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2021\/01\/Screenshot-2021-01-03-at-17.58.11.png 800w, https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2021\/01\/Screenshot-2021-01-03-at-17.58.11-300x29.png 300w, https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2021\/01\/Screenshot-2021-01-03-at-17.58.11-768x74.png 768w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/figure>\r\n<\/div>\r\n\r\n\r\n\r\n<p>The robot is now building a store of information; this allows us to align the turret with the enemy robot and take aim. When your angle is greater than that of the enemy, it\u2019s usually best to rotate the turret to the left. If not, rotate to the right, and fire when alignment with the enemy has been achieved.<\/p>\r\n\r\n\r\n\r\n<p>Once a shot has been fired, the angle we saved earlier is no longer relevant until the enemy has been spotted again. It\u2019s also wise to move while the robot is idle \u2013 no point in giving the enemy an easy target &#8211; while continuing to rotate the turret to spot your opponent.\u00a0In code, this looks like:<\/p>\r\n\r\n\r\n\r\n<div class=\"wp-block-image\">\r\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"806\" height=\"344\" class=\"wp-image-12994\" src=\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2021\/01\/Screenshot-2021-01-03-at-17.59.23.png\" alt=\"serverless robot\" srcset=\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2021\/01\/Screenshot-2021-01-03-at-17.59.23.png 806w, https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2021\/01\/Screenshot-2021-01-03-at-17.59.23-300x128.png 300w, https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2021\/01\/Screenshot-2021-01-03-at-17.59.23-768x328.png 768w\" sizes=\"auto, (max-width: 806px) 100vw, 806px\" \/><\/figure>\r\n<\/div>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\" id=\"h-a-few-final-refinements-for-our-serverless-robot\">A few final refinements for our Serverless Robot<\/h2>\r\n\r\n\r\n\r\n<p>You now have a good robot, but it\u2019s still vulnerable if it collides with a wall and gets stuck, so some adaptation is necessary. In this case, the solution involves moving in the opposite direction and then turning 90 degrees to the right.<\/p>\r\n\r\n\r\n\r\n<div class=\"wp-block-image\">\r\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"100\" class=\"wp-image-12995\" src=\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2021\/01\/Screenshot-2021-01-03-at-17.59.31.png\" alt=\"\" srcset=\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2021\/01\/Screenshot-2021-01-03-at-17.59.31.png 800w, https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2021\/01\/Screenshot-2021-01-03-at-17.59.31-300x38.png 300w, https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2021\/01\/Screenshot-2021-01-03-at-17.59.31-768x96.png 768w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/figure>\r\n<\/div>\r\n\r\n\r\n\r\n<p>If the robot takes a hit, moving away is a good idea \u2013 you don\u2019t want your robot to be hit repeatedly. One option for evasive action is to move by a random amount, in this case backwards, to get away from enemy fire safely:<\/p>\r\n\r\n\r\n\r\n<div class=\"wp-block-image\">\r\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"801\" height=\"84\" class=\"wp-image-12996\" src=\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2021\/01\/Screenshot-2021-01-03-at-17.59.42.png\" alt=\"serverless robot\" srcset=\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2021\/01\/Screenshot-2021-01-03-at-17.59.42.png 801w, https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2021\/01\/Screenshot-2021-01-03-at-17.59.42-300x31.png 300w, https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2021\/01\/Screenshot-2021-01-03-at-17.59.42-768x81.png 768w\" sizes=\"auto, (max-width: 801px) 100vw, 801px\" \/><\/figure>\r\n<\/div>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\" id=\"h-in-conclusion\">In Conclusion&#8230;<\/h2>\r\n\r\n\r\n\r\n<p>The fundamentals of the game and how you can control your FaaSfighter &#8211; move, spot the enemy, persist state, aim and fire \u2013 are now clear. What comes next is up to you! What might a successful strategy look like? How good are you at judging the location and travel speed of your opponent? Are you able to predict and outmanoeuvre its actions? Are there other evasive actions that will get you \u00a0out of the line of fire faster and more efficiently?<\/p>\r\n\r\n\r\n\r\n<p>The opportunities for fun are unlimited and we hope you will enjoy competing while you learn about serverless programming. The <a class=\"ek-link\" href=\"http:\/\/faaswars.nimbella.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">FAAS WARS<\/a> are just beginning; good luck, and may yours be the victorious FaaSfighter!<\/p>\r\n\r\n\r\n","protected":false},"excerpt":{"rendered":"<p>Organised by Nimbella and promoted by several members of the Apache OpenWhisk community, FaaS Wars is a programming competition that allows participants to learn how to use &#8216;serverless&#8217; in a fun way. Competitors strive against each other for cash prizes for creating the best serverless virtual robot. The basic concept of the competition is simple:&#8230; <a class=\"more-link\" href=\"https:\/\/www.codemotion.com\/magazine\/backend\/faas-wars-serverless-robot\/\">Read more<\/a><\/p>\n","protected":false},"author":108,"featured_media":13084,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_editorskit_title_hidden":false,"_editorskit_reading_time":7,"_editorskit_is_block_options_detached":false,"_editorskit_block_options_position":"{}","_uag_custom_page_level_css":"","_genesis_hide_title":false,"_genesis_hide_breadcrumbs":false,"_genesis_hide_singular_image":false,"_genesis_hide_footer_widgets":false,"_genesis_custom_body_class":"","_genesis_custom_post_class":"","_genesis_layout":"","footnotes":""},"categories":[36],"tags":[75],"collections":[],"class_list":{"0":"post-12983","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-backend","8":"tag-serverless","9":"entry"},"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v26.9 (Yoast SEO v26.9) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>FaaS Wars: the Nimbella&#039;s Serverless Robot competition - Codemotion<\/title>\n<meta name=\"description\" content=\"Nimbella&#039;s new competition helps developers learn about serverless quickly and enjoyably, with cash prizes for the best virtual robot!\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.codemotion.com\/magazine\/backend\/faas-wars-serverless-robot\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Are You Ready for the FaaS Wars?\" \/>\n<meta property=\"og:description\" content=\"Nimbella&#039;s new competition helps developers learn about serverless quickly and enjoyably, with cash prizes for the best virtual robot!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.codemotion.com\/magazine\/backend\/faas-wars-serverless-robot\/\" \/>\n<meta property=\"og:site_name\" content=\"Codemotion Magazine\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/Codemotion.Italy\/\" \/>\n<meta property=\"article:published_time\" content=\"2021-01-08T16:24:59+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-01-05T19:03:24+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2021\/01\/Senza-titolo-1.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"675\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Michele Sciabarra\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@CodemotionIT\" \/>\n<meta name=\"twitter:site\" content=\"@CodemotionIT\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Michele Sciabarra\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"10 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.codemotion.com\/magazine\/backend\/faas-wars-serverless-robot\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.codemotion.com\/magazine\/backend\/faas-wars-serverless-robot\/\"},\"author\":{\"name\":\"Michele Sciabarra\",\"@id\":\"https:\/\/www.codemotion.com\/magazine\/#\/schema\/person\/33dc64bc338d201f84fad786a26c49a7\"},\"headline\":\"Are You Ready for the FaaS Wars?\",\"datePublished\":\"2021-01-08T16:24:59+00:00\",\"dateModified\":\"2022-01-05T19:03:24+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.codemotion.com\/magazine\/backend\/faas-wars-serverless-robot\/\"},\"wordCount\":1597,\"publisher\":{\"@id\":\"https:\/\/www.codemotion.com\/magazine\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.codemotion.com\/magazine\/backend\/faas-wars-serverless-robot\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2021\/01\/Senza-titolo-1.jpg\",\"keywords\":[\"Serverless\"],\"articleSection\":[\"Backend\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.codemotion.com\/magazine\/backend\/faas-wars-serverless-robot\/\",\"url\":\"https:\/\/www.codemotion.com\/magazine\/backend\/faas-wars-serverless-robot\/\",\"name\":\"FaaS Wars: the Nimbella's Serverless Robot competition - Codemotion\",\"isPartOf\":{\"@id\":\"https:\/\/www.codemotion.com\/magazine\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.codemotion.com\/magazine\/backend\/faas-wars-serverless-robot\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.codemotion.com\/magazine\/backend\/faas-wars-serverless-robot\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2021\/01\/Senza-titolo-1.jpg\",\"datePublished\":\"2021-01-08T16:24:59+00:00\",\"dateModified\":\"2022-01-05T19:03:24+00:00\",\"description\":\"Nimbella's new competition helps developers learn about serverless quickly and enjoyably, with cash prizes for the best virtual robot!\",\"breadcrumb\":{\"@id\":\"https:\/\/www.codemotion.com\/magazine\/backend\/faas-wars-serverless-robot\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.codemotion.com\/magazine\/backend\/faas-wars-serverless-robot\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.codemotion.com\/magazine\/backend\/faas-wars-serverless-robot\/#primaryimage\",\"url\":\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2021\/01\/Senza-titolo-1.jpg\",\"contentUrl\":\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2021\/01\/Senza-titolo-1.jpg\",\"width\":1200,\"height\":675,\"caption\":\"robot programming\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.codemotion.com\/magazine\/backend\/faas-wars-serverless-robot\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.codemotion.com\/magazine\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Backend\",\"item\":\"https:\/\/www.codemotion.com\/magazine\/backend\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Are You Ready for the FaaS Wars?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.codemotion.com\/magazine\/#website\",\"url\":\"https:\/\/www.codemotion.com\/magazine\/\",\"name\":\"Codemotion Magazine\",\"description\":\"We code the future. Together\",\"publisher\":{\"@id\":\"https:\/\/www.codemotion.com\/magazine\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.codemotion.com\/magazine\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.codemotion.com\/magazine\/#organization\",\"name\":\"Codemotion\",\"url\":\"https:\/\/www.codemotion.com\/magazine\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.codemotion.com\/magazine\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/11\/codemotionlogo.png\",\"contentUrl\":\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/11\/codemotionlogo.png\",\"width\":225,\"height\":225,\"caption\":\"Codemotion\"},\"image\":{\"@id\":\"https:\/\/www.codemotion.com\/magazine\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/Codemotion.Italy\/\",\"https:\/\/x.com\/CodemotionIT\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.codemotion.com\/magazine\/#\/schema\/person\/33dc64bc338d201f84fad786a26c49a7\",\"name\":\"Michele Sciabarra\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.codemotion.com\/magazine\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/11c9a9613504cf98fd6a63fa1562f07dbb128c45bccb1b4ca2bc0ec30ed1f6e9?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/11c9a9613504cf98fd6a63fa1562f07dbb128c45bccb1b4ca2bc0ec30ed1f6e9?s=96&d=mm&r=g\",\"caption\":\"Michele Sciabarra\"},\"sameAs\":[\"https:\/\/sciabarra.com\/\"],\"url\":\"https:\/\/www.codemotion.com\/magazine\/author\/michele-sciabarra\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"FaaS Wars: the Nimbella's Serverless Robot competition - Codemotion","description":"Nimbella's new competition helps developers learn about serverless quickly and enjoyably, with cash prizes for the best virtual robot!","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.codemotion.com\/magazine\/backend\/faas-wars-serverless-robot\/","og_locale":"en_US","og_type":"article","og_title":"Are You Ready for the FaaS Wars?","og_description":"Nimbella's new competition helps developers learn about serverless quickly and enjoyably, with cash prizes for the best virtual robot!","og_url":"https:\/\/www.codemotion.com\/magazine\/backend\/faas-wars-serverless-robot\/","og_site_name":"Codemotion Magazine","article_publisher":"https:\/\/www.facebook.com\/Codemotion.Italy\/","article_published_time":"2021-01-08T16:24:59+00:00","article_modified_time":"2022-01-05T19:03:24+00:00","og_image":[{"width":1200,"height":675,"url":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2021\/01\/Senza-titolo-1.jpg","type":"image\/jpeg"}],"author":"Michele Sciabarra","twitter_card":"summary_large_image","twitter_creator":"@CodemotionIT","twitter_site":"@CodemotionIT","twitter_misc":{"Written by":"Michele Sciabarra","Est. reading time":"10 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.codemotion.com\/magazine\/backend\/faas-wars-serverless-robot\/#article","isPartOf":{"@id":"https:\/\/www.codemotion.com\/magazine\/backend\/faas-wars-serverless-robot\/"},"author":{"name":"Michele Sciabarra","@id":"https:\/\/www.codemotion.com\/magazine\/#\/schema\/person\/33dc64bc338d201f84fad786a26c49a7"},"headline":"Are You Ready for the FaaS Wars?","datePublished":"2021-01-08T16:24:59+00:00","dateModified":"2022-01-05T19:03:24+00:00","mainEntityOfPage":{"@id":"https:\/\/www.codemotion.com\/magazine\/backend\/faas-wars-serverless-robot\/"},"wordCount":1597,"publisher":{"@id":"https:\/\/www.codemotion.com\/magazine\/#organization"},"image":{"@id":"https:\/\/www.codemotion.com\/magazine\/backend\/faas-wars-serverless-robot\/#primaryimage"},"thumbnailUrl":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2021\/01\/Senza-titolo-1.jpg","keywords":["Serverless"],"articleSection":["Backend"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.codemotion.com\/magazine\/backend\/faas-wars-serverless-robot\/","url":"https:\/\/www.codemotion.com\/magazine\/backend\/faas-wars-serverless-robot\/","name":"FaaS Wars: the Nimbella's Serverless Robot competition - Codemotion","isPartOf":{"@id":"https:\/\/www.codemotion.com\/magazine\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.codemotion.com\/magazine\/backend\/faas-wars-serverless-robot\/#primaryimage"},"image":{"@id":"https:\/\/www.codemotion.com\/magazine\/backend\/faas-wars-serverless-robot\/#primaryimage"},"thumbnailUrl":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2021\/01\/Senza-titolo-1.jpg","datePublished":"2021-01-08T16:24:59+00:00","dateModified":"2022-01-05T19:03:24+00:00","description":"Nimbella's new competition helps developers learn about serverless quickly and enjoyably, with cash prizes for the best virtual robot!","breadcrumb":{"@id":"https:\/\/www.codemotion.com\/magazine\/backend\/faas-wars-serverless-robot\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.codemotion.com\/magazine\/backend\/faas-wars-serverless-robot\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.codemotion.com\/magazine\/backend\/faas-wars-serverless-robot\/#primaryimage","url":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2021\/01\/Senza-titolo-1.jpg","contentUrl":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2021\/01\/Senza-titolo-1.jpg","width":1200,"height":675,"caption":"robot programming"},{"@type":"BreadcrumbList","@id":"https:\/\/www.codemotion.com\/magazine\/backend\/faas-wars-serverless-robot\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.codemotion.com\/magazine\/"},{"@type":"ListItem","position":2,"name":"Backend","item":"https:\/\/www.codemotion.com\/magazine\/backend\/"},{"@type":"ListItem","position":3,"name":"Are You Ready for the FaaS Wars?"}]},{"@type":"WebSite","@id":"https:\/\/www.codemotion.com\/magazine\/#website","url":"https:\/\/www.codemotion.com\/magazine\/","name":"Codemotion Magazine","description":"We code the future. Together","publisher":{"@id":"https:\/\/www.codemotion.com\/magazine\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.codemotion.com\/magazine\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.codemotion.com\/magazine\/#organization","name":"Codemotion","url":"https:\/\/www.codemotion.com\/magazine\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.codemotion.com\/magazine\/#\/schema\/logo\/image\/","url":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/11\/codemotionlogo.png","contentUrl":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/11\/codemotionlogo.png","width":225,"height":225,"caption":"Codemotion"},"image":{"@id":"https:\/\/www.codemotion.com\/magazine\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/Codemotion.Italy\/","https:\/\/x.com\/CodemotionIT"]},{"@type":"Person","@id":"https:\/\/www.codemotion.com\/magazine\/#\/schema\/person\/33dc64bc338d201f84fad786a26c49a7","name":"Michele Sciabarra","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.codemotion.com\/magazine\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/11c9a9613504cf98fd6a63fa1562f07dbb128c45bccb1b4ca2bc0ec30ed1f6e9?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/11c9a9613504cf98fd6a63fa1562f07dbb128c45bccb1b4ca2bc0ec30ed1f6e9?s=96&d=mm&r=g","caption":"Michele Sciabarra"},"sameAs":["https:\/\/sciabarra.com\/"],"url":"https:\/\/www.codemotion.com\/magazine\/author\/michele-sciabarra\/"}]}},"featured_image_src":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2021\/01\/Senza-titolo-1-600x400.jpg","featured_image_src_square":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2021\/01\/Senza-titolo-1-600x600.jpg","author_info":{"display_name":"Michele Sciabarra","author_link":"https:\/\/www.codemotion.com\/magazine\/author\/michele-sciabarra\/"},"uagb_featured_image_src":{"full":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2021\/01\/Senza-titolo-1.jpg",1200,675,false],"thumbnail":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2021\/01\/Senza-titolo-1-150x150.jpg",150,150,true],"medium":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2021\/01\/Senza-titolo-1-300x169.jpg",300,169,true],"medium_large":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2021\/01\/Senza-titolo-1-768x432.jpg",768,432,true],"large":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2021\/01\/Senza-titolo-1-1024x576.jpg",1024,576,true],"1536x1536":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2021\/01\/Senza-titolo-1.jpg",1200,675,false],"2048x2048":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2021\/01\/Senza-titolo-1.jpg",1200,675,false],"small-home-featured":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2021\/01\/Senza-titolo-1.jpg",100,56,false],"sidebar-featured":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2021\/01\/Senza-titolo-1-180x128.jpg",180,128,true],"genesis-singular-images":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2021\/01\/Senza-titolo-1-896x504.jpg",896,504,true],"archive-featured":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2021\/01\/Senza-titolo-1-400x225.jpg",400,225,true],"gb-block-post-grid-landscape":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2021\/01\/Senza-titolo-1-600x400.jpg",600,400,true],"gb-block-post-grid-square":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2021\/01\/Senza-titolo-1-600x600.jpg",600,600,true]},"uagb_author_info":{"display_name":"Michele Sciabarra","author_link":"https:\/\/www.codemotion.com\/magazine\/author\/michele-sciabarra\/"},"uagb_comment_info":0,"uagb_excerpt":"Organised by Nimbella and promoted by several members of the Apache OpenWhisk community, FaaS Wars is a programming competition that allows participants to learn how to use &#8216;serverless&#8217; in a fun way. Competitors strive against each other for cash prizes for creating the best serverless virtual robot. The basic concept of the competition is simple:&#8230;&hellip;","lang":"en","_links":{"self":[{"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/posts\/12983","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/users\/108"}],"replies":[{"embeddable":true,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/comments?post=12983"}],"version-history":[{"count":11,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/posts\/12983\/revisions"}],"predecessor-version":[{"id":13145,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/posts\/12983\/revisions\/13145"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/media\/13084"}],"wp:attachment":[{"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/media?parent=12983"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/categories?post=12983"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/tags?post=12983"},{"taxonomy":"collections","embeddable":true,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/collections?post=12983"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}