{ "id": "loyA61WU1pQrcxuH", "createdBy": "15sg55Z9lOgM", "dateCreated": 1713192447954, "name": "Lab-Linux: Lua-Programming", "meta": { "logo": "https://raw.githubusercontent.com/edrys-labs/lab-linux/main/media/lua.jpg", "description": "In this engaging Lua programming course, young students will dive into the basics of coding using one of the simplest and most versatile programming languages. They will start by writing a simple \"Hello, World!\" program to learn how to send commands to the computer. As they progress, they will enhance their program to interact with users by accepting inputs. Students will also encounter and learn how to resolve a common programming error, which will help develop their problem-solving skills in coding.", "selfAssign": true, "defaultNumberOfRooms": 0 }, "members": { "teacher": [], "student": [] }, "modules": [ { "url": "https://raw.githubusercontent.com/edrys-labs/module-markdown-it/2.0.0/index.html", "config": "# Welcome to Lab-Linux: Lua-Programming\nLua is a fun and simple programming language that's like a magical notebook. Whatever instructions you write down in it, your computer can understand and follow. It's like telling a story to your computer, and then the computer acts out that story!\n### Why Lua is Great for Young Programmers:\n1. **Easy to Learn**:\n Lua is known for its simplicity.\n Its rules (syntax) are straightforward, making it easier for beginners like you to start writing your own computer programs without getting too bogged down by complicated code.\n\n2. **Lightweight**:\n Lua is very light, which means it doesn't need a lot of computer power to work.\n This makes it perfect for running on all sorts of devices, from large computers to tiny gadgets like game consoles and watches.\n\n3. **Versatile**:\n Even though it's simple, Lua is very powerful.\n Game developers use Lua to make games more interactive.\n It's also used in web applications, image processing, and even robots!\n\n4. **Embedded Use**:\n Lua is often used inside other applications to make them more flexible.\n For instance, if a video game is built in another programming language, Lua can be used to handle things like game logic and character behavior without needing major changes to the game itself.\n\n### Introduction to Lua\nLua was created in Brazil in 1993 by a team of developers who needed a powerful yet simple language for a project they were working on. The name \"Lua\" is a word from Portuguese, meaning \"Moon\", symbolizing its role as a lighter counterpart to the main programming tasks.\nLua is different from many other programming languages because it is an \"embedded\" language. This means that instead of standing alone, it gets embedded into other software programs to help manage things like graphics, user interactions, and other elements that users see and interact with directly.\nBy learning Lua, you won’t just learn how to write code; you’ll learn how to make your computer do things you want, like making up a game or controlling a robot. This makes programming with Lua a fun and exciting challenge that can help you bring your creative ideas to life!\n\n__Visit a station by clicking onto it and then explore the terminal ;-)__", "studentConfig": "", "teacherConfig": "## Welcome for Teachers\n> This can be used as a base laboratory to create further and more elaborate labs with [edrys-Lite](https://edrys-labs.github.io).\n> You are currently in the Lobby. If there is a station available you can switch to it and try out the terminal.\n> Otherwise, if you are in teacher-mode you can share a lab by clicking onto `setting` >> `station` and then by clicking the presented link,\n> which is the same as the current link, but only with the word `station` instead of `classroom`.", "stationConfig": "", "showInCustom": "lobby", "width": "full", "height": "huge" }, { "url": "https://edrys-labs.github.io/module-editor/index.html", "config": { "editorText": "Starting text in editor...", "runCommand": "execute", "language": "cpp", "theme": "light" }, "studentConfig": "", "teacherConfig": "", "stationConfig": "", "showInCustom": "station", "width": "full", "height": "medium" }, { "url": "https://raw.githubusercontent.com/edrys-labs/module-markdown-it/2.0.0/index.html", "config": "# Welcome to the Station\n#### Tutorial Part 1: Your First Lua Program\nLet's kick things off with a very simple program. You'll write a few lines of Lua code that will make the computer display \"Hello, World!\".\n1. **Type or copy the following Lua code into the editor**:\n\n ```lua\n print(\"Hello, World!\")\n ```\n\n2. **Run the program**:\n Hit the run button in your online editor.\n You should see \"Hello, World!\" printed out on the screen.\n Congratulations on running your first piece of Lua code!\n\n#### Tutorial Part 2: Enhance Your Program\nNow, let's make your program interactive by asking for the user's name and then greeting them personally.\n1. **Modify your program**:\n Adjust your existing code to include user input and personalize the greeting.\n Type the following into your online editor:\n\n ```lua\n io.write(\"Enter your name: \")\n name = io.read()\n print(\"Hello, \" .. name .. \"!\")\n ```\n\n2. **Run the program**:\n When you execute this program, it will prompt you to enter your name.\n Type your name into the input box and press enter to see a personalized greeting message.\n\n#### Tutorial Part 3: Introduce an Error\nIt's important to learn how to identify and fix errors in programming. Let's introduce a small mistake and see if you can find and correct it.\n1. **Introduce an error**:\n Modify the `print` function incorrectly:\n\n ```lua\n io.write(\"Enter your name: \")\n name = io.read()\n prnt(\"Hello, \" .. name .. \"!\")\n ```\n\n2. **Run the program and observe the error**:\n This time, the program won't run as expected.\n Instead, you'll see an error message that says something like `attempt to call global 'prnt' (a nil value)`.\n\n3. **Fix the error**:\n The error occurred because `prnt` is not recognized by Lua.\n The correct function is `print`.\n Fix the spelling and run your program again to ensure it works correctly.\n\nThrough these steps, students will not only learn the basic syntax of Lua but also gain experience in debugging, a valuable skill in all areas of programming. This tutorial is designed to make learning programming accessible and fun, encouraging young learners to explore and experiment with code.\n\n ", "studentConfig": "", "teacherConfig": "", "stationConfig": "## Instructions for Station-Sharing \n\nYou are currently responsible for sharing a station of this lab.\nYou have multiple options to share a or your terminal.\nTherefor we use the pyxtermjs - terminal server from:\n\nhttps://github.com/edrys-labs/module-pyxtermjs\n\n### Using Docker\n\nIf you haven't done it so far, install [docker](https://docs.docker.com/engine/install/).\nOr, follow one of the instruction-videos for your system:\n\n<details>\n<summary>Install Docker on Linux</summary> \n<iframe\n style=\"width: 100%; aspect-ratio: 16 / 9\"\n src=\"https://www.youtube.com/embed/cqbh-RneBlk?si=juvUM5d2OSZ28WBv\"\n title=\"YouTube video player\"\n frameborder=\"0\"\n allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\"\n referrerpolicy=\"strict-origin-when-cross-origin\"\n allowfullscreen></iframe>\n</details>\n\n<details>\n<summary>Install Docker on Windows</summary>\n<iframe\n style=\"width: 100%; aspect-ratio: 16 / 9\"\n src=\"https://www.youtube.com/embed/WDEdRmTCSs8?si=X0agStn1akNcZLGu\"\n title=\"YouTube video player\"\n frameborder=\"0\"\n allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\"\n referrerpolicy=\"strict-origin-when-cross-origin\"\n allowfullscreen></iframe>\n</details>\n\n<details>\n<summary>Install Docker on MacOS</summary>\n<iframe\n style=\"width: 100%; aspect-ratio: 16 / 9\"\n src=\"https://www.youtube.com/embed/-EXlfSsP49A?si=OZ_l4_2hDKb6ULQ_\"\n title=\"YouTube video player\"\n frameborder=\"0\"\n allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\"\n referrerpolicy=\"strict-origin-when-cross-origin\"\n allowfullscreen></iframe>\n</details>\n\nThen the only thing that is required is to run the following command:\n\n```bash\ndocker run -it -p 5000:5000 crosslab/edrys_pyxtermjs_development:latest\n```\n\nThis will download the pyxtermjs terminal-server from docker-hub and run it in a secure environment.\nIt contains support for:\n\n- `clojure`\n- `g++`\n- `gcc`\n- `golang`\n- `haskell`\n- `java`\n- `lua`\n- `mono`\n- `nodejs`\n- `python 3`\n- `r`\n- `rustc`\n\n### Using Python\n\nYou can also share your terminal directly via Python, visit the following project\n\nhttps://github.com/edrys-labs/module-pyxtermjs\n\n... the easiest way is to perform the following steps:\n\n``` bash\n# 1. clone the repository or download the folder manually\ngit clone https://github.com/edrys-labs/module-pyxtermjs\n\n# 2. install all required sources\npip3 install -r requirements.txt\n\n# 3. run the terminal-server\npython3 -m pyxtermjs --cors True --command bash --port 5000\n```", "showInCustom": "station", "width": "half", "height": "huge" }, { "url": "https://edrys-labs.github.io/module-pyxtermjs/index.html", "config": "", "studentConfig": "", "teacherConfig": "", "stationConfig": { "server": "http://localhost:5000/pty", "execute": "execute", "script": "echo $CODE | base64 --decode > hello.lua\nlua hello.lua", "enable": { "teacher": true, "student": true } }, "showInCustom": "station", "width": "full", "height": "medium" } ] }