{"id":2804,"date":"2020-04-09T17:47:38","date_gmt":"2020-04-09T08:47:38","guid":{"rendered":"https:\/\/mindstorms.tokyo\/?page_id=2804"},"modified":"2020-04-12T03:29:00","modified_gmt":"2020-04-11T18:29:00","slug":"array-operations","status":"publish","type":"page","link":"https:\/\/mindstorms.tokyo\/en\/data\/array-operations\/","title":{"rendered":"Array Operations Block\u3010How to use MINDSTORMS\u3011"},"content":{"rendered":"\n<a href=\"https:\/\/amzn.to\/3aRNDiS\" target=\"_blank\" rel=\"noopener noreferrer\">\n<img src=\"https:\/\/m.media-amazon.com\/images\/S\/abs-image-upload-na\/e\/AmazonStores\/ATVPDKIKX0DER\/0b0d850b84aa310ad38fa5c65f7a7337.w3000.h600._CR0%2C0%2C3000%2C600_SX1920_.jpg\" alt=\"LEGO\u30c6\u30af\u30cb\u30c3\u30af\" title=\"LEGO\u30c6\u30af\u30cb\u30c3\u30af\" border=\"0\">\n<\/a>\n\n\n\n<h2 style=\"text-align:center\" class=\"h2\">LEGO \u3010MINDSTORMS\u3011EV3<\/h2>\n\n\n\n<h1>Array Operations Block<\/h1>\n\n\n\n<div>\n<h4 style=\"text-align:left\" id=\"area1\" class=\"h4\">Array Operations Block\u3000- Overview -\u3000<\/h4>\n<br>\n<center>\n\n<div class=\"box1\">\n <div class=\"sel1\">\n  <select name=\"channel\" onchange=\"imgChange(this)\">\n   <option value=\"4\" hidden=\"\">Select the mode<\/option>\n   <option value=\"4\">Overview<\/option>\n   <option value=\"0\">Append<\/option>\n   <option value=\"1\">Read at Index<\/option>\n   <option value=\"2\">Write at Index<\/option>\n   <option value=\"3\">Length<\/option>\n  <\/select>\n <\/div>\n\n<img src=\"https:\/\/mindstorms.tokyo\/wp-content\/uploads\/array_overview_EN-e1586587561680.png\" name=\"imgsmp\">\n\n<br><br>\n\n\n\n<div>\n<div class=\"ad_pc\">\n<iframe src=\"\/\/rcm-na.amazon-adsystem.com\/e\/cm?o=1&amp;p=26&amp;l=ur1&amp;category=amazonhomepage&amp;f=ifr&amp;linkID=da254e3c8b5ee3714127a5aa4677ef37&amp;t=hitorigotokun-20&amp;tracking_id=hitorigotokun-20\" width=\"468\" height=\"60\" scrolling=\"no\" border=\"0\" marginwidth=\"0\" style=\"border:none;\" frameborder=\"0\"><\/iframe>\n<\/div>\n\n<div class=\"ad_sp\">\n<iframe src=\"\/\/rcm-na.amazon-adsystem.com\/e\/cm?o=1&amp;p=42&amp;l=ur1&amp;category=amazonhomepage&amp;f=ifr&amp;linkID=aaf6b36c0aa3345cae58c3e7f77b3541&amp;t=hitorigotokun-20&amp;tracking_id=hitorigotokun-20\" width=\"234\" height=\"60\" scrolling=\"no\" border=\"0\" marginwidth=\"0\" style=\"border:none;\" frameborder=\"0\"><\/iframe>\n<\/div>\n<\/div>\n\n\n\n<\/div>\n<\/center>\n<br>\n\n<div class=\"box2\">\n    <div id=\"area2\">The Array Operations block does operations on the Numeric Array and Logic Array data types.<\/div>\n    <div id=\"area3\">You can create an array, add elements, read and write individual elements, and get the length of an array.<\/div>\n    <div id=\"area4\">\u3000<\/div>\n    <div id=\"area5\">Use the Mode Selector to choose the array operation and the array type (Numeric or Logic).<\/div>\n    <div id=\"area6\">The Inputs and Outputs available will change depending on the mode.<\/div>\n    <div id=\"area7\">\u3000<\/div>\n    <div id=\"area8\">Modes\uff1aAppend , Read at Index , Write at Index , Length<\/div>\n    <div id=\"area9\"><\/div>\n    <div id=\"area10\"><\/div>\n<\/div>\n\n<script language=\"JavaScript\">\n<!--    \n\nimg0=new Image()\nimg0.src=\"https:\/\/talk-to-myself.com\/wp-content\/uploads\/2019\/06\/array_0.png\"\nimg1=new Image()\nimg1.src=\"https:\/\/talk-to-myself.com\/wp-content\/uploads\/2019\/06\/array_1.png\"\nimg2=new Image()\nimg2.src=\"https:\/\/talk-to-myself.com\/wp-content\/uploads\/2019\/06\/array_2.png\"\nimg3=new Image()\nimg3.src=\"https:\/\/talk-to-myself.com\/wp-content\/uploads\/2019\/06\/array_3.png\"\nimg4=new Image()\nimg4.src=\"https:\/\/mindstorms.tokyo\/wp-content\/uploads\/array_overview_EN-e1586587561680.png\"\n\nfunction imgChange(parts){\n    fname=parts.options[parts.selectedIndex].value;\n    \n    if(fname==0){\n        document.imgsmp.src=img2.src;\n        document.getElementById(\"area1\").innerText = \"Append\";\n        document.getElementById(\"area2\").innerText = \"The Append mode adds an element to the end of an array. You can also create a new array.\";\n        document.getElementById(\"area3\").innerText = \"\u3000\";\n        document.getElementById(\"area4\").innerText = \"The Array In input specifies an existing array, and the Value specifies the element to add to the end of the array.\";\n        document.getElementById(\"area5\").innerText = \"If you leave Array In blank, a new array will be created with just the new element in it.\";\n        document.getElementById(\"area6\").innerText = \"\u3000\";\n        document.getElementById(\"area7\").innerText = \"\uff0aYou can create a new array with multiple elements in it by entering an array directly into the Array In input.\";\n        document.getElementById(\"area8\").innerText = \"\u3000\";\n        document.getElementById(\"area9\").innerText = \"The Array Out output will be a new array containing the combined elements. The original input array is not affected.\";\n        document.getElementById(\"area10\").innerText = \"\";\n    }        \n    \n    if(fname==1){\n        document.imgsmp.src=img1.src;\n        document.getElementById(\"area1\").innerText = \"Read at Index\";\n        document.getElementById(\"area2\").innerText = \"The Read at Index mode gets the value of an individual element in an array.\";\n        document.getElementById(\"area3\").innerText = \"The Array In input is the array to use. The element to get is specified by the Index.\";\n        document.getElementById(\"area4\").innerText = \"The first element in an array has an Index of 0, the second element has an Index of 1, and so on.\";\n        document.getElementById(\"area5\").innerText = \"The value of the selected element is output in Value.\";\n        document.getElementById(\"area6\").innerText = \"\u3000\";\n        document.getElementById(\"area7\").innerText = \"\uff0aThe Index of the last element in an array with n elements is n-1.\";\n        document.getElementById(\"area8\").innerText = \"\";\n        document.getElementById(\"area9\").innerText = \"\";\n        document.getElementById(\"area10\").innerText = \"\";\n    }\n    \n    if(fname==2){\n        document.imgsmp.src=img2.src;\n        document.getElementById(\"area1\").innerText = \"Write at Index\";\n        document.getElementById(\"area2\").innerText = \"The Write at Index mode changes the value of an individual element in an array.\";\n        document.getElementById(\"area3\").innerText = \"The Array In input is the original array. The element to change is specified by the Index.\";\n        document.getElementById(\"area4\").innerText = \"The first element in an array has an Index of 0, the second element has an Index of 1, and so on.\";\n        document.getElementById(\"area5\").innerText = \"\u3000\";\n        document.getElementById(\"area6\").innerText = \"The value to change the selected element to is specified by the Value.\";\n        document.getElementById(\"area7\").innerText = \"A new array with the element changed is output in Array Out. The original array in Array In is not affected.\";\n        document.getElementById(\"area8\").innerText = \"\";\n        document.getElementById(\"area9\").innerText = \"\";\n        document.getElementById(\"area10\").innerText = \"\";\n    }\n    \n    if(fname==3){\n        document.imgsmp.src=img3.src;\n        document.getElementById(\"area1\").innerText = \"Length\";\n        document.getElementById(\"area2\").innerText = \"The Length mode gets the length of an array.The length of the array in the Array In input is output in Length.\";\n        document.getElementById(\"area3\").innerText = \"\u3000\";\n        document.getElementById(\"area4\").innerText = \"The length of an array is the number of elements in the array.\";\n        document.getElementById(\"area5\").innerText = \"\u3000\";\n        document.getElementById(\"area6\").innerText = \"An empty array has a length of 0, and an array with a single element in has a length of 1.\";\n        document.getElementById(\"area7\").innerText = \"\";\n        document.getElementById(\"area8\").innerText = \"\";\n        document.getElementById(\"area9\").innerText = \"\";\n }\n    \n    if(fname==4){\n        document.imgsmp.src=img4.src;\n        document.getElementById(\"area1\").innerText = \"Overview\";\n        document.getElementById(\"area2\").innerText = \"The Array Operations block does operations on the Numeric Array and Logic Array data types.\";\n        document.getElementById(\"area3\").innerText = \"You can create an array, add elements, read and write individual elements, and get the length of an array.\";\n        document.getElementById(\"area4\").innerText = \"\u3000\";\n        document.getElementById(\"area5\").innerText = \"Use the Mode Selector to choose the array operation and the array type (Numeric or Logic).\";\n        document.getElementById(\"area6\").innerText = \"The Inputs and Outputs available will change depending on the mode.\";\n        document.getElementById(\"area7\").innerText = \"\u3000\";\n        document.getElementById(\"area8\").innerText = \"Modes\uff1aAppend , Read at Index , Write at Index , Length\";\n        document.getElementById(\"area9\").innerText = \"\";\n        document.getElementById(\"area10\").innerText = \"\";\n}\n\n}\n    \n-->\n<\/script>\n    \n<\/div>\n\n\n\n<p><\/p>\n<div class=\"veu_socialSet veu_socialSet-position-after veu_contentAddSection\"><script>window.twttr=(function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],t=window.twttr||{};if(d.getElementById(id))return t;js=d.createElement(s);js.id=id;js.src=\"https:\/\/platform.twitter.com\/widgets.js\";fjs.parentNode.insertBefore(js,fjs);t._e=[];t.ready=function(f){t._e.push(f);};return t;}(document,\"script\",\"twitter-wjs\"));<\/script><ul><li class=\"sb_facebook sb_icon\"><a class=\"sb_icon_inner\" href=\"\/\/www.facebook.com\/sharer.php?src=bm&u=https%3A%2F%2Fmindstorms.tokyo%2Fen%2Fdata%2Farray-operations%2F&amp;t=LEGO%20EV3%20MINDSTORMS%20by%20%E7%8B%AC%E3%82%8A%E8%A8%80%E3%81%8F%E3%82%93\" target=\"_blank\" onclick=\"window.open(this.href,'FBwindow','width=650,height=450,menubar=no,toolbar=no,scrollbars=yes');return false;\"><span class=\"vk_icon_w_r_sns_fb icon_sns\"><\/span><span class=\"sns_txt\">Facebook<\/span><span class=\"veu_count_sns_fb\"><\/span><\/a><\/li><li class=\"sb_twitter sb_icon\"><a class=\"sb_icon_inner\" href=\"\/\/twitter.com\/intent\/tweet?url=https%3A%2F%2Fmindstorms.tokyo%2Fen%2Fdata%2Farray-operations%2F&amp;text=LEGO%20EV3%20MINDSTORMS%20by%20%E7%8B%AC%E3%82%8A%E8%A8%80%E3%81%8F%E3%82%93\" target=\"_blank\" ><span class=\"vk_icon_w_r_sns_twitter icon_sns\"><\/span><span class=\"sns_txt\">twitter<\/span><\/a><\/li><li class=\"sb_hatena sb_icon\"><a class=\"sb_icon_inner\" href=\"\/\/b.hatena.ne.jp\/add?mode=confirm&url=https%3A%2F%2Fmindstorms.tokyo%2Fen%2Fdata%2Farray-operations%2F&amp;title=LEGO%20EV3%20MINDSTORMS%20by%20%E7%8B%AC%E3%82%8A%E8%A8%80%E3%81%8F%E3%82%93\" target=\"_blank\"  onclick=\"window.open(this.href,'Hatenawindow','width=650,height=450,menubar=no,toolbar=no,scrollbars=yes');return false;\"><span class=\"vk_icon_w_r_sns_hatena icon_sns\"><\/span><span class=\"sns_txt\">Hatena<\/span><span class=\"veu_count_sns_hb\"><\/span><\/a><\/li><li class=\"sb_pocket sb_icon\"><a class=\"sb_icon_inner\"  href=\"\/\/getpocket.com\/edit?url=https%3A%2F%2Fmindstorms.tokyo%2Fen%2Fdata%2Farray-operations%2F&title=LEGO%20EV3%20MINDSTORMS%20by%20%E7%8B%AC%E3%82%8A%E8%A8%80%E3%81%8F%E3%82%93\" target=\"_blank\"  onclick=\"window.open(this.href,'Pokcetwindow','width=650,height=450,menubar=no,toolbar=no,scrollbars=yes');return false;\"><span class=\"vk_icon_w_r_sns_pocket icon_sns\"><\/span><span class=\"sns_txt\">Pocket<\/span><span class=\"veu_count_sns_pocket\"><\/span><\/a><\/li><li class=\"sb_copy sb_icon\"><button class=\"copy-button sb_icon_inner\"data-clipboard-text=\"LEGO EV3 MINDSTORMS by \u72ec\u308a\u8a00\u304f\u3093 https:\/\/mindstorms.tokyo\/en\/data\/array-operations\/\"><span class=\"vk_icon_w_r_sns_copy icon_sns\"><i class=\"fas fa-copy\"><\/i><\/span><span class=\"sns_txt\">Copy<\/span><\/button><\/li><\/ul><\/div><!-- [ \/.socialSet ] -->","protected":false},"excerpt":{"rendered":"<p>MINDSTORMS &#8220;Array Operations Block&#8221; Explanation<\/p>\n","protected":false},"author":1,"featured_media":2564,"parent":2811,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"_locale":"en_US","_original_post":"http:\/\/talk-to-myself.com\/?page_id=1658","vkexunit_cta_each_option":""},"_links":{"self":[{"href":"https:\/\/mindstorms.tokyo\/wp-json\/wp\/v2\/pages\/2804"}],"collection":[{"href":"https:\/\/mindstorms.tokyo\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/mindstorms.tokyo\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/mindstorms.tokyo\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mindstorms.tokyo\/wp-json\/wp\/v2\/comments?post=2804"}],"version-history":[{"count":7,"href":"https:\/\/mindstorms.tokyo\/wp-json\/wp\/v2\/pages\/2804\/revisions"}],"predecessor-version":[{"id":2925,"href":"https:\/\/mindstorms.tokyo\/wp-json\/wp\/v2\/pages\/2804\/revisions\/2925"}],"up":[{"embeddable":true,"href":"https:\/\/mindstorms.tokyo\/wp-json\/wp\/v2\/pages\/2811"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/mindstorms.tokyo\/wp-json\/wp\/v2\/media\/2564"}],"wp:attachment":[{"href":"https:\/\/mindstorms.tokyo\/wp-json\/wp\/v2\/media?parent=2804"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}