Skip to content

Commit 991f4db

Browse files
author
Kanishk Raj
authored
Add files via upload
1 parent 50d9bf1 commit 991f4db

File tree

3 files changed

+598
-0
lines changed

3 files changed

+598
-0
lines changed

index.html

Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
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>SimpleScript Language</title>
7+
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
8+
<link href="style.css" rel="stylesheet">
9+
<!-- CodeMirror CSS -->
10+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.15/codemirror.min.css">
11+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.15/theme/monokai.min.css">
12+
13+
<!-- CodeMirror JS -->
14+
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.15/codemirror.min.js"></script>
15+
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.15/mode/javascript/javascript.min.js"></script>
16+
</head>
17+
<body data-bs-spy="scroll" data-bs-target="#mainNav" data-bs-offset="100" tabindex="0">
18+
19+
<nav id="mainNav" class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top shadow-sm">
20+
<div class="container-fluid">
21+
<a class="navbar-brand" href="#">SimpleScript</a>
22+
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
23+
<span class="navbar-toggler-icon"></span>
24+
</button>
25+
<div class="collapse navbar-collapse" id="navbarNav">
26+
<ul class="navbar-nav ms-auto">
27+
<li class="nav-item"><a class="nav-link" href="#home">Home</a></li>
28+
<li class="nav-item"><a class="nav-link" href="#keywords">Keywords</a></li>
29+
<li class="nav-item"><a class="nav-link" href="#datatypes">Data Types</a></li>
30+
<li class="nav-item"><a class="nav-link" href="#functions">Functions</a></li>
31+
<li class="nav-item"><a class="nav-link" href="#syntax">Syntax</a></li>
32+
<li class="nav-item"><a class="nav-link" href="#examples">Examples</a></li>
33+
<li class="nav-item"><a class="nav-link" href="#try">Try It</a></li>
34+
</ul>
35+
</div>
36+
</div>
37+
</nav>
38+
39+
<header class="text-black text-center">
40+
<div class="container">
41+
<h1 class="display-4 text-success fw-bold">Welcome to SimpleScript</h1>
42+
<p class="lead">A beginner-friendly and powerful scripting language</p>
43+
</div>
44+
</header>
45+
46+
<main class="container my-5">
47+
<section id="home" class="mb-5">
48+
<h2 class="text-center">Introduction</h2>
49+
<br>
50+
<p class="text-center">SimpleScript is a beginner-friendly scripting language designed for ease, power, and readability. Whether you are new to programming or an experienced developer, SimpleScript offers features to streamline your workflow.</p>
51+
<br><hr><br>
52+
<h4 class="text-center">Why Choose SimpleScript?</h4>
53+
<ul>
54+
<li><strong>Ease of Use:</strong> Simple syntax and structure.</li>
55+
<li><strong>Versatility:</strong> Automate tasks or build web tools.</li>
56+
<li><strong>Powerful Features:</strong> Built-in functions and flexible structures.</li>
57+
<li><strong>Active Community:</strong> Share, learn, and grow.</li>
58+
</ul>
59+
</section>
60+
<hr>
61+
<section id="keywords" class="mb-5 text-center">
62+
<h2 class="text-center">Keywords</h2>
63+
<p class="text-center">These are reserved words used in SimpleScript for program structure and logic.</p>
64+
<div class="row row-cols-2 row-cols-md-3 g-3">
65+
<div class="col"><strong>let</strong>: Declare a variable</div>
66+
<div class="col"><strong>print</strong>: Output a value</div>
67+
<div class="col"><strong>if / then / endif</strong>: Conditional logic</div>
68+
<div class="col"><strong>for / to / do / endfor</strong>: Looping from one value to another</div>
69+
<div class="col"><strong>while / do / endwhile</strong>: Loop while a condition is true</div>
70+
<div class="col"><strong>input</strong>: Take user input</div>
71+
<div class="col"><strong>function / endfunction</strong>: Define a function</div>
72+
<div class="col"><strong>call</strong>: Call a function</div>
73+
<div class="col"><strong>return</strong>: Return a value from a function</div>
74+
<div class="col"><strong>break / continue</strong>: Loop control</div>
75+
<div class="col"><strong>and / or / not</strong>: Logical operators</div>
76+
</div>
77+
</section>
78+
<hr>
79+
<section id="datatypes" class="mb-5 text-center">
80+
<h2 class="text-center">Data Types</h2>
81+
<ul>
82+
<li><strong>Number</strong>: e.g., 10, 3.14</li>
83+
<li><strong>String</strong>: e.g., "Hello, World"</li>
84+
<li><strong>Boolean</strong>: <code>true</code> or <code>false</code></li>
85+
<li><strong>Null</strong>: Represents no value</li>
86+
<li><strong>List</strong>: Arrays like [1, 2, 3]</li>
87+
</ul>
88+
</section>
89+
<hr>
90+
<section id="functions" class="mb-5 text-center">
91+
<h2 class="text-center">Built-in Functions</h2>
92+
<div class="row row-cols-2 row-cols-md-3 g-3">
93+
<div class="col"><code>len(list)</code>: Length of list</div>
94+
<div class="col"><code>push(list, value)</code>: Add to end</div>
95+
<div class="col"><code>pop(list)</code>: Remove last item</div>
96+
<div class="col"><code>join(list, sep)</code>: Join into string</div>
97+
<div class="col"><code>split(str, sep)</code>: Convert to list</div>
98+
<div class="col"><code>reverse(list)</code>: Reverse items</div>
99+
<div class="col"><code>sort(list)</code>: Sort items</div>
100+
<div class="col"><code>map(list)</code>: Transform values</div>
101+
<div class="col"><code>filter(list)</code>: Filter truthy values</div>
102+
<div class="col"><code>sum(list)</code>: Total sum</div>
103+
<div class="col"><code>max(list)</code>, <code>min(list)</code>: Find max/min</div>
104+
</div>
105+
</section>
106+
<hr>
107+
<section id="syntax" class="mb-5 text-center">
108+
<h2 class="text-center">Syntax</h2>
109+
<p class="text-center">Basic SimpleScript syntax:</p>
110+
<pre><code class="bg-light p-3 d-block">
111+
let x = 10
112+
print x
113+
if x > 5 then
114+
print "x is greater than 5"
115+
endif
116+
</code></pre>
117+
</section>
118+
<hr>
119+
<section id="examples" class="mb-5 text-center">
120+
<h2 class="text-center">Examples</h2>
121+
<pre><code class="bg-light p-3 d-block">
122+
let sum = 0
123+
for i = 1 to 10 do
124+
sum = sum + i
125+
endfor
126+
print sum
127+
</code></pre>
128+
</section>
129+
<hr>
130+
<section id="try" class="mb-5">
131+
<h2 class="text-center">Try SimpleScript</h2>
132+
<textarea class="form-control mb-3" id="scriptInput" rows="6" placeholder="Enter your SimpleScript code here..."></textarea>
133+
<br>
134+
<div class="center-btn">
135+
<button class="btn btn-primary" onclick="runSimpleScript()">Run</button>
136+
</div>
137+
<pre class="bg-dark text-white p-3 mt-3" id="output"></pre>
138+
</section>
139+
</main>
140+
<hr>
141+
<footer class="text-center text-white py-3">
142+
&copy; 2024 SimpleScript
143+
</footer>
144+
145+
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
146+
<script src="script.js"></script>
147+
</body>
148+
</html>

0 commit comments

Comments
 (0)