[{"element_type":"user_image","content":"https://cdn-learn.adafruit.com/user_assets/assets/000/002/277/original/AureBeshArrivals.jpg?1772502790","metadata":{}},{"element_type":"text","content":"\n        \u003cp\u003e\u003ca href=\"https://github.com/mrklingon/Starflight-Traffic\" target=\"_blank\"\u003eProject Star Traffic Github repository\u003c/a\u003e\u003c/p\u003e\n\u003cp\u003e\u003cem\u003e(scroll down to \"How to Use\" to see how to use the code)\u003c/em\u003e\u003c/p\u003e\n\u003cp\u003eMy first PyBasic--\u0026gt;CircuitPython project,\u003cspan\u003e\u0026nbsp;\u003c/span\u003e\u003ca href=\"https://github.com/mrklingon/Project-Starflight\"\u003eProject Starflight\u003c/a\u003e\u003cspan\u003e\u0026nbsp;\u003c/span\u003einvolved defining a set of ten star systems linked with three \"tramline\" exits to other starsystems. The goal of the project was two-fold\u003c/p\u003e\n\u003col\u003e\n\u003cli\u003eSee if I\u003cspan\u003e\u0026nbsp;\u003c/span\u003e\u003cem\u003ecould\u003c/em\u003e\u003cspan\u003e\u0026nbsp;\u003c/span\u003ewrite in BASIC after decades, using PyBasic and\u003c/li\u003e\n\u003cli\u003eTo try to use an LLM to translate it into Python, Python that I could adapt to work as CircuitPython\u003c/li\u003e\n\u003c/ol\u003e\n\u003cp\u003eThis worked pretty well, and I admit the bot did a decent job documenting my undocumented PyBasic code.\u003c/p\u003e\n\u003cp\u003eFollowing that I wanted to try something different.\u003c/p\u003e\n\u003cp\u003eI'm a big fan of the Star Wars ride at Disney, \"Star Tours,\" both for the fun flight simulator effect AND the whole spaceport ambiance of the ride queue, including (see above) the Arrival and Departure displays (ala flight info in an airport). I thought it would be fun to create a running display of spaceship arrivals and departures in a Star Wars mode.\u003c/p\u003e\n\u003cp\u003eSo beginning with my Starflight BASIC code, I reused the data structures defining ships, stars, planets and hyperspace exits. I used fantasynamegenerators.com to create \"Star Wars\"-esque ships, stars and planets, and now refer to the exits as \"hyperspace lanes\" (as is the current SW parlance :).\u003c/p\u003e\n\u003cp\u003eThe program then generates the set of exits from each star, and in a new array, assigns each ship to one of the 10 star systems.\u003c/p\u003e\n\u003cp\u003eNext, in a continuous loop, a ship is chosen, and (if not currently in motion) it is assigned a new destination from one of the exits available. The location array for that ship now has the number of the destination star - to indicate it is\u003cspan\u003e\u0026nbsp;\u003c/span\u003e\u003cem\u003emoving\u003c/em\u003e\u003cspan\u003e\u0026nbsp;\u003c/span\u003ethere the number is recorded as negative (i.e. if going to star #3, \"-3\") is logged.\u003c/p\u003e\n\u003cp\u003eWhen being set in motion TO a star the program prints\u003c/p\u003e\n\u003cpre class=\"notranslate\"\u003e\u003ccode\u003eDeparting from [planet name] vessel [ship name] \nheading for [destination]\n\u003c/code\u003e\u003c/pre\u003e\n\u003cp\u003e\u003cem\u003enote: each star has a \"planet\" associated with it. So departures originate from the planet\u003cspan\u003e\u0026nbsp;\u003c/span\u003e\u003cstrong\u003eto\u003c/strong\u003e\u003cspan\u003e\u0026nbsp;\u003c/span\u003ea star\u003c/em\u003e\u003c/p\u003e\n\u003cp\u003eif the ships location is a negative number, then the program prints:\u003c/p\u003e\n\u003cpre class=\"notranslate\"\u003e\u003ccode\u003e[Ship name] arrived!!\n[Ship name] arriving at [destination star]\n\u003c/code\u003e\u003c/pre\u003e\n\u003cp\u003eThen changes the location value to a positive number to indicate it has arrived, so the next time the ship is chosen by the main loop, it will start from there.\u003c/p\u003e\n\u003cp\u003eOutput looks like:\u003c/p\u003e\n\u003cpre class=\"notranslate\"\u003e\u003ccode\u003eDo you need instructions? (y/n)\n\n? y\nThis system will display current starship traffic\nacross a span of ten interconnected systems.\n\nShips travel from system to system via hyperspace lanes\nand you will see arrivals and departures.\n\n\nDeparting from Uverrooith Vessel: Hellhound\nheading for Krithuc.\nDeparting from Codachaa Vessel: BS Khan\nheading for Pluedurs.\nHellhound arrived!!\nHellhound arriving at Krithuc\nDeparting from Guvor Vessel: Omen\nheading for Krithuc.\nDeparting from Yorar Vessel: Hellhound\nheading for Olutsos.\nDeparting from Vuthadoh Vessel: SC Providence\nheading for Pluedurs.\nHellhound arrived!!\nHellhound arriving at Olutsos\nSC Providence arrived!!\nSC Providence arriving at Pluedurs\nDeparting from Uusnes Vessel: BS Nuria\nheading for Sleak.\nDeparting from Lesti Vessel: Saber\nheading for Sleak.\nSaber arrived!!\nSaber arriving at Sleak\u003c/code\u003e\n\u003c/pre\u003e\n\u003cp\u003e\u0026nbsp;\u003c/p\u003e\n\u003ch2 class=\"heading-element\"\u003eHow to Use:\u003c/h2\u003e\n\u003cp\u003e\u0026nbsp;\u003c/p\u003e\n\u003cp\u003eThere are three sets of code here: a PyBasic version, a CircuitPython app for FruitJam and a CircuitPython version for the NeoTrinkey.\u003c/p\u003e\n\u003ch3 class=\"heading-element\"\u003ePyBasic\u003c/h3\u003e\n\u003cp\u003e\u003ca id=\"user-content-pybasic\" class=\"anchor\" href=\"https://github.com/mrklingon/Starflight-Traffic/blob/main/README.md#pybasic\"\u003e\u003c/a\u003e\u003c/p\u003e\n\u003cul\u003e\n\u003cli\u003eStarTraffic.bas - copy this to the examples/ directory under apps/PyBasic/ on a FruitJam. Then load and run. [\u003cem\u003enote:\u003c/em\u003e\u003cspan\u003e\u0026nbsp;\u003c/span\u003eyou can run this under any PyBasic install]\u003c/li\u003e\n\u003c/ul\u003e\n\u003ch3 class=\"heading-element\"\u003eFruitJam App\u003c/h3\u003e\n\u003cp\u003e\u003ca id=\"user-content-fruitjam-app\" class=\"anchor\" href=\"https://github.com/mrklingon/Starflight-Traffic/blob/main/README.md#fruitjam-app\"\u003e\u003c/a\u003e\u003c/p\u003e\n\u003cp\u003eCopy these files into a directory on your FruitJam \"apps/StarTraffic\"\u003c/p\u003e\n\u003cul\u003e\n\u003cli\u003ecode.py\u003c/li\u003e\n\u003cli\u003emetadata.json\u003c/li\u003e\n\u003cli\u003estartraffic.bmp (icon)\u003c/li\u003e\n\u003cli\u003estartraffic.py\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp\u003eThen you can navigate on the FruitJam to the icon, click and let the program start.\u003c/p\u003e\n\u003ch3 class=\"heading-element\"\u003eNeoTrinkey\u003c/h3\u003e\n\u003cp\u003e\u003ca id=\"user-content-neotrinkey\" class=\"anchor\" href=\"https://github.com/mrklingon/Starflight-Traffic/blob/main/README.md#neotrinkey\"\u003e\u003c/a\u003e\u003c/p\u003e\n\u003cp\u003eCopy these files to your NeoTrinkey:\u003c/p\u003e\n\u003cul\u003e\n\u003cli\u003eneoStarTraffic.py (rename as code.py)\u003c/li\u003e\n\u003cli\u003encount.py support file for neostartraffic.py [provides blinky lights]\u003c/li\u003e\n\u003cli\u003eprt.py support file for neostartraffic.py [allows redirect of output as if typed]\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp\u003eChange the variable REPL to\u003cspan\u003e\u0026nbsp;\u003c/span\u003e\u003cstrong\u003eTrue\u003c/strong\u003e\u003cspan\u003e\u0026nbsp;\u003c/span\u003eor\u003cspan\u003e\u0026nbsp;\u003c/span\u003e\u003cstrong\u003eFalse\u003c/strong\u003e\u003cspan\u003e\u0026nbsp;\u003c/span\u003edepending on whether you are running the program in a REPL like Mu or Thonny. If not the output will be directed via HID as if typed. If REPL=\u003cstrong\u003eFalse\u003c/strong\u003e\u003cspan\u003e\u0026nbsp;\u003c/span\u003ethe program will wait, blinking red and green till you touch one of the touch pads. This gives you a chance to move the cursor on the computer to where you want the output to show up (eg. in an editor window).\u003c/p\u003e\n\u003cp\u003eTouching the touch pads when the program is running will terminate it.\u003c/p\u003e\n      ","metadata":{}}]