make a website that teaches LUA from beginer to advanced - Initial Deployment
Browse files- README.md +6 -4
- index.html +1175 -19
README.md
CHANGED
|
@@ -1,10 +1,12 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
-
emoji:
|
| 4 |
colorFrom: pink
|
| 5 |
-
colorTo:
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
|
|
|
|
|
|
| 8 |
---
|
| 9 |
|
| 10 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
| 1 |
---
|
| 2 |
+
title: learn-lua
|
| 3 |
+
emoji: 🐳
|
| 4 |
colorFrom: pink
|
| 5 |
+
colorTo: green
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
| 8 |
+
tags:
|
| 9 |
+
- deepsite
|
| 10 |
---
|
| 11 |
|
| 12 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
index.html
CHANGED
|
@@ -1,19 +1,1175 @@
|
|
| 1 |
-
<!
|
| 2 |
-
<html>
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>Lua Mastery - Learn Lua Programming</title>
|
| 7 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 8 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
| 9 |
+
<style>
|
| 10 |
+
.code-block {
|
| 11 |
+
background-color: #2d2d2d;
|
| 12 |
+
color: #f8f8f2;
|
| 13 |
+
border-radius: 0.5rem;
|
| 14 |
+
padding: 1rem;
|
| 15 |
+
font-family: 'Courier New', monospace;
|
| 16 |
+
overflow-x: auto;
|
| 17 |
+
}
|
| 18 |
+
.keyword { color: #f92672; }
|
| 19 |
+
.string { color: #e6db74; }
|
| 20 |
+
.comment { color: #75715e; }
|
| 21 |
+
.number { color: #ae81ff; }
|
| 22 |
+
.function { color: #66d9ef; }
|
| 23 |
+
.hljs-built_in { color: #a6e22e; }
|
| 24 |
+
|
| 25 |
+
.nav-link:hover {
|
| 26 |
+
background-color: rgba(255, 255, 255, 0.1);
|
| 27 |
+
}
|
| 28 |
+
|
| 29 |
+
.lesson-card:hover {
|
| 30 |
+
transform: translateY(-5px);
|
| 31 |
+
box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
|
| 32 |
+
}
|
| 33 |
+
|
| 34 |
+
.syntax-highlight {
|
| 35 |
+
background-color: rgba(255, 255, 255, 0.05);
|
| 36 |
+
padding: 0.2rem 0.4rem;
|
| 37 |
+
border-radius: 0.25rem;
|
| 38 |
+
font-family: 'Courier New', monospace;
|
| 39 |
+
}
|
| 40 |
+
</style>
|
| 41 |
+
</head>
|
| 42 |
+
<body class="bg-gray-900 text-gray-100 min-h-screen">
|
| 43 |
+
<!-- Navigation -->
|
| 44 |
+
<nav class="bg-gray-800 shadow-lg">
|
| 45 |
+
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
|
| 46 |
+
<div class="flex items-center justify-between h-16">
|
| 47 |
+
<div class="flex items-center">
|
| 48 |
+
<div class="flex-shrink-0">
|
| 49 |
+
<span class="text-green-400 font-bold text-xl">Lua Mastery</span>
|
| 50 |
+
</div>
|
| 51 |
+
<div class="hidden md:block">
|
| 52 |
+
<div class="ml-10 flex items-baseline space-x-4">
|
| 53 |
+
<a href="#home" class="nav-link px-3 py-2 rounded-md text-sm font-medium text-white bg-gray-900">Home</a>
|
| 54 |
+
<a href="#tutorials" class="nav-link px-3 py-2 rounded-md text-sm font-medium text-gray-300 hover:text-white hover:bg-gray-700">Tutorials</a>
|
| 55 |
+
<a href="#examples" class="nav-link px-3 py-2 rounded-md text-sm font-medium text-gray-300 hover:text-white hover:bg-gray-700">Examples</a>
|
| 56 |
+
<a href="#resources" class="nav-link px-3 py-2 rounded-md text-sm font-medium text-gray-300 hover:text-white hover:bg-gray-700">Resources</a>
|
| 57 |
+
<a href="#community" class="nav-link px-3 py-2 rounded-md text-sm font-medium text-gray-300 hover:text-white hover:bg-gray-700">Community</a>
|
| 58 |
+
</div>
|
| 59 |
+
</div>
|
| 60 |
+
</div>
|
| 61 |
+
<div class="hidden md:block">
|
| 62 |
+
<div class="ml-4 flex items-center md:ml-6">
|
| 63 |
+
<button class="bg-green-600 hover:bg-green-700 text-white px-4 py-2 rounded-md text-sm font-medium">
|
| 64 |
+
Try Lua Online
|
| 65 |
+
</button>
|
| 66 |
+
</div>
|
| 67 |
+
</div>
|
| 68 |
+
<div class="-mr-2 flex md:hidden">
|
| 69 |
+
<button type="button" class="mobile-menu-button bg-gray-800 inline-flex items-center justify-center p-2 rounded-md text-gray-400 hover:text-white hover:bg-gray-700 focus:outline-none">
|
| 70 |
+
<i class="fas fa-bars"></i>
|
| 71 |
+
</button>
|
| 72 |
+
</div>
|
| 73 |
+
</div>
|
| 74 |
+
</div>
|
| 75 |
+
|
| 76 |
+
<!-- Mobile menu -->
|
| 77 |
+
<div class="mobile-menu hidden md:hidden">
|
| 78 |
+
<div class="px-2 pt-2 pb-3 space-y-1 sm:px-3">
|
| 79 |
+
<a href="#home" class="block px-3 py-2 rounded-md text-base font-medium text-white bg-gray-900">Home</a>
|
| 80 |
+
<a href="#tutorials" class="block px-3 py-2 rounded-md text-base font-medium text-gray-300 hover:text-white hover:bg-gray-700">Tutorials</a>
|
| 81 |
+
<a href="#examples" class="block px-3 py-2 rounded-md text-base font-medium text-gray-300 hover:text-white hover:bg-gray-700">Examples</a>
|
| 82 |
+
<a href="#resources" class="block px-3 py-2 rounded-md text-base font-medium text-gray-300 hover:text-white hover:bg-gray-700">Resources</a>
|
| 83 |
+
<a href="#community" class="block px-3 py-2 rounded-md text-base font-medium text-gray-300 hover:text-white hover:bg-gray-700">Community</a>
|
| 84 |
+
<button class="block w-full text-left px-3 py-2 rounded-md text-base font-medium text-gray-300 hover:text-white hover:bg-gray-700">
|
| 85 |
+
Try Lua Online
|
| 86 |
+
</button>
|
| 87 |
+
</div>
|
| 88 |
+
</div>
|
| 89 |
+
</nav>
|
| 90 |
+
|
| 91 |
+
<!-- Hero Section -->
|
| 92 |
+
<section id="home" class="bg-gradient-to-r from-gray-800 to-gray-900 py-20">
|
| 93 |
+
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
|
| 94 |
+
<div class="lg:flex lg:items-center lg:justify-between">
|
| 95 |
+
<div class="lg:w-1/2">
|
| 96 |
+
<h1 class="text-4xl font-extrabold tracking-tight text-white sm:text-5xl lg:text-6xl">
|
| 97 |
+
Learn <span class="text-green-400">Lua</span> from Scratch
|
| 98 |
+
</h1>
|
| 99 |
+
<p class="mt-5 text-xl text-gray-300">
|
| 100 |
+
Master the powerful, efficient, and embeddable scripting language used in games like World of Warcraft, Roblox, and more.
|
| 101 |
+
</p>
|
| 102 |
+
<div class="mt-8 flex flex-col sm:flex-row gap-4">
|
| 103 |
+
<a href="#getting-started" class="bg-green-600 hover:bg-green-700 text-white px-8 py-3 rounded-md text-lg font-medium">
|
| 104 |
+
Start Learning
|
| 105 |
+
</a>
|
| 106 |
+
<a href="#why-lua" class="bg-gray-700 hover:bg-gray-600 text-white px-8 py-3 rounded-md text-lg font-medium">
|
| 107 |
+
Why Learn Lua?
|
| 108 |
+
</a>
|
| 109 |
+
</div>
|
| 110 |
+
</div>
|
| 111 |
+
<div class="mt-10 lg:mt-0 lg:w-1/2">
|
| 112 |
+
<div class="code-block">
|
| 113 |
+
<pre><code><span class="comment">-- Simple Lua example</span>
|
| 114 |
+
<span class="keyword">function</span> <span class="function">greet</span>(name)
|
| 115 |
+
<span class="keyword">return</span> <span class="string">"Hello, "</span> .. name .. <span class="string">"!"</span>
|
| 116 |
+
<span class="keyword">end</span>
|
| 117 |
+
|
| 118 |
+
<span class="comment">-- Table with metatable example</span>
|
| 119 |
+
<span class="keyword">local</span> person = {
|
| 120 |
+
name = <span class="string">"Lua Learner"</span>,
|
| 121 |
+
age = <span class="number">25</span>
|
| 122 |
+
}
|
| 123 |
+
|
| 124 |
+
<span class="keyword">local</span> mt = {
|
| 125 |
+
__tostring = <span class="keyword">function</span>(self)
|
| 126 |
+
<span class="keyword">return</span> self.name .. <span class="string">", age "</span> .. self.age
|
| 127 |
+
<span class="keyword">end</span>
|
| 128 |
+
}
|
| 129 |
+
|
| 130 |
+
setmetatable(person, mt)
|
| 131 |
+
|
| 132 |
+
<span class="hljs-built_in">print</span>(greet(person.name)) <span class="comment">-- Hello, Lua Learner!</span>
|
| 133 |
+
<span class="hljs-built_in">print</span>(person) <span class="comment">-- Lua Learner, age 25</span></code></pre>
|
| 134 |
+
</div>
|
| 135 |
+
</div>
|
| 136 |
+
</div>
|
| 137 |
+
</div>
|
| 138 |
+
</section>
|
| 139 |
+
|
| 140 |
+
<!-- Why Learn Lua Section -->
|
| 141 |
+
<section id="why-lua" class="py-16 bg-gray-800">
|
| 142 |
+
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
|
| 143 |
+
<h2 class="text-3xl font-extrabold text-white text-center mb-12">
|
| 144 |
+
Why Learn <span class="text-green-400">Lua</span>?
|
| 145 |
+
</h2>
|
| 146 |
+
<div class="grid grid-cols-1 md:grid-cols-3 gap-8">
|
| 147 |
+
<div class="bg-gray-700 p-6 rounded-lg shadow-lg">
|
| 148 |
+
<div class="text-green-400 text-4xl mb-4">
|
| 149 |
+
<i class="fas fa-gamepad"></i>
|
| 150 |
+
</div>
|
| 151 |
+
<h3 class="text-xl font-bold text-white mb-2">Game Development</h3>
|
| 152 |
+
<p class="text-gray-300">
|
| 153 |
+
Lua is widely used in game development (World of Warcraft, Roblox, Garry's Mod) for scripting game logic and modding.
|
| 154 |
+
</p>
|
| 155 |
+
</div>
|
| 156 |
+
<div class="bg-gray-700 p-6 rounded-lg shadow-lg">
|
| 157 |
+
<div class="text-green-400 text-4xl mb-4">
|
| 158 |
+
<i class="fas fa-bolt"></i>
|
| 159 |
+
</div>
|
| 160 |
+
<h3 class="text-xl font-bold text-white mb-2">Lightweight & Fast</h3>
|
| 161 |
+
<p class="text-gray-300">
|
| 162 |
+
Lua is designed to be lightweight and efficient, making it perfect for embedded systems and performance-critical applications.
|
| 163 |
+
</p>
|
| 164 |
+
</div>
|
| 165 |
+
<div class="bg-gray-700 p-6 rounded-lg shadow-lg">
|
| 166 |
+
<div class="text-green-400 text-4xl mb-4">
|
| 167 |
+
<i class="fas fa-puzzle-piece"></i>
|
| 168 |
+
</div>
|
| 169 |
+
<h3 class="text-xl font-bold text-white mb-2">Easy to Embed</h3>
|
| 170 |
+
<p class="text-gray-300">
|
| 171 |
+
Lua's C API makes it simple to integrate with existing applications, which is why it's used in software like Redis, Nginx, and Wireshark.
|
| 172 |
+
</p>
|
| 173 |
+
</div>
|
| 174 |
+
</div>
|
| 175 |
+
</div>
|
| 176 |
+
</section>
|
| 177 |
+
|
| 178 |
+
<!-- Getting Started Section -->
|
| 179 |
+
<section id="getting-started" class="py-16 bg-gray-900">
|
| 180 |
+
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
|
| 181 |
+
<h2 class="text-3xl font-extrabold text-white text-center mb-12">
|
| 182 |
+
Getting Started with <span class="text-green-400">Lua</span>
|
| 183 |
+
</h2>
|
| 184 |
+
|
| 185 |
+
<div class="bg-gray-800 rounded-lg p-6 mb-8">
|
| 186 |
+
<h3 class="text-2xl font-bold text-white mb-4">Installation</h3>
|
| 187 |
+
<p class="text-gray-300 mb-4">To start coding in Lua, you'll need to install the Lua interpreter:</p>
|
| 188 |
+
|
| 189 |
+
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
|
| 190 |
+
<div>
|
| 191 |
+
<h4 class="text-lg font-semibold text-white mb-2">Windows</h4>
|
| 192 |
+
<div class="code-block">
|
| 193 |
+
<pre><code><span class="comment"># Using Chocolatey (recommended)</span>
|
| 194 |
+
choco install lua
|
| 195 |
+
|
| 196 |
+
<span class="comment"># Or download from lua.org</span></code></pre>
|
| 197 |
+
</div>
|
| 198 |
+
</div>
|
| 199 |
+
<div>
|
| 200 |
+
<h4 class="text-lg font-semibold text-white mb-2">MacOS/Linux</h4>
|
| 201 |
+
<div class="code-block">
|
| 202 |
+
<pre><code><span class="comment"># MacOS using Homebrew</span>
|
| 203 |
+
brew install lua
|
| 204 |
+
|
| 205 |
+
<span class="comment"># Linux (Debian/Ubuntu)</span>
|
| 206 |
+
sudo apt-get install lua5.3</code></pre>
|
| 207 |
+
</div>
|
| 208 |
+
</div>
|
| 209 |
+
</div>
|
| 210 |
+
|
| 211 |
+
<div class="mt-6">
|
| 212 |
+
<h4 class="text-lg font-semibold text-white mb-2">Verify Installation</h4>
|
| 213 |
+
<div class="code-block">
|
| 214 |
+
<pre><code>lua -v
|
| 215 |
+
<span class="comment"># Should output something like: Lua 5.4.3</span></code></pre>
|
| 216 |
+
</div>
|
| 217 |
+
</div>
|
| 218 |
+
</div>
|
| 219 |
+
|
| 220 |
+
<div class="bg-gray-800 rounded-lg p-6">
|
| 221 |
+
<h3 class="text-2xl font-bold text-white mb-4">Your First Lua Script</h3>
|
| 222 |
+
<p class="text-gray-300 mb-4">Create a file named <span class="syntax-highlight">hello.lua</span> with the following content:</p>
|
| 223 |
+
|
| 224 |
+
<div class="code-block mb-6">
|
| 225 |
+
<pre><code><span class="comment">-- This is a comment in Lua</span>
|
| 226 |
+
<span class="hljs-built_in">print</span>(<span class="string">"Hello, Lua World!"</span>)
|
| 227 |
+
|
| 228 |
+
<span class="comment">-- Variables</span>
|
| 229 |
+
<span class="keyword">local</span> name = <span class="string">"Lua Learner"</span>
|
| 230 |
+
<span class="keyword">local</span> age = <span class="number">25</span>
|
| 231 |
+
|
| 232 |
+
<span class="hljs-built_in">print</span>(<span class="string">"Name:"</span>, name)
|
| 233 |
+
<span class="hljs-built_in">print</span>(<span class="string">"Age:"</span>, age)</code></pre>
|
| 234 |
+
</div>
|
| 235 |
+
|
| 236 |
+
<p class="text-gray-300 mb-4">Run your script with:</p>
|
| 237 |
+
<div class="code-block mb-6">
|
| 238 |
+
<pre><code>lua hello.lua</code></pre>
|
| 239 |
+
</div>
|
| 240 |
+
|
| 241 |
+
<p class="text-gray-300">Congratulations! You've written and executed your first Lua program.</p>
|
| 242 |
+
</div>
|
| 243 |
+
</div>
|
| 244 |
+
</section>
|
| 245 |
+
|
| 246 |
+
<!-- Tutorials Section -->
|
| 247 |
+
<section id="tutorials" class="py-16 bg-gray-800">
|
| 248 |
+
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
|
| 249 |
+
<h2 class="text-3xl font-extrabold text-white text-center mb-12">
|
| 250 |
+
Lua <span class="text-green-400">Tutorials</span>
|
| 251 |
+
</h2>
|
| 252 |
+
|
| 253 |
+
<div class="grid grid-cols-1 md:grid-cols-3 gap-8">
|
| 254 |
+
<!-- Beginner Card -->
|
| 255 |
+
<div class="lesson-card bg-gray-700 rounded-lg overflow-hidden shadow-lg transition duration-300">
|
| 256 |
+
<div class="bg-green-600 p-4">
|
| 257 |
+
<h3 class="text-xl font-bold text-white text-center">Beginner</h3>
|
| 258 |
+
</div>
|
| 259 |
+
<div class="p-6">
|
| 260 |
+
<ul class="space-y-3">
|
| 261 |
+
<li class="flex items-start">
|
| 262 |
+
<i class="fas fa-check text-green-400 mt-1 mr-2"></i>
|
| 263 |
+
<span>Variables & Data Types</span>
|
| 264 |
+
</li>
|
| 265 |
+
<li class="flex items-start">
|
| 266 |
+
<i class="fas fa-check text-green-400 mt-1 mr-2"></i>
|
| 267 |
+
<span>Control Structures</span>
|
| 268 |
+
</li>
|
| 269 |
+
<li class="flex items-start">
|
| 270 |
+
<i class="fas fa-check text-green-400 mt-1 mr-2"></i>
|
| 271 |
+
<span>Functions & Scope</span>
|
| 272 |
+
</li>
|
| 273 |
+
<li class="flex items-start">
|
| 274 |
+
<i class="fas fa-check text-green-400 mt-1 mr-2"></i>
|
| 275 |
+
<span>Basic Tables</span>
|
| 276 |
+
</li>
|
| 277 |
+
<li class="flex items-start">
|
| 278 |
+
<i class="fas fa-check text-green-400 mt-1 mr-2"></i>
|
| 279 |
+
<span>Standard Libraries</span>
|
| 280 |
+
</li>
|
| 281 |
+
</ul>
|
| 282 |
+
<a href="#beginner-lessons" class="mt-6 inline-block bg-green-600 hover:bg-green-700 text-white px-6 py-2 rounded-md font-medium">
|
| 283 |
+
Start Learning
|
| 284 |
+
</a>
|
| 285 |
+
</div>
|
| 286 |
+
</div>
|
| 287 |
+
|
| 288 |
+
<!-- Intermediate Card -->
|
| 289 |
+
<div class="lesson-card bg-gray-700 rounded-lg overflow-hidden shadow-lg transition duration-300">
|
| 290 |
+
<div class="bg-blue-500 p-4">
|
| 291 |
+
<h3 class="text-xl font-bold text-white text-center">Intermediate</h3>
|
| 292 |
+
</div>
|
| 293 |
+
<div class="p-6">
|
| 294 |
+
<ul class="space-y-3">
|
| 295 |
+
<li class="flex items-start">
|
| 296 |
+
<i class="fas fa-check text-blue-400 mt-1 mr-2"></i>
|
| 297 |
+
<span>Advanced Table Usage</span>
|
| 298 |
+
</li>
|
| 299 |
+
<li class="flex items-start">
|
| 300 |
+
<i class="fas fa-check text-blue-400 mt-1 mr-2"></i>
|
| 301 |
+
<span>Metatables & Metamethods</span>
|
| 302 |
+
</li>
|
| 303 |
+
<li class="flex items-start">
|
| 304 |
+
<i class="fas fa-check text-blue-400 mt-1 mr-2"></i>
|
| 305 |
+
<span>Coroutines</span>
|
| 306 |
+
</li>
|
| 307 |
+
<li class="flex items-start">
|
| 308 |
+
<i class="fas fa-check text-blue-400 mt-1 mr-2"></i>
|
| 309 |
+
<span>Error Handling</span>
|
| 310 |
+
</li>
|
| 311 |
+
<li class="flex items-start">
|
| 312 |
+
<i class="fas fa-check text-blue-400 mt-1 mr-2"></i>
|
| 313 |
+
<span>Modules & Packages</span>
|
| 314 |
+
</li>
|
| 315 |
+
</ul>
|
| 316 |
+
<a href="#intermediate-lessons" class="mt-6 inline-block bg-blue-500 hover:bg-blue-600 text-white px-6 py-2 rounded-md font-medium">
|
| 317 |
+
Continue Learning
|
| 318 |
+
</a>
|
| 319 |
+
</div>
|
| 320 |
+
</div>
|
| 321 |
+
|
| 322 |
+
<!-- Advanced Card -->
|
| 323 |
+
<div class="lesson-card bg-gray-700 rounded-lg overflow-hidden shadow-lg transition duration-300">
|
| 324 |
+
<div class="bg-purple-600 p-4">
|
| 325 |
+
<h3 class="text-xl font-bold text-white text-center">Advanced</h3>
|
| 326 |
+
</div>
|
| 327 |
+
<div class="p-6">
|
| 328 |
+
<ul class="space-y-3">
|
| 329 |
+
<li class="flex items-start">
|
| 330 |
+
<i class="fas fa-check text-purple-400 mt-1 mr-2"></i>
|
| 331 |
+
<span>Lua C API</span>
|
| 332 |
+
</li>
|
| 333 |
+
<li class="flex items-start">
|
| 334 |
+
<i class="fas fa-check text-purple-400 mt-1 mr-2"></i>
|
| 335 |
+
<span>Embedding Lua</span>
|
| 336 |
+
</li>
|
| 337 |
+
<li class="flex items-start">
|
| 338 |
+
<i class="fas fa-check text-purple-400 mt-1 mr-2"></i>
|
| 339 |
+
<span>Performance Optimization</span>
|
| 340 |
+
</li>
|
| 341 |
+
<li class="flex items-start">
|
| 342 |
+
<i class="fas fa-check text-purple-400 mt-1 mr-2"></i>
|
| 343 |
+
<span>Garbage Collection</span>
|
| 344 |
+
</li>
|
| 345 |
+
<li class="flex items-start">
|
| 346 |
+
<i class="fas fa-check text-purple-400 mt-1 mr-2"></i>
|
| 347 |
+
<span>Creating DSLs</span>
|
| 348 |
+
</li>
|
| 349 |
+
</ul>
|
| 350 |
+
<a href="#advanced-lessons" class="mt-6 inline-block bg-purple-600 hover:bg-purple-700 text-white px-6 py-2 rounded-md font-medium">
|
| 351 |
+
Master Lua
|
| 352 |
+
</a>
|
| 353 |
+
</div>
|
| 354 |
+
</div>
|
| 355 |
+
</div>
|
| 356 |
+
</div>
|
| 357 |
+
</section>
|
| 358 |
+
|
| 359 |
+
<!-- Beginner Lessons -->
|
| 360 |
+
<section id="beginner-lessons" class="py-16 bg-gray-900">
|
| 361 |
+
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
|
| 362 |
+
<h2 class="text-3xl font-extrabold text-white mb-8">
|
| 363 |
+
<span class="text-green-400">Beginner</span> Lua Tutorials
|
| 364 |
+
</h2>
|
| 365 |
+
|
| 366 |
+
<div class="space-y-8">
|
| 367 |
+
<!-- Lesson 1 -->
|
| 368 |
+
<div class="bg-gray-800 rounded-lg overflow-hidden">
|
| 369 |
+
<div class="p-6">
|
| 370 |
+
<h3 class="text-2xl font-bold text-white mb-4">1. Variables and Data Types</h3>
|
| 371 |
+
<p class="text-gray-300 mb-4">Lua is a dynamically typed language with basic types: nil, boolean, number, string, function, userdata, thread, and table.</p>
|
| 372 |
+
|
| 373 |
+
<div class="code-block mb-6">
|
| 374 |
+
<pre><code><span class="comment">-- Variable declaration</span>
|
| 375 |
+
<span class="keyword">local</span> name = <span class="string">"Lua"</span> <span class="comment">-- string</span>
|
| 376 |
+
<span class="keyword">local</span> version = <span class="number">5.4</span> <span class="comment">-- number</span>
|
| 377 |
+
<span class="keyword">local</span> isAwesome = <span class="keyword">true</span> <span class="comment">-- boolean</span>
|
| 378 |
+
<span class="keyword">local</span> nothing = <span class="keyword">nil</span> <span class="comment">-- nil</span>
|
| 379 |
+
|
| 380 |
+
<span class="comment">-- Multiple assignment</span>
|
| 381 |
+
<span class="keyword">local</span> a, b, c = <span class="number">1</span>, <span class="number">2</span>, <span class="string">"three"</span>
|
| 382 |
+
|
| 383 |
+
<span class="comment">-- Type checking</span>
|
| 384 |
+
<span class="hljs-built_in">print</span>(<span class="hljs-built_in">type</span>(name)) <span class="comment">-- "string"</span>
|
| 385 |
+
<span class="hljs-built_in">print</span>(<span class="hljs-built_in">type</span>(version)) <span class="comment">-- "number"</span>
|
| 386 |
+
<span class="hljs-built_in">print</span>(<span class="hljs-built_in">type</span>(nothing)) <span class="comment">-- "nil"</span></code></pre>
|
| 387 |
+
</div>
|
| 388 |
+
|
| 389 |
+
<div class="bg-gray-700 p-4 rounded-lg">
|
| 390 |
+
<h4 class="text-lg font-semibold text-white mb-2">Key Points:</h4>
|
| 391 |
+
<ul class="list-disc list-inside text-gray-300 space-y-1">
|
| 392 |
+
<li>Always use <span class="syntax-highlight">local</span> to declare variables to avoid global scope</li>
|
| 393 |
+
<li>Lua automatically converts between numbers and strings in many contexts</li>
|
| 394 |
+
<li><span class="syntax-highlight">nil</span> represents the absence of a value</li>
|
| 395 |
+
</ul>
|
| 396 |
+
</div>
|
| 397 |
+
</div>
|
| 398 |
+
</div>
|
| 399 |
+
|
| 400 |
+
<!-- Lesson 2 -->
|
| 401 |
+
<div class="bg-gray-800 rounded-lg overflow-hidden">
|
| 402 |
+
<div class="p-6">
|
| 403 |
+
<h3 class="text-2xl font-bold text-white mb-4">2. Control Structures</h3>
|
| 404 |
+
<p class="text-gray-300 mb-4">Lua provides standard control structures with a simple syntax.</p>
|
| 405 |
+
|
| 406 |
+
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
|
| 407 |
+
<div>
|
| 408 |
+
<h4 class="text-lg font-semibold text-white mb-2">If-Else</h4>
|
| 409 |
+
<div class="code-block">
|
| 410 |
+
<pre><code><span class="keyword">local</span> age = <span class="number">18</span>
|
| 411 |
+
|
| 412 |
+
<span class="keyword">if</span> age < <span class="number">13</span> <span class="keyword">then</span>
|
| 413 |
+
<span class="hljs-built_in">print</span>(<span class="string">"Child"</span>)
|
| 414 |
+
<span class="keyword">elseif</span> age < <span class="number">18</span> <span class="keyword">then</span>
|
| 415 |
+
<span class="hljs-built_in">print</span>(<span class="string">"Teenager"</span>)
|
| 416 |
+
<span class="keyword">else</span>
|
| 417 |
+
<span class="hljs-built_in">print</span>(<span class="string">"Adult"</span>)
|
| 418 |
+
<span class="keyword">end</span></code></pre>
|
| 419 |
+
</div>
|
| 420 |
+
</div>
|
| 421 |
+
<div>
|
| 422 |
+
<h4 class="text-lg font-semibold text-white mb-2">Loops</h4>
|
| 423 |
+
<div class="code-block">
|
| 424 |
+
<pre><code><span class="comment">-- While loop</span>
|
| 425 |
+
<span class="keyword">local</span> i = <span class="number">1</span>
|
| 426 |
+
<span class="keyword">while</span> i <= <span class="number">5</span> <span class="keyword">do</span>
|
| 427 |
+
<span class="hljs-built_in">print</span>(i)
|
| 428 |
+
i = i + <span class="number">1</span>
|
| 429 |
+
<span class="keyword">end</span>
|
| 430 |
+
|
| 431 |
+
<span class="comment">-- For loop</span>
|
| 432 |
+
<span class="keyword">for</span> j = <span class="number">1</span>, <span class="number">5</span> <span class="keyword">do</span>
|
| 433 |
+
<span class="hljs-built_in">print</span>(j)
|
| 434 |
+
<span class="keyword">end</span></code></pre>
|
| 435 |
+
</div>
|
| 436 |
+
</div>
|
| 437 |
+
</div>
|
| 438 |
+
</div>
|
| 439 |
+
</div>
|
| 440 |
+
|
| 441 |
+
<!-- Lesson 3 -->
|
| 442 |
+
<div class="bg-gray-800 rounded-lg overflow-hidden">
|
| 443 |
+
<div class="p-6">
|
| 444 |
+
<h3 class="text-2xl font-bold text-white mb-4">3. Functions</h3>
|
| 445 |
+
<p class="text-gray-300 mb-4">Functions are first-class citizens in Lua and can be assigned to variables, passed as arguments, and returned from other functions.</p>
|
| 446 |
+
|
| 447 |
+
<div class="code-block mb-6">
|
| 448 |
+
<pre><code><span class="comment">-- Basic function</span>
|
| 449 |
+
<span class="keyword">function</span> <span class="function">greet</span>(name)
|
| 450 |
+
<span class="keyword">return</span> <span class="string">"Hello, "</span> .. name
|
| 451 |
+
<span class="keyword">end</span>
|
| 452 |
+
|
| 453 |
+
<span class="hljs-built_in">print</span>(greet(<span class="string">"Lua"</span>)) <span class="comment">-- Hello, Lua</span>
|
| 454 |
+
|
| 455 |
+
<span class="comment">-- Function as variable</span>
|
| 456 |
+
<span class="keyword">local</span> add = <span class="keyword">function</span>(a, b)
|
| 457 |
+
<span class="keyword">return</span> a + b
|
| 458 |
+
<span class="keyword">end</span>
|
| 459 |
+
|
| 460 |
+
<span class="hljs-built_in">print</span>(add(<span class="number">2</span>, <span class="number">3</span>)) <span class="comment">-- 5</span>
|
| 461 |
+
|
| 462 |
+
<span class="comment">-- Variable number of arguments</span>
|
| 463 |
+
<span class="keyword">function</span> <span class="function">sum</span>(...)
|
| 464 |
+
<span class="keyword">local</span> total = <span class="number">0</span>
|
| 465 |
+
<span class="keyword">for</span> i, num <span class="keyword">in</span> <span class="hljs-built_in">ipairs</span>({...}) <span class="keyword">do</span>
|
| 466 |
+
total = total + num
|
| 467 |
+
<span class="keyword">end</span>
|
| 468 |
+
<span class="keyword">return</span> total
|
| 469 |
+
<span class="keyword">end</span>
|
| 470 |
+
|
| 471 |
+
<span class="hljs-built_in">print</span>(sum(<span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>, <span class="number">4</span>)) <span class="comment">-- 10</span></code></pre>
|
| 472 |
+
</div>
|
| 473 |
+
</div>
|
| 474 |
+
</div>
|
| 475 |
+
</div>
|
| 476 |
+
|
| 477 |
+
<div class="mt-8 text-center">
|
| 478 |
+
<a href="#intermediate-lessons" class="inline-block bg-green-600 hover:bg-green-700 text-white px-8 py-3 rounded-md text-lg font-medium">
|
| 479 |
+
Continue to Intermediate Lessons →
|
| 480 |
+
</a>
|
| 481 |
+
</div>
|
| 482 |
+
</div>
|
| 483 |
+
</section>
|
| 484 |
+
|
| 485 |
+
<!-- Intermediate Lessons -->
|
| 486 |
+
<section id="intermediate-lessons" class="py-16 bg-gray-800">
|
| 487 |
+
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
|
| 488 |
+
<h2 class="text-3xl font-extrabold text-white mb-8">
|
| 489 |
+
<span class="text-blue-400">Intermediate</span> Lua Tutorials
|
| 490 |
+
</h2>
|
| 491 |
+
|
| 492 |
+
<div class="space-y-8">
|
| 493 |
+
<!-- Lesson 1 -->
|
| 494 |
+
<div class="bg-gray-700 rounded-lg overflow-hidden">
|
| 495 |
+
<div class="p-6">
|
| 496 |
+
<h3 class="text-2xl font-bold text-white mb-4">1. Tables - Lua's Only Data Structure</h3>
|
| 497 |
+
<p class="text-gray-300 mb-4">Tables in Lua are associative arrays that can be used as arrays, dictionaries, objects, and more.</p>
|
| 498 |
+
|
| 499 |
+
<div class="code-block mb-6">
|
| 500 |
+
<pre><code><span class="comment">-- Array-like table</span>
|
| 501 |
+
<span class="keyword">local</span> fruits = {<span class="string">"apple"</span>, <span class="string">"banana"</span>, <span class="string">"cherry"</span>}
|
| 502 |
+
<span class="hljs-built_in">print</span>(fruits[<span class="number">1</span>]) <span class="comment">-- "apple" (Lua arrays are 1-indexed)</span>
|
| 503 |
+
|
| 504 |
+
<span class="comment">-- Dictionary-like table</span>
|
| 505 |
+
<span class="keyword">local</span> person = {
|
| 506 |
+
name = <span class="string">"Alice"</span>,
|
| 507 |
+
age = <span class="number">30</span>,
|
| 508 |
+
profession = <span class="string">"Developer"</span>
|
| 509 |
+
}
|
| 510 |
+
|
| 511 |
+
<span class="hljs-built_in">print</span>(person.name) <span class="comment">-- "Alice"</span>
|
| 512 |
+
<span class="hljs-built_in">print</span>(person[<span class="string">"age"</span>]) <span class="comment">-- 30</span>
|
| 513 |
+
|
| 514 |
+
<span class="comment">-- Mixed table</span>
|
| 515 |
+
<span class="keyword">local</span> mixed = {
|
| 516 |
+
<span class="string">"first"</span>, <span class="comment">-- index 1</span>
|
| 517 |
+
<span class="string">"second"</span>, <span class="comment">-- index 2</span>
|
| 518 |
+
name = <span class="string">"Lua"</span>,
|
| 519 |
+
version = <span class="number">5.4</span>
|
| 520 |
+
}
|
| 521 |
+
|
| 522 |
+
<span class="comment">-- Iterating through tables</span>
|
| 523 |
+
<span class="keyword">for</span> k, v <span class="keyword">in</span> <span class="hljs-built_in">pairs</span>(person) <span class="keyword">do</span>
|
| 524 |
+
<span class="hljs-built_in">print</span>(k, v)
|
| 525 |
+
<span class="keyword">end</span></code></pre>
|
| 526 |
+
</div>
|
| 527 |
+
</div>
|
| 528 |
+
</div>
|
| 529 |
+
|
| 530 |
+
<!-- Lesson 2 -->
|
| 531 |
+
<div class="bg-gray-700 rounded-lg overflow-hidden">
|
| 532 |
+
<div class="p-6">
|
| 533 |
+
<h3 class="text-2xl font-bold text-white mb-4">2. Metatables and Metamethods</h3>
|
| 534 |
+
<p class="text-gray-300 mb-4">Metatables allow you to define the behavior of tables under specific operations, enabling operator overloading and more.</p>
|
| 535 |
+
|
| 536 |
+
<div class="code-block mb-6">
|
| 537 |
+
<pre><code><span class="comment">-- Vector addition example</span>
|
| 538 |
+
<span class="keyword">local</span> Vector = {}
|
| 539 |
+
Vector.__index = Vector
|
| 540 |
+
|
| 541 |
+
<span class="keyword">function</span> <span class="function">Vector.new</span>(x, y)
|
| 542 |
+
<span class="keyword">return</span> <span class="hljs-built_in">setmetatable</span>({x = x, y = y}, Vector)
|
| 543 |
+
<span class="keyword">end</span>
|
| 544 |
+
|
| 545 |
+
<span class="comment">-- Define addition for vectors</span>
|
| 546 |
+
<span class="keyword">function</span> Vector.__add(a, b)
|
| 547 |
+
<span class="keyword">return</span> Vector.new(a.x + b.x, a.y + b.y)
|
| 548 |
+
<span class="keyword">end</span>
|
| 549 |
+
|
| 550 |
+
<span class="comment">-- Define string representation</span>
|
| 551 |
+
<span class="keyword">function</span> Vector.__tostring(v)
|
| 552 |
+
<span class="keyword">return</span> <span class="string">"Vector("</span> .. v.x .. <span class="string">", "</span> .. v.y .. <span class="string">")"</span>
|
| 553 |
+
<span class="keyword">end</span>
|
| 554 |
+
|
| 555 |
+
<span class="keyword">local</span> v1 = Vector.new(<span class="number">1</span>, <span class="number">2</span>)
|
| 556 |
+
<span class="keyword">local</span> v2 = Vector.new(<span class="number">3</span>, <span class="number">4</span>)
|
| 557 |
+
<span class="keyword">local</span> v3 = v1 + v2
|
| 558 |
+
|
| 559 |
+
<span class="hljs-built_in">print</span>(v3) <span class="comment">-- Vector(4, 6)</span></code></pre>
|
| 560 |
+
</div>
|
| 561 |
+
|
| 562 |
+
<div class="bg-gray-600 p-4 rounded-lg">
|
| 563 |
+
<h4 class="text-lg font-semibold text-white mb-2">Common Metamethods:</h4>
|
| 564 |
+
<ul class="grid grid-cols-1 md:grid-cols-2 gap-2 text-gray-300">
|
| 565 |
+
<li><span class="syntax-highlight">__add</span>: + operator</li>
|
| 566 |
+
<li><span class="syntax-highlight">__sub</span>: - operator</li>
|
| 567 |
+
<li><span class="syntax-highlight">__mul</span>: * operator</li>
|
| 568 |
+
<li><span class="syntax-highlight">__div</span>: / operator</li>
|
| 569 |
+
<li><span class="syntax-highlight">__tostring</span>: string representation</li>
|
| 570 |
+
<li><span class="syntax-highlight">__index</span>: table access</li>
|
| 571 |
+
<li><span class="syntax-highlight">__newindex</span>: table assignment</li>
|
| 572 |
+
<li><span class="syntax-highlight">__call</span>: makes table callable</li>
|
| 573 |
+
</ul>
|
| 574 |
+
</div>
|
| 575 |
+
</div>
|
| 576 |
+
</div>
|
| 577 |
+
|
| 578 |
+
<!-- Lesson 3 -->
|
| 579 |
+
<div class="bg-gray-700 rounded-lg overflow-hidden">
|
| 580 |
+
<div class="p-6">
|
| 581 |
+
<h3 class="text-2xl font-bold text-white mb-4">3. Coroutines</h3>
|
| 582 |
+
<p class="text-gray-300 mb-4">Coroutines in Lua allow cooperative multitasking, enabling the creation of iterators and non-preemptive threads.</p>
|
| 583 |
+
|
| 584 |
+
<div class="code-block mb-6">
|
| 585 |
+
<pre><code><span class="comment">-- Simple coroutine example</span>
|
| 586 |
+
<span class="keyword">local</span> co = <span class="hljs-built_in">coroutine</span>.<span class="hljs-built_in">create</span>(<span class="keyword">function</span>()
|
| 587 |
+
<span class="keyword">for</span> i = <span class="number">1</span>, <span class="number">3</span> <span class="keyword">do</span>
|
| 588 |
+
<span class="hljs-built_in">print</span>(<span class="string">"Coroutine"</span>, i)
|
| 589 |
+
<span class="hljs-built_in">coroutine</span>.<span class="hljs-built_in">yield</span>()
|
| 590 |
+
<span class="keyword">end</span>
|
| 591 |
+
<span class="keyword">end</span>)
|
| 592 |
+
|
| 593 |
+
<span class="hljs-built_in">coroutine</span>.<span class="hljs-built_in">resume</span>(co) <span class="comment">-- Coroutine 1</span>
|
| 594 |
+
<span class="hljs-built_in">coroutine</span>.<span class="hljs-built_in">resume</span>(co) <span class="comment">-- Coroutine 2</span>
|
| 595 |
+
<span class="hljs-built_in">coroutine</span>.<span class="hljs-built_in">resume</span>(co) <span class="comment">-- Coroutine 3</span>
|
| 596 |
+
|
| 597 |
+
<span class="comment">-- Coroutine-based iterator</span>
|
| 598 |
+
<span class="keyword">function</span> <span class="function">countdown</span>(from)
|
| 599 |
+
<span class="keyword">return</span> <span class="hljs-built_in">coroutine</span>.<span class="hljs-built_in">wrap</span>(<span class="keyword">function</span>()
|
| 600 |
+
<span class="keyword">for</span> i = from, <span class="number">1</span>, -<span class="number">1</span> <span class="keyword">do</span>
|
| 601 |
+
<span class="hljs-built_in">coroutine</span>.<span class="hljs-built_in">yield</span>(i)
|
| 602 |
+
<span class="keyword">end</span>
|
| 603 |
+
<span class="keyword">end</span>)
|
| 604 |
+
<span class="keyword">end</span>
|
| 605 |
+
|
| 606 |
+
<span class="keyword">for</span> num <span class="keyword">in</span> countdown(<span class="number">5</span>) <span class="keyword">do</span>
|
| 607 |
+
<span class="hljs-built_in">print</span>(num) <span class="comment">-- 5, 4, 3, 2, 1</span>
|
| 608 |
+
<span class="keyword">end</span></code></pre>
|
| 609 |
+
</div>
|
| 610 |
+
</div>
|
| 611 |
+
</div>
|
| 612 |
+
</div>
|
| 613 |
+
|
| 614 |
+
<div class="mt-8 text-center">
|
| 615 |
+
<a href="#advanced-lessons" class="inline-block bg-blue-500 hover:bg-blue-600 text-white px-8 py-3 rounded-md text-lg font-medium">
|
| 616 |
+
Continue to Advanced Lessons →
|
| 617 |
+
</a>
|
| 618 |
+
</div>
|
| 619 |
+
</div>
|
| 620 |
+
</section>
|
| 621 |
+
|
| 622 |
+
<!-- Advanced Lessons -->
|
| 623 |
+
<section id="advanced-lessons" class="py-16 bg-gray-900">
|
| 624 |
+
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
|
| 625 |
+
<h2 class="text-3xl font-extrabold text-white mb-8">
|
| 626 |
+
<span class="text-purple-400">Advanced</span> Lua Topics
|
| 627 |
+
</h2>
|
| 628 |
+
|
| 629 |
+
<div class="space-y-8">
|
| 630 |
+
<!-- Lesson 1 -->
|
| 631 |
+
<div class="bg-gray-800 rounded-lg overflow-hidden">
|
| 632 |
+
<div class="p-6">
|
| 633 |
+
<h3 class="text-2xl font-bold text-white mb-4">1. Lua C API</h3>
|
| 634 |
+
<p class="text-gray-300 mb-4">Lua's C API allows you to embed Lua in C/C++ applications and extend Lua with C functions.</p>
|
| 635 |
+
|
| 636 |
+
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
|
| 637 |
+
<div>
|
| 638 |
+
<h4 class="text-lg font-semibold text-white mb-2">Embedding Lua in C</h4>
|
| 639 |
+
<div class="code-block">
|
| 640 |
+
<pre><code><span class="comment">/* simple.c - embedding Lua in C */</span>
|
| 641 |
+
<span class="comment">#include <lua.h></span>
|
| 642 |
+
<span class="comment">#include <lauxlib.h></span>
|
| 643 |
+
<span class="comment">#include <lualib.h></span>
|
| 644 |
+
|
| 645 |
+
<span class="keyword">int</span> main(<span class="keyword">void</span>) {
|
| 646 |
+
<span class="comment">/* create Lua state */</span>
|
| 647 |
+
lua_State *L = luaL_newstate();
|
| 648 |
+
|
| 649 |
+
<span class="comment">/* load Lua libraries */</span>
|
| 650 |
+
luaL_openlibs(L);
|
| 651 |
+
|
| 652 |
+
<span class="comment">/* run Lua code */</span>
|
| 653 |
+
luaL_dostring(L, <span class="string">"print('Hello from Lua!')"</span>);
|
| 654 |
+
|
| 655 |
+
<span class="comment">/* cleanup */</span>
|
| 656 |
+
lua_close(L);
|
| 657 |
+
<span class="keyword">return</span> <span class="number">0</span>;
|
| 658 |
+
}</code></pre>
|
| 659 |
+
</div>
|
| 660 |
+
</div>
|
| 661 |
+
<div>
|
| 662 |
+
<h4 class="text-lg font-semibold text-white mb-2">Calling C from Lua</h4>
|
| 663 |
+
<div class="code-block">
|
| 664 |
+
<pre><code><span class="comment">// Register a C function to be called from Lua</span>
|
| 665 |
+
<span class="keyword">static</span> <span class="keyword">int</span> l_add(lua_State *L) {
|
| 666 |
+
<span class="keyword">int</span> a = lua_tonumber(L, <span class="number">1</span>);
|
| 667 |
+
<span class="keyword">int</span> b = lua_tonumber(L, <span class="number">2</span>);
|
| 668 |
+
lua_pushnumber(L, a + b);
|
| 669 |
+
<span class="keyword">return</span> <span class="number">1</span>; <span class="comment">// number of return values</span>
|
| 670 |
+
}
|
| 671 |
+
|
| 672 |
+
<span class="keyword">int</span> main(<span class="keyword">void</span>) {
|
| 673 |
+
lua_State *L = luaL_newstate();
|
| 674 |
+
luaL_openlibs(L);
|
| 675 |
+
|
| 676 |
+
<span class="comment">// Register our function</span>
|
| 677 |
+
lua_register(L, <span class="string">"add"</span>, l_add);
|
| 678 |
+
|
| 679 |
+
<span class="comment">// Call it from Lua</span>
|
| 680 |
+
luaL_dostring(L, <span class="string">"print(add(2, 3))"</span>); <span class="comment">// prints 5</span>
|
| 681 |
+
|
| 682 |
+
lua_close(L);
|
| 683 |
+
<span class="keyword">return</span> <span class="number">0</span>;
|
| 684 |
+
}</code></pre>
|
| 685 |
+
</div>
|
| 686 |
+
</div>
|
| 687 |
+
</div>
|
| 688 |
+
</div>
|
| 689 |
+
</div>
|
| 690 |
+
|
| 691 |
+
<!-- Lesson 2 -->
|
| 692 |
+
<div class="bg-gray-800 rounded-lg overflow-hidden">
|
| 693 |
+
<div class="p-6">
|
| 694 |
+
<h3 class="text-2xl font-bold text-white mb-4">2. Performance Optimization</h3>
|
| 695 |
+
<p class="text-gray-300 mb-4">Lua is fast, but these techniques can help squeeze out even more performance.</p>
|
| 696 |
+
|
| 697 |
+
<div class="bg-gray-700 p-4 rounded-lg mb-6">
|
| 698 |
+
<h4 class="text-lg font-semibold text-white mb-2">Optimization Tips:</h4>
|
| 699 |
+
<ul class="list-disc list-inside text-gray-300 space-y-1">
|
| 700 |
+
<li>Use <span class="syntax-highlight">local</span> variables instead of globals</li>
|
| 701 |
+
<li>Avoid table creation in tight loops</li>
|
| 702 |
+
<li>Reuse tables when possible</li>
|
| 703 |
+
<li>Use the most specific loop possible (<span class="syntax-highlight">for</span> is faster than <span class="syntax-highlight">while</span>)</li>
|
| 704 |
+
<li>Prefer <span class="syntax-highlight">ipairs</span> for array iteration</li>
|
| 705 |
+
<li>Cache frequently accessed table fields in locals</li>
|
| 706 |
+
</ul>
|
| 707 |
+
</div>
|
| 708 |
+
|
| 709 |
+
<div class="code-block">
|
| 710 |
+
<pre><code><span class="comment">-- Before optimization</span>
|
| 711 |
+
<span class="keyword">for</span> i = <span class="number">1</span>, <span class="number">1000000</span> <span class="keyword">do</span>
|
| 712 |
+
<span class="keyword">local</span> t = {x = <span class="number">1</span>, y = <span class="number">2</span>, z = <span class="number">3</span>}
|
| 713 |
+
<span class="hljs-built_in">math</span>.<span class="hljs-built_in">sqrt</span>(t.x * t.x + t.y * t.y + t.z * t.z)
|
| 714 |
+
<span class="keyword">end</span>
|
| 715 |
+
|
| 716 |
+
<span class="comment">-- After optimization</span>
|
| 717 |
+
<span class="keyword">local</span> sqrt = <span class="hljs-built_in">math</span>.<span class="hljs-built_in">sqrt</span> <span class="comment">-- Cache function</span>
|
| 718 |
+
<span class="keyword">local</span> t = {x = <span class="number">1</span>, y = <span class="number">2</span>, z = <span class="number">3</span>} <span class="comment">-- Reuse table</span>
|
| 719 |
+
<span class="keyword">local</span> x, y, z = t.x, t.y, t.z <span class="comment">-- Cache fields</span>
|
| 720 |
+
|
| 721 |
+
<span class="keyword">for</span> i = <span class="number">1</span>, <span class="number">1000000</span> <span class="keyword">do</span>
|
| 722 |
+
sqrt(x * x + y * y + z * z)
|
| 723 |
+
<span class="keyword">end</span></code></pre>
|
| 724 |
+
</div>
|
| 725 |
+
</div>
|
| 726 |
+
</div>
|
| 727 |
+
|
| 728 |
+
<!-- Lesson 3 -->
|
| 729 |
+
<div class="bg-gray-800 rounded-lg overflow-hidden">
|
| 730 |
+
<div class="p-6">
|
| 731 |
+
<h3 class="text-2xl font-bold text-white mb-4">3. Creating Domain-Specific Languages (DSLs)</h3>
|
| 732 |
+
<p class="text-gray-300 mb-4">Lua's flexible syntax makes it ideal for creating embedded DSLs.</p>
|
| 733 |
+
|
| 734 |
+
<div class="code-block mb-6">
|
| 735 |
+
<pre><code><span class="comment">-- Example: Creating a simple HTML DSL</span>
|
| 736 |
+
<span class="keyword">function</span> <span class="function">tag</span>(name, attrs, ...)
|
| 737 |
+
<span class="keyword">local</span> attrStr = <span class="string">""</span>
|
| 738 |
+
<span class="keyword">if</span> attrs <span class="keyword">then</span>
|
| 739 |
+
<span class="keyword">for</span> k, v <span class="keyword">in</span> <span class="hljs-built_in">pairs</span>(attrs) <span class="keyword">do</span>
|
| 740 |
+
attrStr = attrStr .. <span class="string">' '</span> .. k .. <span class="string">'="'</span> .. v .. <span class="string">'"'</span>
|
| 741 |
+
<span class="keyword">end</span>
|
| 742 |
+
<span class="keyword">end</span>
|
| 743 |
+
|
| 744 |
+
<span class="keyword">local</span> content = <span class="hljs-built_in">table</span>.<span class="hljs-built_in">concat</span>({...}, <span class="string">""</span>)
|
| 745 |
+
<span class="keyword">return</span> <span class="string">"<"</span> .. name .. attrStr .. <span class="string">">"</span> .. content .. <span class="string">"</"</span> .. name .. <span class="string">">"</span>
|
| 746 |
+
<span class="keyword">end</span>
|
| 747 |
+
|
| 748 |
+
<span class="keyword">function</span> <span class="function">div</span>(attrs, ...) <span class="keyword">return</span> tag(<span class="string">"div"</span>, attrs, ...) <span class="keyword">end</span>
|
| 749 |
+
<span class="keyword">function</span> <span class="function">p</span>(attrs, ...) <span class="keyword">return</span> tag(<span class="string">"p"</span>, attrs, ...) <span class="keyword">end</span>
|
| 750 |
+
|
| 751 |
+
<span class="comment">-- Usage</span>
|
| 752 |
+
<span class="keyword">local</span> html = div({class=<span class="string">"container"</span>},
|
| 753 |
+
p({}, <span class="string">"Hello, "</span>, <span class="string">"Lua DSL!"</span>),
|
| 754 |
+
div({id=<span class="string">"content"</span>}, <span class="string">"This is a test"</span>)
|
| 755 |
+
)
|
| 756 |
+
|
| 757 |
+
<span class="hljs-built_in">print</span>(html)
|
| 758 |
+
<span class="comment">-- Outputs: <div class="container"><p>Hello, Lua DSL!</p><div id="content">This is a test</div></div></span></code></pre>
|
| 759 |
+
</div>
|
| 760 |
+
</div>
|
| 761 |
+
</div>
|
| 762 |
+
</div>
|
| 763 |
+
</div>
|
| 764 |
+
</section>
|
| 765 |
+
|
| 766 |
+
<!-- Examples Section -->
|
| 767 |
+
<section id="examples" class="py-16 bg-gray-800">
|
| 768 |
+
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
|
| 769 |
+
<h2 class="text-3xl font-extrabold text-white text-center mb-12">
|
| 770 |
+
Lua <span class="text-green-400">Examples</span>
|
| 771 |
+
</h2>
|
| 772 |
+
|
| 773 |
+
<div class="grid grid-cols-1 md:grid-cols-2 gap-8">
|
| 774 |
+
<!-- Example 1 -->
|
| 775 |
+
<div class="bg-gray-700 rounded-lg overflow-hidden shadow-lg">
|
| 776 |
+
<div class="p-6">
|
| 777 |
+
<h3 class="text-xl font-bold text-white mb-4">1. Fibonacci Sequence</h3>
|
| 778 |
+
<div class="code-block mb-4">
|
| 779 |
+
<pre><code><span class="comment">-- Memoized Fibonacci function</span>
|
| 780 |
+
<span class="keyword">local</span> fib_cache = {[<span class="number">0</span>] = <span class="number">0</span>, [<span class="number">1</span>] = <span class="number">1</span>}
|
| 781 |
+
|
| 782 |
+
<span class="keyword">function</span> <span class="function">fib</span>(n)
|
| 783 |
+
<span class="keyword">if</span> <span class="keyword">not</span> fib_cache[n] <span class="keyword">then</span>
|
| 784 |
+
fib_cache[n] = fib(n-<span class="number">1</span>) + fib(n-<span class="number">2</span>)
|
| 785 |
+
<span class="keyword">end</span>
|
| 786 |
+
<span class="keyword">return</span> fib_cache[n]
|
| 787 |
+
<span class="keyword">end</span>
|
| 788 |
+
|
| 789 |
+
<span class="comment">-- Print first 10 Fibonacci numbers</span>
|
| 790 |
+
<span class="keyword">for</span> i = <span class="number">0</span>, <span class="number">10</span> <span class="keyword">do</span>
|
| 791 |
+
<span class="hljs-built_in">print</span>(<span class="string">"fib("</span>..i..<span class="string">") ="</span>, fib(i))
|
| 792 |
+
<span class="keyword">end</span></code></pre>
|
| 793 |
+
</div>
|
| 794 |
+
<button class="run-example bg-green-600 hover:bg-green-700 text-white px-4 py-2 rounded-md text-sm font-medium">
|
| 795 |
+
Run Example
|
| 796 |
+
</button>
|
| 797 |
+
</div>
|
| 798 |
+
</div>
|
| 799 |
+
|
| 800 |
+
<!-- Example 2 -->
|
| 801 |
+
<div class="bg-gray-700 rounded-lg overflow-hidden shadow-lg">
|
| 802 |
+
<div class="p-6">
|
| 803 |
+
<h3 class="text-xl font-bold text-white mb-4">2. Object-Oriented Programming</h3>
|
| 804 |
+
<div class="code-block mb-4">
|
| 805 |
+
<pre><code><span class="comment">-- Simple OOP implementation</span>
|
| 806 |
+
<span class="keyword">local</span> Animal = {
|
| 807 |
+
sound = <span class="string">"..."</span>
|
| 808 |
+
}
|
| 809 |
+
|
| 810 |
+
<span class="keyword">function</span> Animal:new(o)
|
| 811 |
+
o = o <span class="keyword">or</span> {}
|
| 812 |
+
<span class="hljs-built_in">setmetatable</span>(o, self)
|
| 813 |
+
self.__index = self
|
| 814 |
+
<span class="keyword">return</span> o
|
| 815 |
+
<span class="keyword">end</span>
|
| 816 |
+
|
| 817 |
+
<span class="keyword">function</span> Animal:speak()
|
| 818 |
+
<span class="hljs-built_in">print</span>(self.sound)
|
| 819 |
+
<span class="keyword">end</span>
|
| 820 |
+
|
| 821 |
+
<span class="comment">-- Create a Dog class</span>
|
| 822 |
+
<span class="keyword">local</span> Dog = Animal:new({sound = <span class="string">"woof!"</span>})
|
| 823 |
+
|
| 824 |
+
<span class="keyword">function</span> Dog:wag()
|
| 825 |
+
<span class="hljs-built_in">print</span>(<span class="string">"Tail wagging!"</span>)
|
| 826 |
+
<span class="keyword">end</span>
|
| 827 |
+
|
| 828 |
+
<span class="comment">-- Create instances</span>
|
| 829 |
+
<span class="keyword">local</span> spot = Dog:new()
|
| 830 |
+
spot:speak() <span class="comment">-- woof!</span>
|
| 831 |
+
spot:wag() <span class="comment">-- Tail wagging!</span></code></pre>
|
| 832 |
+
</div>
|
| 833 |
+
<button class="run-example bg-green-600 hover:bg-green-700 text-white px-4 py-2 rounded-md text-sm font-medium">
|
| 834 |
+
Run Example
|
| 835 |
+
</button>
|
| 836 |
+
</div>
|
| 837 |
+
</div>
|
| 838 |
+
|
| 839 |
+
<!-- Example 3 -->
|
| 840 |
+
<div class="bg-gray-700 rounded-lg overflow-hidden shadow-lg">
|
| 841 |
+
<div class="p-6">
|
| 842 |
+
<h3 class="text-xl font-bold text-white mb-4">3. Simple HTTP Server</h3>
|
| 843 |
+
<div class="code-block mb-4">
|
| 844 |
+
<pre><code><span class="comment">-- Requires LuaSocket library</span>
|
| 845 |
+
<span class="keyword">local</span> socket = <span class="hljs-built_in">require</span> <span class="string">"socket"</span>
|
| 846 |
+
|
| 847 |
+
<span class="keyword">local</span> host = <span class="string">"localhost"</span>
|
| 848 |
+
<span class="keyword">local</span> port = <span class="number">8080</span>
|
| 849 |
+
|
| 850 |
+
<span class="keyword">local</span> server = <span class="hljs-built_in">assert</span>(socket.bind(host, port))
|
| 851 |
+
<span class="hljs-built_in">print</span>(<span class="string">"Server running on http://"</span>..host..<span class="string">":"</span>..port)
|
| 852 |
+
|
| 853 |
+
<span class="keyword">while</span> <span class="keyword">true</span> <span class="keyword">do</span>
|
| 854 |
+
<span class="keyword">local</span> client = server:accept()
|
| 855 |
+
client:settimeout(<span class="number">10</span>)
|
| 856 |
+
|
| 857 |
+
<span class="keyword">local</span> request = client:receive()
|
| 858 |
+
<span class="hljs-built_in">print</span>(<span class="string">"Request: "</span>..request)
|
| 859 |
+
|
| 860 |
+
<span class="keyword">local</span> response = {
|
| 861 |
+
<span class="string">"HTTP/1.1 200 OK\r\n"</span>,
|
| 862 |
+
<span class="string">"Content-Type: text/html\r\n\r\n"</span>,
|
| 863 |
+
<span class="string">"<html><body>"</span>,
|
| 864 |
+
<span class="string">"<h1>Hello from Lua Server!</h1>"</span>,
|
| 865 |
+
<span class="string">"<p>Request: "</span>..request..<span class="string">"</p>"</span>,
|
| 866 |
+
<span class="string">"</body></html>"</span>
|
| 867 |
+
}
|
| 868 |
+
|
| 869 |
+
client:send(<span class="hljs-built_in">table</span>.<span class="hljs-built_in">concat</span>(response))
|
| 870 |
+
client:close()
|
| 871 |
+
<span class="keyword">end</span></code></pre>
|
| 872 |
+
</div>
|
| 873 |
+
<button class="run-example bg-green-600 hover:bg-green-700 text-white px-4 py-2 rounded-md text-sm font-medium">
|
| 874 |
+
Run Example
|
| 875 |
+
</button>
|
| 876 |
+
</div>
|
| 877 |
+
</div>
|
| 878 |
+
|
| 879 |
+
<!-- Example 4 -->
|
| 880 |
+
<div class="bg-gray-700 rounded-lg overflow-hidden shadow-lg">
|
| 881 |
+
<div class="p-6">
|
| 882 |
+
<h3 class="text-xl font-bold text-white mb-4">4. Game Loop Example</h3>
|
| 883 |
+
<div class="code-block mb-4">
|
| 884 |
+
<pre><code><span class="comment">-- Simple game loop structure</span>
|
| 885 |
+
<span class="keyword">local</span> Game = {
|
| 886 |
+
running = <span class="keyword">true</span>,
|
| 887 |
+
entities = {}
|
| 888 |
+
}
|
| 889 |
+
|
| 890 |
+
<span class="keyword">function</span> <span class="function">Game:addEntity</span>(entity)
|
| 891 |
+
<span class="hljs-built_in">table</span>.<span class="hljs-built_in">insert</span>(self.entities, entity)
|
| 892 |
+
<span class="keyword">end</span>
|
| 893 |
+
|
| 894 |
+
<span class="keyword">function</span> <span class="function">Game:update</span>(dt)
|
| 895 |
+
<span class="keyword">for</span> i, entity <span class="keyword">in</span> <span class="hljs-built_in">ipairs</span>(self.entities) <span class="keyword">do</span>
|
| 896 |
+
<span class="keyword">if</span> entity.update <span class="keyword">then</span>
|
| 897 |
+
entity:update(dt)
|
| 898 |
+
<span class="keyword">end</span>
|
| 899 |
+
<span class="keyword">end</span>
|
| 900 |
+
<span class="keyword">end</span>
|
| 901 |
+
|
| 902 |
+
<span class="keyword">function</span> <span class="function">Game:draw</span>()
|
| 903 |
+
<span class="keyword">for</span> i, entity <span class="keyword">in</span> <span class="hljs-built_in">ipairs</span>(self.entities) <span class="keyword">do</span>
|
| 904 |
+
<span class="keyword">if</span> entity.draw <span class="keyword">then</span>
|
| 905 |
+
entity:draw()
|
| 906 |
+
<span class="keyword">end</span>
|
| 907 |
+
<span class="keyword">end</span>
|
| 908 |
+
<span class="keyword">end</span>
|
| 909 |
+
|
| 910 |
+
<span class="comment">-- Main game loop</span>
|
| 911 |
+
<span class="keyword">local</span> lastTime = socket.gettime()
|
| 912 |
+
<span class="keyword">while</span> Game.running <span class="keyword">do</span>
|
| 913 |
+
<span class="keyword">local</span> currentTime = socket.gettime()
|
| 914 |
+
<span class="keyword">local</span> dt = currentTime - lastTime
|
| 915 |
+
lastTime = currentTime
|
| 916 |
+
|
| 917 |
+
Game:update(dt)
|
| 918 |
+
Game:draw()
|
| 919 |
+
|
| 920 |
+
<span class="comment">-- Simple delay to simulate frame rate</span>
|
| 921 |
+
socket.sleep(<span class="number">0.016</span>) <span class="comment">-- ~60 FPS</span>
|
| 922 |
+
<span class="keyword">end</span></code></pre>
|
| 923 |
+
</div>
|
| 924 |
+
<button class="run-example bg-green-600 hover:bg-green-700 text-white px-4 py-2 rounded-md text-sm font-medium">
|
| 925 |
+
Run Example
|
| 926 |
+
</button>
|
| 927 |
+
</div>
|
| 928 |
+
</div>
|
| 929 |
+
</div>
|
| 930 |
+
</div>
|
| 931 |
+
</section>
|
| 932 |
+
|
| 933 |
+
<!-- Resources Section -->
|
| 934 |
+
<section id="resources" class="py-16 bg-gray-900">
|
| 935 |
+
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
|
| 936 |
+
<h2 class="text-3xl font-extrabold text-white text-center mb-12">
|
| 937 |
+
Lua <span class="text-green-400">Resources</span>
|
| 938 |
+
</h2>
|
| 939 |
+
|
| 940 |
+
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8">
|
| 941 |
+
<!-- Resource 1 -->
|
| 942 |
+
<div class="bg-gray-800 rounded-lg overflow-hidden shadow-lg">
|
| 943 |
+
<div class="p-6">
|
| 944 |
+
<div class="text-blue-400 text-3xl mb-4">
|
| 945 |
+
<i class="fas fa-book"></i>
|
| 946 |
+
</div>
|
| 947 |
+
<h3 class="text-xl font-bold text-white mb-2">Official Documentation</h3>
|
| 948 |
+
<p class="text-gray-300 mb-4">
|
| 949 |
+
The official Lua documentation and reference manuals.
|
| 950 |
+
</p>
|
| 951 |
+
<a href="https://www.lua.org/docs.html" target="_blank" class="text-blue-400 hover:text-blue-300 font-medium">
|
| 952 |
+
Visit Site →
|
| 953 |
+
</a>
|
| 954 |
+
</div>
|
| 955 |
+
</div>
|
| 956 |
+
|
| 957 |
+
<!-- Resource 2 -->
|
| 958 |
+
<div class="bg-gray-800 rounded-lg overflow-hidden shadow-lg">
|
| 959 |
+
<div class="p-6">
|
| 960 |
+
<div class="text-green-400 text-3xl mb-4">
|
| 961 |
+
<i class="fas fa-graduation-cap"></i>
|
| 962 |
+
</div>
|
| 963 |
+
<h3 class="text-xl font-bold text-white mb-2">Lua Tutorial</h3>
|
| 964 |
+
<p class="text-gray-300 mb-4">
|
| 965 |
+
A comprehensive tutorial covering Lua from basics to advanced topics.
|
| 966 |
+
</p>
|
| 967 |
+
<a href="https://www.tutorialspoint.com/lua/" target="_blank" class="text-green-400 hover:text-green-300 font-medium">
|
| 968 |
+
Visit Site →
|
| 969 |
+
</a>
|
| 970 |
+
</div>
|
| 971 |
+
</div>
|
| 972 |
+
|
| 973 |
+
<!-- Resource 3 -->
|
| 974 |
+
<div class="bg-gray-800 rounded-lg overflow-hidden shadow-lg">
|
| 975 |
+
<div class="p-6">
|
| 976 |
+
<div class="text-purple-400 text-3xl mb-4">
|
| 977 |
+
<i class="fas fa-code"></i>
|
| 978 |
+
</div>
|
| 979 |
+
<h3 class="text-xl font-bold text-white mb-2">Lua Users Wiki</h3>
|
| 980 |
+
<p class="text-gray-300 mb-4">
|
| 981 |
+
Community-driven wiki with code samples, libraries, and tips.
|
| 982 |
+
</p>
|
| 983 |
+
<a href="https://lua-users.org/wiki/" target="_blank" class="text-purple-400 hover:text-purple-300 font-medium">
|
| 984 |
+
Visit Site →
|
| 985 |
+
</a>
|
| 986 |
+
</div>
|
| 987 |
+
</div>
|
| 988 |
+
|
| 989 |
+
<!-- Resource 4 -->
|
| 990 |
+
<div class="bg-gray-800 rounded-lg overflow-hidden shadow-lg">
|
| 991 |
+
<div class="p-6">
|
| 992 |
+
<div class="text-yellow-400 text-3xl mb-4">
|
| 993 |
+
<i class="fas fa-gamepad"></i>
|
| 994 |
+
</div>
|
| 995 |
+
<h3 class="text-xl font-bold text-white mb-2">LÖVE Framework</h3>
|
| 996 |
+
<p class="text-gray-300 mb-4">
|
| 997 |
+
A framework for making 2D games in Lua.
|
| 998 |
+
</p>
|
| 999 |
+
<a href="https://love2d.org/" target="_blank" class="text-yellow-400 hover:text-yellow-300 font-medium">
|
| 1000 |
+
Visit Site →
|
| 1001 |
+
</a>
|
| 1002 |
+
</div>
|
| 1003 |
+
</div>
|
| 1004 |
+
|
| 1005 |
+
<!-- Resource 5 -->
|
| 1006 |
+
<div class="bg-gray-800 rounded-lg overflow-hidden shadow-lg">
|
| 1007 |
+
<div class="p-6">
|
| 1008 |
+
<div class="text-red-400 text-3xl mb-4">
|
| 1009 |
+
<i class="fas fa-cubes"></i>
|
| 1010 |
+
</div>
|
| 1011 |
+
<h3 class="text-xl font-bold text-white mb-2">LuaRocks</h3>
|
| 1012 |
+
<p class="text-gray-300 mb-4">
|
| 1013 |
+
Package manager for Lua modules.
|
| 1014 |
+
</p>
|
| 1015 |
+
<a href="https://luarocks.org/" target="_blank" class="text-red-400 hover:text-red-300 font-medium">
|
| 1016 |
+
Visit Site →
|
| 1017 |
+
</a>
|
| 1018 |
+
</div>
|
| 1019 |
+
</div>
|
| 1020 |
+
|
| 1021 |
+
<!-- Resource 6 -->
|
| 1022 |
+
<div class="bg-gray-800 rounded-lg overflow-hidden shadow-lg">
|
| 1023 |
+
<div class="p-6">
|
| 1024 |
+
<div class="text-pink-400 text-3xl mb-4">
|
| 1025 |
+
<i class="fas fa-comments"></i>
|
| 1026 |
+
</div>
|
| 1027 |
+
<h3 class="text-xl font-bold text-white mb-2">Lua Forum</h3>
|
| 1028 |
+
<p class="text-gray-300 mb-4">
|
| 1029 |
+
Official forum for Lua discussions and questions.
|
| 1030 |
+
</p>
|
| 1031 |
+
<a href="https://www.lua.org/lua-l.html" target="_blank" class="text-pink-400 hover:text-pink-300 font-medium">
|
| 1032 |
+
Visit Site →
|
| 1033 |
+
</a>
|
| 1034 |
+
</div>
|
| 1035 |
+
</div>
|
| 1036 |
+
</div>
|
| 1037 |
+
</div>
|
| 1038 |
+
</section>
|
| 1039 |
+
|
| 1040 |
+
<!-- Community Section -->
|
| 1041 |
+
<section id="community" class="py-16 bg-gray-800">
|
| 1042 |
+
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
|
| 1043 |
+
<h2 class="text-3xl font-extrabold text-white text-center mb-12">
|
| 1044 |
+
Join the <span class="text-green-400">Community</span>
|
| 1045 |
+
</h2>
|
| 1046 |
+
|
| 1047 |
+
<div class="bg-gray-700 rounded-lg p-8">
|
| 1048 |
+
<div class="grid grid-cols-1 md:grid-cols-2 gap-8">
|
| 1049 |
+
<div>
|
| 1050 |
+
<h3 class="text-2xl font-bold text-white mb-4">Get Involved</h3>
|
| 1051 |
+
<p class="text-gray-300 mb-6">
|
| 1052 |
+
Lua has a vibrant community of developers, from game modders to embedded systems engineers. Join discussions, ask questions, and share your projects.
|
| 1053 |
+
</p>
|
| 1054 |
+
|
| 1055 |
+
<div class="space-y-4">
|
| 1056 |
+
<div class="flex items-start">
|
| 1057 |
+
<div class="flex-shrink-0 text-green-400 mt-1 mr-3">
|
| 1058 |
+
<i class="fab fa-discord fa-lg"></i>
|
| 1059 |
+
</div>
|
| 1060 |
+
<div>
|
| 1061 |
+
<h4 class="text-lg font-semibold text-white">Discord Server</h4>
|
| 1062 |
+
<p class="text-gray-300">Join our Discord community for real-time discussions and support.</p>
|
| 1063 |
+
</div>
|
| 1064 |
+
</div>
|
| 1065 |
+
|
| 1066 |
+
<div class="flex items-start">
|
| 1067 |
+
<div class="flex-shrink-0 text-blue-400 mt-1 mr-3">
|
| 1068 |
+
<i class="fab fa-github fa-lg"></i>
|
| 1069 |
+
</div>
|
| 1070 |
+
<div>
|
| 1071 |
+
<h4 class="text-lg font-semibold text-white">GitHub</h4>
|
| 1072 |
+
<p class="text-gray-300">Contribute to open-source Lua projects and libraries.</p>
|
| 1073 |
+
</div>
|
| 1074 |
+
</div>
|
| 1075 |
+
|
| 1076 |
+
<div class="flex items-start">
|
| 1077 |
+
<div class="flex-shrink-0 text-red-400 mt-1 mr-3">
|
| 1078 |
+
<i class="fab fa-youtube fa-lg"></i>
|
| 1079 |
+
</div>
|
| 1080 |
+
<div>
|
| 1081 |
+
<h4 class="text-lg font-semibold text-white">YouTube</h4>
|
| 1082 |
+
<p class="text-gray-300">Watch tutorials and live coding sessions.</p>
|
| 1083 |
+
</div>
|
| 1084 |
+
</div>
|
| 1085 |
+
</div>
|
| 1086 |
+
</div>
|
| 1087 |
+
|
| 1088 |
+
<div>
|
| 1089 |
+
<h3 class="text-2xl font-bold text-white mb-4">Newsletter</h3>
|
| 1090 |
+
<p class="text-gray-300 mb-6">
|
| 1091 |
+
Subscribe to our newsletter for Lua tips, tutorials, and community news.
|
| 1092 |
+
</p>
|
| 1093 |
+
|
| 1094 |
+
<form class="space-y-4">
|
| 1095 |
+
<div>
|
| 1096 |
+
<label for="name" class="block text-sm font-medium text-gray-300">Name</label>
|
| 1097 |
+
<input type="text" id="name" class="mt-1 block w-full bg-gray-600 border border-gray-500 rounded-md shadow-sm py-2 px-3 text-white focus:outline-none focus:ring-green-500 focus:border-green-500">
|
| 1098 |
+
</div>
|
| 1099 |
+
|
| 1100 |
+
<div>
|
| 1101 |
+
<label for="email" class="block text-sm font-medium text-gray-300">Email</label>
|
| 1102 |
+
<input type="email" id="email" class="mt-1 block w-full bg-gray-600 border border-gray-500 rounded-md shadow-sm py-2 px-3 text-white focus:outline-none focus:ring-green-500 focus:border-green-500">
|
| 1103 |
+
</div>
|
| 1104 |
+
|
| 1105 |
+
<div class="flex items-center">
|
| 1106 |
+
<input id="subscribe" name="subscribe" type="checkbox" class="h-4 w-4 text-green-600 focus:ring-green-500 border-gray-300 rounded">
|
| 1107 |
+
<label for="subscribe" class="ml-2 block text-sm text-gray-300">
|
| 1108 |
+
I agree to receive emails about Lua programming
|
| 1109 |
+
</label>
|
| 1110 |
+
</div>
|
| 1111 |
+
|
| 1112 |
+
<button type="submit" class="w-full bg-green-600 hover:bg-green-700 text-white py-2 px-4 rounded-md font-medium">
|
| 1113 |
+
Subscribe
|
| 1114 |
+
</button>
|
| 1115 |
+
</form>
|
| 1116 |
+
</div>
|
| 1117 |
+
</div>
|
| 1118 |
+
</div>
|
| 1119 |
+
</div>
|
| 1120 |
+
</section>
|
| 1121 |
+
|
| 1122 |
+
<!-- Footer -->
|
| 1123 |
+
<footer class="bg-gray-900 py-12">
|
| 1124 |
+
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
|
| 1125 |
+
<div class="grid grid-cols-1 md:grid-cols-4 gap-8">
|
| 1126 |
+
<div>
|
| 1127 |
+
<h3 class="text-lg font-semibold text-white mb-4">Lua Mastery</h3>
|
| 1128 |
+
<p class="text-gray-400">
|
| 1129 |
+
Your complete guide to learning Lua programming from beginner to advanced.
|
| 1130 |
+
</p>
|
| 1131 |
+
</div>
|
| 1132 |
+
|
| 1133 |
+
<div>
|
| 1134 |
+
<h3 class="text-lg font-semibold text-white mb-4">Quick Links</h3>
|
| 1135 |
+
<ul class="space-y-2">
|
| 1136 |
+
<li><a href="#home" class="text-gray-400 hover:text-white">Home</a></li>
|
| 1137 |
+
<li><a href="#tutorials" class="text-gray-400 hover:text-white">Tutorials</a></li>
|
| 1138 |
+
<li><a href="#examples" class="text-gray-400 hover:text-white">Examples</a></li>
|
| 1139 |
+
<li><a href="#resources" class="text-gray-400 hover:text-white">Resources</a></li>
|
| 1140 |
+
</ul>
|
| 1141 |
+
</div>
|
| 1142 |
+
|
| 1143 |
+
<div>
|
| 1144 |
+
<h3 class="text-lg font-semibold text-white mb-4">Legal</h3>
|
| 1145 |
+
<ul class="space-y-2">
|
| 1146 |
+
<li><a href="#" class="text-gray-400 hover:text-white">Privacy Policy</a></li>
|
| 1147 |
+
<li><a href="#" class="text-gray-400 hover:text-white">Terms of Service</a></li>
|
| 1148 |
+
<li><a href="#" class="text-gray-400 hover:text-white">Cookie Policy</a></li>
|
| 1149 |
+
</ul>
|
| 1150 |
+
</div>
|
| 1151 |
+
|
| 1152 |
+
<div>
|
| 1153 |
+
<h3 class="text-lg font-semibold text-white mb-4">Connect</h3>
|
| 1154 |
+
<div class="flex space-x-4">
|
| 1155 |
+
<a href="#" class="text-gray-400 hover:text-white">
|
| 1156 |
+
<i class="fab fa-twitter fa-lg"></i>
|
| 1157 |
+
</a>
|
| 1158 |
+
<a href="#" class="text-gray-400 hover:text-white">
|
| 1159 |
+
<i class="fab fa-github fa-lg"></i>
|
| 1160 |
+
</a>
|
| 1161 |
+
<a href="#" class="text-gray-400 hover:text-white">
|
| 1162 |
+
<i class="fab fa-discord fa-lg"></i>
|
| 1163 |
+
</a>
|
| 1164 |
+
<a href="#" class="text-gray-400 hover:text-white">
|
| 1165 |
+
<i class="fab fa-youtube fa-lg"></i>
|
| 1166 |
+
</a>
|
| 1167 |
+
</div>
|
| 1168 |
+
</div>
|
| 1169 |
+
</div>
|
| 1170 |
+
|
| 1171 |
+
<div class="mt-12 pt-8 border-t border-gray-800">
|
| 1172 |
+
<p class="text-gray-400 text-center">
|
| 1173 |
+
© 2023
|
| 1174 |
+
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=seannyboy/learn-lua" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
|
| 1175 |
+
</html>
|