{"id":684,"date":"2015-10-09T23:31:47","date_gmt":"2015-10-09T15:31:47","guid":{"rendered":"http:\/\/konsolscript.sourceforge.net\/web\/?p=684"},"modified":"2022-06-15T18:18:43","modified_gmt":"2022-06-15T10:18:43","slug":"hello-world","status":"publish","type":"post","link":"http:\/\/konsolscript.sourceforge.net\/web\/2015\/10\/09\/hello-world\/","title":{"rendered":"Tutorial 3: Hello World"},"content":{"rendered":"<p>This tutorial assumes that you already <a href=\"http:\/\/konsolscript.sourceforge.net\/web\/2015\/10\/07\/installing-konsolscript\/\">installed KonsolScript<\/a>, and was able to prove that <a href=\"http:\/\/konsolscript.sourceforge.net\/web\/2015\/10\/08\/running-konsolscript\/\">everything works fine<\/a>.<\/p>\n<p>Assuming you are using Windows 7, right-click anywhere on your Desktop or on your working directory.  Then select New-> KonsolScript Document as shown in photo below.<br \/>\n<img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/konsolscript.sourceforge.net\/web\/wp-content\/uploads\/2015\/10\/hello1.png\" alt=\"\" title=\"Right-click New\" width=\"541\" height=\"375\" class=\"aligncenter size-full wp-image-688\" srcset=\"http:\/\/konsolscript.sourceforge.net\/web\/wp-content\/uploads\/2015\/10\/hello1.png 541w, http:\/\/konsolscript.sourceforge.net\/web\/wp-content\/uploads\/2015\/10\/hello1-300x207.png 300w\" sizes=\"(max-width: 541px) 100vw, 541px\" \/><\/p>\n<p>If successful, you should already have a file temporarily named &#8220;<strong>New KonsolScript Document.ks<\/strong>&#8221; which you can rename, of course.<br \/>\n<img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/konsolscript.sourceforge.net\/web\/wp-content\/uploads\/2015\/10\/hello2.png\" alt=\"\" title=\"Rename KS\" width=\"556\" height=\"234\" class=\"aligncenter size-full wp-image-689\" srcset=\"http:\/\/konsolscript.sourceforge.net\/web\/wp-content\/uploads\/2015\/10\/hello2.png 556w, http:\/\/konsolscript.sourceforge.net\/web\/wp-content\/uploads\/2015\/10\/hello2-300x126.png 300w\" sizes=\"(max-width: 556px) 100vw, 556px\" \/><\/p>\n<p>In this tutorial, let&#8217;s rename it to <strong>helloworld.ks<\/strong>.<\/p>\n<p>The file has nothing written on it, yet.  So, open Notepad from Start Menu, as shown in photo below.<br \/>\n<img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/konsolscript.sourceforge.net\/web\/wp-content\/uploads\/2015\/10\/hello3.png\" alt=\"\" title=\"Run Notepad\" width=\"412\" height=\"476\" class=\"aligncenter size-full wp-image-690\" srcset=\"http:\/\/konsolscript.sourceforge.net\/web\/wp-content\/uploads\/2015\/10\/hello3.png 412w, http:\/\/konsolscript.sourceforge.net\/web\/wp-content\/uploads\/2015\/10\/hello3-259x300.png 259w\" sizes=\"(max-width: 412px) 100vw, 412px\" \/><\/p>\n<p>Now, drag <em>helloworld.ks<\/em> to the Notepad application.  You will know that you are ready to write codes in <em>helloworld.ks<\/em> if you see its name in Notepad&#8217;s title bar as shown below.<br \/>\n<img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/konsolscript.sourceforge.net\/web\/wp-content\/uploads\/2015\/10\/hello4.png\" alt=\"\" title=\"KS on Notepad\" width=\"676\" height=\"214\" class=\"aligncenter size-full wp-image-692\" srcset=\"http:\/\/konsolscript.sourceforge.net\/web\/wp-content\/uploads\/2015\/10\/hello4.png 676w, http:\/\/konsolscript.sourceforge.net\/web\/wp-content\/uploads\/2015\/10\/hello4-300x94.png 300w\" sizes=\"(max-width: 676px) 100vw, 676px\" \/><\/p>\n<p>That means you can copy and paste this sample code.<br \/>\n<strong><\/p>\n<pre>function main() {\r\n  \/\/more code to follow\r\n}\r\n\r\nfunction cleanrender() {\r\n  \/\/?\r\n}\r\n\r\nfunction mousemove() {\r\n  Screen:PrintString(\"hi, I'm KonsolScript!\")\r\n}<\/pre>\n<p><\/strong><\/p>\n<p>Save the file, via <strong>File -> Save<\/strong>.<br \/>\n<img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/konsolscript.sourceforge.net\/web\/wp-content\/uploads\/2015\/10\/hello5.png\" alt=\"\" title=\"File Save\" width=\"386\" height=\"245\" class=\"aligncenter size-full wp-image-691\" srcset=\"http:\/\/konsolscript.sourceforge.net\/web\/wp-content\/uploads\/2015\/10\/hello5.png 386w, http:\/\/konsolscript.sourceforge.net\/web\/wp-content\/uploads\/2015\/10\/hello5-300x190.png 300w\" sizes=\"(max-width: 386px) 100vw, 386px\" \/><\/p>\n<p>Finally, double-click <strong>helloworld.ks<\/strong> to run your very first KonsolScript code.  It will do nothing for now, but you can move your mouse over it.<br \/>\n<img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/konsolscript.sourceforge.net\/web\/wp-content\/uploads\/2015\/10\/hello6.png\" alt=\"\" title=\"hello6\" width=\"441\" height=\"219\" class=\"aligncenter size-full wp-image-696\" \/><\/p>\n<p>So, what&#8217;s happening?  I will explain in the <a href=\"http:\/\/konsolscript.sourceforge.net\/web\/2015\/11\/08\/understanding-konsolscript\/\">next tutorial<\/a>.  So, read on! \ud83d\ude42<\/p>\n<p><em>~creek23<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This tutorial assumes that you already installed KonsolScript, and was able to prove that everything works fine. Assuming you are using Windows 7, right-click anywhere on your Desktop or on your working directory. Then select New-> KonsolScript Document as shown in photo below. If successful, you should already have a file temporarily named &#8220;New KonsolScript [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":695,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"_links":{"self":[{"href":"http:\/\/konsolscript.sourceforge.net\/web\/wp-json\/wp\/v2\/posts\/684"}],"collection":[{"href":"http:\/\/konsolscript.sourceforge.net\/web\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/konsolscript.sourceforge.net\/web\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/konsolscript.sourceforge.net\/web\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/konsolscript.sourceforge.net\/web\/wp-json\/wp\/v2\/comments?post=684"}],"version-history":[{"count":10,"href":"http:\/\/konsolscript.sourceforge.net\/web\/wp-json\/wp\/v2\/posts\/684\/revisions"}],"predecessor-version":[{"id":1275,"href":"http:\/\/konsolscript.sourceforge.net\/web\/wp-json\/wp\/v2\/posts\/684\/revisions\/1275"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/konsolscript.sourceforge.net\/web\/wp-json\/wp\/v2\/media\/695"}],"wp:attachment":[{"href":"http:\/\/konsolscript.sourceforge.net\/web\/wp-json\/wp\/v2\/media?parent=684"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/konsolscript.sourceforge.net\/web\/wp-json\/wp\/v2\/categories?post=684"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/konsolscript.sourceforge.net\/web\/wp-json\/wp\/v2\/tags?post=684"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}