Spaces:
Running
Running
Add 3 files
Browse files- README.md +7 -5
- index.html +589 -19
- prompts.txt +2 -0
README.md
CHANGED
@@ -1,10 +1,12 @@
|
|
1 |
---
|
2 |
-
title:
|
3 |
-
emoji:
|
4 |
-
colorFrom:
|
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: learning-tools
|
3 |
+
emoji: π³
|
4 |
+
colorFrom: purple
|
5 |
+
colorTo: blue
|
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,589 @@
|
|
1 |
-
<!
|
2 |
-
<html>
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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>Learn Java & Python Basics</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-editor {
|
11 |
+
font-family: 'Courier New', Courier, monospace;
|
12 |
+
background-color: #2d2d2d;
|
13 |
+
color: #f8f8f2;
|
14 |
+
padding: 1rem;
|
15 |
+
border-radius: 0.5rem;
|
16 |
+
tab-size: 2;
|
17 |
+
}
|
18 |
+
.tab-button {
|
19 |
+
transition: all 0.2s ease;
|
20 |
+
}
|
21 |
+
.tab-button.active {
|
22 |
+
border-bottom: 3px solid #3b82f6;
|
23 |
+
font-weight: 600;
|
24 |
+
}
|
25 |
+
.exercise-card {
|
26 |
+
transition: transform 0.2s ease;
|
27 |
+
}
|
28 |
+
.exercise-card:hover {
|
29 |
+
transform: translateY(-2px);
|
30 |
+
}
|
31 |
+
.language-icon {
|
32 |
+
width: 80px;
|
33 |
+
height: 80px;
|
34 |
+
}
|
35 |
+
</style>
|
36 |
+
</head>
|
37 |
+
<body class="bg-gray-50 min-h-screen">
|
38 |
+
<div class="container mx-auto px-4 py-8">
|
39 |
+
<!-- Header with Theme Image -->
|
40 |
+
<header class="text-center mb-12 relative">
|
41 |
+
<div class="absolute inset-0 bg-gradient-to-r from-blue-500 to-purple-600 rounded-2xl opacity-20 h-64"></div>
|
42 |
+
<div class="relative z-10">
|
43 |
+
<h1 class="text-5xl font-bold text-gray-800 mb-6 pt-8">Learn Java & Python Basics</h1>
|
44 |
+
<p class="text-xl text-gray-600 max-w-3xl mx-auto mb-8">
|
45 |
+
Master the fundamentals of two powerful programming languages through interactive lessons
|
46 |
+
</p>
|
47 |
+
<div class="flex justify-center space-x-12 mb-8">
|
48 |
+
<div class="text-center">
|
49 |
+
<img src="https://cdn-icons-png.flaticon.com/512/226/226777.png" alt="Java" class="language-icon mx-auto mb-2">
|
50 |
+
<span class="font-medium text-gray-700">Java</span>
|
51 |
+
</div>
|
52 |
+
<div class="text-center">
|
53 |
+
<img src="https://cdn-icons-png.flaticon.com/512/5968/5968350.png" alt="Python" class="language-icon mx-auto mb-2">
|
54 |
+
<span class="font-medium text-gray-700">Python</span>
|
55 |
+
</div>
|
56 |
+
</div>
|
57 |
+
</div>
|
58 |
+
</header>
|
59 |
+
|
60 |
+
<!-- Learning Path Navigation -->
|
61 |
+
<section class="mb-16 bg-white rounded-xl shadow-lg overflow-hidden">
|
62 |
+
<div class="p-6">
|
63 |
+
<h2 class="text-2xl font-semibold text-gray-800 mb-6 flex items-center">
|
64 |
+
<i class="fas fa-road mr-3 text-blue-500"></i>
|
65 |
+
Learning Path
|
66 |
+
</h2>
|
67 |
+
|
68 |
+
<div class="grid grid-cols-1 md:grid-cols-2 gap-8">
|
69 |
+
<!-- Java Path -->
|
70 |
+
<div class="border-l-4 border-blue-500 pl-6">
|
71 |
+
<h3 class="text-xl font-medium text-gray-800 mb-4 flex items-center">
|
72 |
+
<img src="https://cdn-icons-png.flaticon.com/512/226/226777.png" alt="Java" class="w-6 h-6 mr-2">
|
73 |
+
Java Fundamentals
|
74 |
+
</h3>
|
75 |
+
<ol class="space-y-4">
|
76 |
+
<li class="flex items-start">
|
77 |
+
<span class="flex-shrink-0 bg-blue-500 text-white rounded-full w-6 h-6 flex items-center justify-center mr-3">1</span>
|
78 |
+
<div>
|
79 |
+
<h4 class="font-medium text-gray-800">Variables & Data Types</h4>
|
80 |
+
<p class="text-sm text-gray-600">Learn primitive types, declarations, and type casting</p>
|
81 |
+
</div>
|
82 |
+
</li>
|
83 |
+
<li class="flex items-start">
|
84 |
+
<span class="flex-shrink-0 bg-blue-500 text-white rounded-full w-6 h-6 flex items-center justify-center mr-3">2</span>
|
85 |
+
<div>
|
86 |
+
<h4 class="font-medium text-gray-800">Control Structures</h4>
|
87 |
+
<p class="text-sm text-gray-600">Master if-else, switch, loops (for, while, do-while)</p>
|
88 |
+
</div>
|
89 |
+
</li>
|
90 |
+
<li class="flex items-start">
|
91 |
+
<span class="flex-shrink-0 bg-blue-500 text-white rounded-full w-6 h-6 flex items-center justify-center mr-3">3</span>
|
92 |
+
<div>
|
93 |
+
<h4 class="font-medium text-gray-800">Methods & Classes</h4>
|
94 |
+
<p class="text-sm text-gray-600">Understand OOP concepts, constructors, and methods</p>
|
95 |
+
</div>
|
96 |
+
</li>
|
97 |
+
<li class="flex items-start">
|
98 |
+
<span class="flex-shrink-0 bg-blue-500 text-white rounded-full w-6 h-6 flex items-center justify-center mr-3">4</span>
|
99 |
+
<div>
|
100 |
+
<h4 class="font-medium text-gray-800">Arrays & Collections</h4>
|
101 |
+
<p class="text-sm text-gray-600">Work with arrays, ArrayLists, and basic data structures</p>
|
102 |
+
</div>
|
103 |
+
</li>
|
104 |
+
</ol>
|
105 |
+
</div>
|
106 |
+
|
107 |
+
<!-- Python Path -->
|
108 |
+
<div class="border-l-4 border-green-500 pl-6">
|
109 |
+
<h3 class="text-xl font-medium text-gray-800 mb-4 flex items-center">
|
110 |
+
<img src="https://cdn-icons-png.flaticon.com/512/5968/5968350.png" alt="Python" class="w-6 h-6 mr-2">
|
111 |
+
Python Fundamentals
|
112 |
+
</h3>
|
113 |
+
<ol class="space-y-4">
|
114 |
+
<li class="flex items-start">
|
115 |
+
<span class="flex-shrink-0 bg-green-500 text-white rounded-full w-6 h-6 flex items-center justify-center mr-3">1</span>
|
116 |
+
<div>
|
117 |
+
<h4 class="font-medium text-gray-800">Variables & Data Types</h4>
|
118 |
+
<p class="text-sm text-gray-600">Learn dynamic typing, numbers, strings, and lists</p>
|
119 |
+
</div>
|
120 |
+
</li>
|
121 |
+
<li class="flex items-start">
|
122 |
+
<span class="flex-shrink-0 bg-green-500 text-white rounded-full w-6 h-6 flex items-center justify-center mr-3">2</span>
|
123 |
+
<div>
|
124 |
+
<h4 class="font-medium text-gray-800">Control Flow</h4>
|
125 |
+
<p class="text-sm text-gray-600">Master if-elif-else, loops (for, while), and range()</p>
|
126 |
+
</div>
|
127 |
+
</li>
|
128 |
+
<li class="flex items-start">
|
129 |
+
<span class="flex-shrink-0 bg-green-500 text-white rounded-full w-6 h-6 flex items-center justify-center mr-3">3</span>
|
130 |
+
<div>
|
131 |
+
<h4 class="font-medium text-gray-800">Functions</h4>
|
132 |
+
<p class="text-sm text-gray-600">Define functions, parameters, return values, and scope</p>
|
133 |
+
</div>
|
134 |
+
</li>
|
135 |
+
<li class="flex items-start">
|
136 |
+
<span class="flex-shrink-0 bg-green-500 text-white rounded-full w-6 h-6 flex items-center justify-center mr-3">4</span>
|
137 |
+
<div>
|
138 |
+
<h4 class="font-medium text-gray-800">Lists & Dictionaries</h4>
|
139 |
+
<p class="text-sm text-gray-600">Work with sequences, list comprehensions, and dictionaries</p>
|
140 |
+
</div>
|
141 |
+
</li>
|
142 |
+
</ol>
|
143 |
+
</div>
|
144 |
+
</div>
|
145 |
+
</div>
|
146 |
+
</section>
|
147 |
+
|
148 |
+
<!-- Lesson 1: Variables & Data Types -->
|
149 |
+
<section class="mb-16 bg-white rounded-xl shadow-lg overflow-hidden">
|
150 |
+
<div class="p-6">
|
151 |
+
<h2 class="text-2xl font-semibold text-gray-800 mb-6 flex items-center">
|
152 |
+
<i class="fas fa-cubes mr-3 text-blue-500"></i>
|
153 |
+
Lesson 1: Variables & Data Types
|
154 |
+
</h2>
|
155 |
+
|
156 |
+
<div class="grid grid-cols-1 md:grid-cols-2 gap-8 mb-8">
|
157 |
+
<div>
|
158 |
+
<h3 class="text-xl font-medium text-gray-800 mb-3">Java Variables</h3>
|
159 |
+
<p class="text-gray-600 mb-4">
|
160 |
+
Java is statically typed, meaning you must declare the variable type before using it.
|
161 |
+
Primitive types include <code class="bg-gray-100 px-1 rounded">int</code>, <code class="bg-gray-100 px-1 rounded">double</code>,
|
162 |
+
<code class="bg-gray-100 px-1 rounded">boolean</code>, and <code class="bg-gray-100 px-1 rounded">char</code>.
|
163 |
+
</p>
|
164 |
+
<div class="code-editor mb-4">
|
165 |
+
<pre><code>// Variable declaration and initialization
|
166 |
+
int age = 25;
|
167 |
+
double price = 19.99;
|
168 |
+
boolean isJavaFun = true;
|
169 |
+
char grade = 'A';
|
170 |
+
|
171 |
+
// Constants (cannot be changed)
|
172 |
+
final double PI = 3.14159;</code></pre>
|
173 |
+
</div>
|
174 |
+
</div>
|
175 |
+
<div>
|
176 |
+
<h3 class="text-xl font-medium text-gray-800 mb-3">Python Variables</h3>
|
177 |
+
<p class="text-gray-600 mb-4">
|
178 |
+
Python is dynamically typed - you don't need to declare variable types.
|
179 |
+
Common types include <code class="bg-gray-100 px-1 rounded">int</code>, <code class="bg-gray-100 px-1 rounded">float</code>,
|
180 |
+
<code class="bg-gray-100 px-1 rounded">bool</code>, <code class="bg-gray-100 px-1 rounded">str</code>, and <code class="bg-gray-100 px-1 rounded">list</code>.
|
181 |
+
</p>
|
182 |
+
<div class="code-editor mb-4">
|
183 |
+
<pre><code># Variable assignment
|
184 |
+
age = 25
|
185 |
+
price = 19.99
|
186 |
+
is_python_fun = True
|
187 |
+
grade = 'A'
|
188 |
+
|
189 |
+
# Constants (by convention, not enforced)
|
190 |
+
PI = 3.14159</code></pre>
|
191 |
+
</div>
|
192 |
+
</div>
|
193 |
+
</div>
|
194 |
+
|
195 |
+
<div class="bg-blue-50 p-6 rounded-lg border border-blue-100 mb-8">
|
196 |
+
<h3 class="text-lg font-medium text-blue-800 mb-3 flex items-center">
|
197 |
+
<i class="fas fa-lightbulb mr-2 text-blue-600"></i>
|
198 |
+
Key Differences
|
199 |
+
</h3>
|
200 |
+
<ul class="list-disc pl-5 text-gray-700 space-y-2">
|
201 |
+
<li><strong>Type Declaration:</strong> Java requires explicit type declaration, Python infers types</li>
|
202 |
+
<li><strong>Constants:</strong> Java has <code class="bg-blue-100 px-1 rounded">final</code> keyword, Python uses naming conventions (UPPER_CASE)</li>
|
203 |
+
<li><strong>Strings:</strong> Java uses double quotes, Python can use single or double quotes</li>
|
204 |
+
<li><strong>Boolean Values:</strong> Java uses <code class="bg-blue-100 px-1 rounded">true</code>/<code class="bg-blue-100 px-1 rounded">false</code>, Python uses <code class="bg-blue-100 px-1 rounded">True</code>/<code class="bg-blue-100 px-1 rounded">False</code></li>
|
205 |
+
</ul>
|
206 |
+
</div>
|
207 |
+
|
208 |
+
<!-- Interactive Exercise -->
|
209 |
+
<div class="bg-white border border-gray-200 rounded-lg p-6 shadow-sm">
|
210 |
+
<h3 class="text-xl font-medium text-gray-800 mb-4 flex items-center">
|
211 |
+
<i class="fas fa-pencil-alt mr-3 text-green-500"></i>
|
212 |
+
Interactive Exercise
|
213 |
+
</h3>
|
214 |
+
|
215 |
+
<div class="mb-6">
|
216 |
+
<div class="flex border-b border-gray-200 mb-4">
|
217 |
+
<button class="tab-button active px-4 py-2 text-blue-600" onclick="changeTab('exercise1', 'java')">
|
218 |
+
Java
|
219 |
+
</button>
|
220 |
+
<button class="tab-button px-4 py-2 text-green-600" onclick="changeTab('exercise1', 'python')">
|
221 |
+
Python
|
222 |
+
</button>
|
223 |
+
</div>
|
224 |
+
|
225 |
+
<div id="exercise1-java" class="exercise-content">
|
226 |
+
<p class="text-gray-600 mb-4">
|
227 |
+
Fix the variable declarations in this Java code. There are 3 errors to correct.
|
228 |
+
</p>
|
229 |
+
<div class="code-editor mb-4">
|
230 |
+
<pre id="java-code" contenteditable="true">public class Main {
|
231 |
+
public static void main(String[] args) {
|
232 |
+
// Fix these variable declarations
|
233 |
+
int count = "10";
|
234 |
+
double average = 3.5
|
235 |
+
boolean isCorrect = "true";
|
236 |
+
char initial = A;
|
237 |
+
|
238 |
+
System.out.println("Count: " + count);
|
239 |
+
}
|
240 |
+
}</pre>
|
241 |
+
</div>
|
242 |
+
<button onclick="checkExercise('java')" class="bg-blue-600 text-white px-4 py-2 rounded-md hover:bg-blue-700 transition">
|
243 |
+
Check Solution
|
244 |
+
</button>
|
245 |
+
<div id="java-feedback" class="mt-3 hidden"></div>
|
246 |
+
</div>
|
247 |
+
|
248 |
+
<div id="exercise1-python" class="exercise-content hidden">
|
249 |
+
<p class="text-gray-600 mb-4">
|
250 |
+
Complete the Python code to calculate the area of a rectangle. Use variables <code class="bg-gray-100 px-1 rounded">length</code> and <code class="bg-gray-100 px-1 rounded">width</code>.
|
251 |
+
</p>
|
252 |
+
<div class="code-editor mb-4">
|
253 |
+
<pre id="python-code" contenteditable="true"># Calculate rectangle area
|
254 |
+
length = 5
|
255 |
+
width = 3
|
256 |
+
# Your code here
|
257 |
+
|
258 |
+
print(f"The area is: {area}")</pre>
|
259 |
+
</div>
|
260 |
+
<button onclick="checkExercise('python')" class="bg-green-600 text-white px-4 py-2 rounded-md hover:bg-green-700 transition">
|
261 |
+
Check Solution
|
262 |
+
</button>
|
263 |
+
<div id="python-feedback" class="mt-3 hidden"></div>
|
264 |
+
</div>
|
265 |
+
</div>
|
266 |
+
</div>
|
267 |
+
</div>
|
268 |
+
</section>
|
269 |
+
|
270 |
+
<!-- Lesson 2: Control Structures -->
|
271 |
+
<section class="mb-16 bg-white rounded-xl shadow-lg overflow-hidden">
|
272 |
+
<div class="p-6">
|
273 |
+
<h2 class="text-2xl font-semibold text-gray-800 mb-6 flex items-center">
|
274 |
+
<i class="fas fa-code-branch mr-3 text-blue-500"></i>
|
275 |
+
Lesson 2: Control Structures
|
276 |
+
</h2>
|
277 |
+
|
278 |
+
<div class="grid grid-cols-1 md:grid-cols-2 gap-8 mb-8">
|
279 |
+
<div>
|
280 |
+
<h3 class="text-xl font-medium text-gray-800 mb-3">Java Control Structures</h3>
|
281 |
+
<p class="text-gray-600 mb-4">
|
282 |
+
Java uses traditional C-style control structures with curly braces <code class="bg-gray-100 px-1 rounded">{}</code>.
|
283 |
+
</p>
|
284 |
+
<div class="code-editor mb-4">
|
285 |
+
<pre><code>// If-else statement
|
286 |
+
int score = 85;
|
287 |
+
if (score >= 90) {
|
288 |
+
System.out.println("A");
|
289 |
+
} else if (score >= 80) {
|
290 |
+
System.out.println("B");
|
291 |
+
} else {
|
292 |
+
System.out.println("C");
|
293 |
+
}
|
294 |
+
|
295 |
+
// For loop
|
296 |
+
for (int i = 0; i < 5; i++) {
|
297 |
+
System.out.println(i);
|
298 |
+
}
|
299 |
+
|
300 |
+
// While loop
|
301 |
+
int count = 0;
|
302 |
+
while (count < 3) {
|
303 |
+
System.out.println(count);
|
304 |
+
count++;
|
305 |
+
}</code></pre>
|
306 |
+
</div>
|
307 |
+
</div>
|
308 |
+
<div>
|
309 |
+
<h3 class="text-xl font-medium text-gray-800 mb-3">Python Control Structures</h3>
|
310 |
+
<p class="text-gray-600 mb-4">
|
311 |
+
Python uses indentation (whitespace) to define code blocks instead of curly braces.
|
312 |
+
</p>
|
313 |
+
<div class="code-editor mb-4">
|
314 |
+
<pre><code># If-elif-else statement
|
315 |
+
score = 85
|
316 |
+
if score >= 90:
|
317 |
+
print("A")
|
318 |
+
elif score >= 80:
|
319 |
+
print("B")
|
320 |
+
else:
|
321 |
+
print("C")
|
322 |
+
|
323 |
+
# For loop (often used with range())
|
324 |
+
for i in range(5):
|
325 |
+
print(i)
|
326 |
+
|
327 |
+
# While loop
|
328 |
+
count = 0
|
329 |
+
while count < 3:
|
330 |
+
print(count)
|
331 |
+
count += 1</code></pre>
|
332 |
+
</div>
|
333 |
+
</div>
|
334 |
+
</div>
|
335 |
+
|
336 |
+
<!-- Control Structures Exercise -->
|
337 |
+
<div class="bg-white border border-gray-200 rounded-lg p-6 shadow-sm">
|
338 |
+
<h3 class="text-xl font-medium text-gray-800 mb-4 flex items-center">
|
339 |
+
<i class="fas fa-puzzle-piece mr-3 text-purple-500"></i>
|
340 |
+
Control Structures Challenge
|
341 |
+
</h3>
|
342 |
+
|
343 |
+
<div class="mb-6">
|
344 |
+
<div class="flex border-b border-gray-200 mb-4">
|
345 |
+
<button class="tab-button active px-4 py-2 text-blue-600" onclick="changeTab('exercise2', 'java')">
|
346 |
+
Java
|
347 |
+
</button>
|
348 |
+
<button class="tab-button px-4 py-2 text-green-600" onclick="changeTab('exercise2', 'python')">
|
349 |
+
Python
|
350 |
+
</button>
|
351 |
+
</div>
|
352 |
+
|
353 |
+
<div id="exercise2-java" class="exercise-content">
|
354 |
+
<p class="text-gray-600 mb-4">
|
355 |
+
Write a Java program that prints numbers from 1 to 100. For multiples of 3 print "Fizz",
|
356 |
+
for multiples of 5 print "Buzz", and for multiples of both print "FizzBuzz".
|
357 |
+
</p>
|
358 |
+
<div class="code-editor mb-4">
|
359 |
+
<pre id="java-control-code" contenteditable="true">public class FizzBuzz {
|
360 |
+
public static void main(String[] args) {
|
361 |
+
// Your code here
|
362 |
+
|
363 |
+
|
364 |
+
}
|
365 |
+
}</pre>
|
366 |
+
</div>
|
367 |
+
<button onclick="checkControlExercise('java')" class="bg-blue-600 text-white px-4 py-2 rounded-md hover:bg-blue-700 transition">
|
368 |
+
Check Solution
|
369 |
+
</button>
|
370 |
+
<div id="java-control-feedback" class="mt-3 hidden"></div>
|
371 |
+
</div>
|
372 |
+
|
373 |
+
<div id="exercise2-python" class="exercise-content hidden">
|
374 |
+
<p class="text-gray-600 mb-4">
|
375 |
+
Write the same FizzBuzz program in Python. Remember Python uses indentation for blocks!
|
376 |
+
</p>
|
377 |
+
<div class="code-editor mb-4">
|
378 |
+
<pre id="python-control-code" contenteditable="true"># FizzBuzz in Python
|
379 |
+
# Your code here
|
380 |
+
|
381 |
+
|
382 |
+
|
383 |
+
</pre>
|
384 |
+
</div>
|
385 |
+
<button onclick="checkControlExercise('python')" class="bg-green-600 text-white px-4 py-2 rounded-md hover:bg-green-700 transition">
|
386 |
+
Check Solution
|
387 |
+
</button>
|
388 |
+
<div id="python-control-feedback" class="mt-3 hidden"></div>
|
389 |
+
</div>
|
390 |
+
</div>
|
391 |
+
</div>
|
392 |
+
</div>
|
393 |
+
</section>
|
394 |
+
|
395 |
+
<!-- Additional Practice -->
|
396 |
+
<section class="mb-16">
|
397 |
+
<h2 class="text-2xl font-semibold text-gray-800 mb-6 text-center">Additional Practice Exercises</h2>
|
398 |
+
|
399 |
+
<div class="grid grid-cols-1 md:grid-cols-3 gap-6">
|
400 |
+
<div class="exercise-card bg-white p-6 rounded-lg shadow-md border border-gray-100">
|
401 |
+
<div class="bg-blue-100 w-12 h-12 rounded-full flex items-center justify-center mb-4 text-blue-600">
|
402 |
+
<i class="fas fa-calculator text-xl"></i>
|
403 |
+
</div>
|
404 |
+
<h3 class="font-medium text-gray-800 mb-2">Calculator Program</h3>
|
405 |
+
<p class="text-sm text-gray-600 mb-4">Create a simple calculator that can add, subtract, multiply, and divide two numbers.</p>
|
406 |
+
<div class="flex space-x-2">
|
407 |
+
<span class="bg-blue-100 text-blue-800 text-xs px-2 py-1 rounded">Java</span>
|
408 |
+
<span class="bg-green-100 text-green-800 text-xs px-2 py-1 rounded">Python</span>
|
409 |
+
</div>
|
410 |
+
</div>
|
411 |
+
|
412 |
+
<div class="exercise-card bg-white p-6 rounded-lg shadow-md border border-gray-100">
|
413 |
+
<div class="bg-purple-100 w-12 h-12 rounded-full flex items-center justify-center mb-4 text-purple-600">
|
414 |
+
<i class="fas fa-sort-amount-down text-xl"></i>
|
415 |
+
</div>
|
416 |
+
<h3 class="font-medium text-gray-800 mb-2">Number Guessing Game</h3>
|
417 |
+
<p class="text-sm text-gray-600 mb-4">Program generates a random number and user tries to guess it with hints.</p>
|
418 |
+
<div class="flex space-x-2">
|
419 |
+
<span class="bg-blue-100 text-blue-800 text-xs px-2 py-1 rounded">Java</span>
|
420 |
+
<span class="bg-green-100 text-green-800 text-xs px-2 py-1 rounded">Python</span>
|
421 |
+
</div>
|
422 |
+
</div>
|
423 |
+
|
424 |
+
<div class="exercise-card bg-white p-6 rounded-lg shadow-md border border-gray-100">
|
425 |
+
<div class="bg-amber-100 w-12 h-12 rounded-full flex items-center justify-center mb-4 text-amber-600">
|
426 |
+
<i class="fas fa-user-friends text-xl"></i>
|
427 |
+
</div>
|
428 |
+
<h3 class="font-medium text-gray-800 mb-2">Student Gradebook</h3>
|
429 |
+
<p class="text-sm text-gray-600 mb-4">Store student names and grades, then calculate averages and find highest/lowest.</p>
|
430 |
+
<div class="flex space-x-2">
|
431 |
+
<span class="bg-blue-100 text-blue-800 text-xs px-2 py-1 rounded">Java</span>
|
432 |
+
<span class="bg-green-100 text-green-800 text-xs px-2 py-1 rounded">Python</span>
|
433 |
+
</div>
|
434 |
+
</div>
|
435 |
+
</div>
|
436 |
+
</section>
|
437 |
+
|
438 |
+
<!-- Resources Section -->
|
439 |
+
<section class="bg-gray-100 rounded-xl p-8 mb-16">
|
440 |
+
<h2 class="text-2xl font-semibold text-gray-800 mb-6 text-center">Learning Resources</h2>
|
441 |
+
|
442 |
+
<div class="grid grid-cols-1 md:grid-cols-2 gap-8">
|
443 |
+
<div>
|
444 |
+
<h3 class="text-xl font-medium text-gray-800 mb-4 flex items-center">
|
445 |
+
<img src="https://cdn-icons-png.flaticon.com/512/226/226777.png" alt="Java" class="w-6 h-6 mr-2">
|
446 |
+
Java Resources
|
447 |
+
</h3>
|
448 |
+
<ul class="space-y-3">
|
449 |
+
<li>
|
450 |
+
<a href="https://docs.oracle.com/javase/tutorial/" class="flex items-center text-blue-600 hover:underline">
|
451 |
+
<i class="fas fa-book mr-2"></i>
|
452 |
+
Official Java Tutorials
|
453 |
+
</a>
|
454 |
+
</li>
|
455 |
+
<li>
|
456 |
+
<a href="https://www.codecademy.com/learn/learn-java" class="flex items-center text-blue-600 hover:underline">
|
457 |
+
<i class="fas fa-laptop-code mr-2"></i>
|
458 |
+
Codecademy Java Course
|
459 |
+
</a>
|
460 |
+
</li>
|
461 |
+
<li>
|
462 |
+
<a href="https://codingbat.com/java" class="flex items-center text-blue-600 hover:underline">
|
463 |
+
<i class="fas fa-edit mr-2"></i>
|
464 |
+
CodingBat Java Practice
|
465 |
+
</a>
|
466 |
+
</li>
|
467 |
+
</ul>
|
468 |
+
</div>
|
469 |
+
|
470 |
+
<div>
|
471 |
+
<h3 class="text-xl font-medium text-gray-800 mb-4 flex items-center">
|
472 |
+
<img src="https://cdn-icons-png.flaticon.com/512/5968/5968350.png" alt="Python" class="w-6 h-6 mr-2">
|
473 |
+
Python Resources
|
474 |
+
</h3>
|
475 |
+
<ul class="space-y-3">
|
476 |
+
<li>
|
477 |
+
<a href="https://docs.python.org/3/tutorial/" class="flex items-center text-green-600 hover:underline">
|
478 |
+
<i class="fas fa-book mr-2"></i>
|
479 |
+
Official Python Tutorial
|
480 |
+
</a>
|
481 |
+
</li>
|
482 |
+
<li>
|
483 |
+
<a href="https://www.learnpython.org/" class="flex items-center text-green-600 hover:underline">
|
484 |
+
<i class="fas fa-laptop-code mr-2"></i>
|
485 |
+
LearnPython Interactive Tutorial
|
486 |
+
</a>
|
487 |
+
</li>
|
488 |
+
<li>
|
489 |
+
<a href="https://leetcode.com/problemset/all/" class="flex items-center text-green-600 hover:underline">
|
490 |
+
<i class="fas fa-edit mr-2"></i>
|
491 |
+
LeetCode Python Problems
|
492 |
+
</a>
|
493 |
+
</li>
|
494 |
+
</ul>
|
495 |
+
</div>
|
496 |
+
</div>
|
497 |
+
</section>
|
498 |
+
|
499 |
+
<footer class="text-center text-gray-600 text-sm mb-8">
|
500 |
+
<p>Happy coding! Remember that consistent practice is key to mastering programming.</p>
|
501 |
+
<p class="mt-2">Created with β€οΈ using HTML, CSS, and JavaScript</p>
|
502 |
+
</footer>
|
503 |
+
</div>
|
504 |
+
|
505 |
+
<script>
|
506 |
+
// Tab switching functionality
|
507 |
+
function changeTab(exerciseId, language) {
|
508 |
+
// Hide all exercise contents for this exercise
|
509 |
+
document.querySelectorAll(`#${exerciseId}-java, #${exerciseId}-python`).forEach(el => {
|
510 |
+
el.classList.add('hidden');
|
511 |
+
});
|
512 |
+
|
513 |
+
// Show selected exercise content
|
514 |
+
document.getElementById(`${exerciseId}-${language}`).classList.remove('hidden');
|
515 |
+
|
516 |
+
// Update tab buttons
|
517 |
+
const buttons = document.querySelectorAll(`#${exerciseId}-java, #${exerciseId}-python`).forEach(el => {
|
518 |
+
el.parentNode.querySelectorAll('.tab-button').forEach(btn => {
|
519 |
+
btn.classList.remove('active');
|
520 |
+
});
|
521 |
+
});
|
522 |
+
|
523 |
+
event.target.classList.add('active');
|
524 |
+
}
|
525 |
+
|
526 |
+
// Exercise checking functionality
|
527 |
+
function checkExercise(language) {
|
528 |
+
const feedbackId = `${language}-feedback`;
|
529 |
+
const feedbackElement = document.getElementById(feedbackId);
|
530 |
+
|
531 |
+
if (language === 'java') {
|
532 |
+
const code = document.getElementById('java-code').textContent;
|
533 |
+
// Check for common mistakes
|
534 |
+
if (code.includes('int count = "10"')) {
|
535 |
+
showFeedback(feedbackElement, "β Error: You can't assign a String to an int variable", false);
|
536 |
+
} else if (code.includes('double average = 3.5')) {
|
537 |
+
showFeedback(feedbackElement, "β Error: Missing semicolon after 3.5", false);
|
538 |
+
} else if (code.includes('boolean isCorrect = "true"')) {
|
539 |
+
showFeedback(feedbackElement, "β Error: Boolean values don't use quotes", false);
|
540 |
+
} else if (code.includes('char initial = A')) {
|
541 |
+
showFeedback(feedbackElement, "β Error: Char values need single quotes", false);
|
542 |
+
} else {
|
543 |
+
showFeedback(feedbackElement, "β
Correct! All variable declarations are fixed!", true);
|
544 |
+
}
|
545 |
+
} else { // python
|
546 |
+
const code = document.getElementById('python-code').textContent;
|
547 |
+
if (code.includes('area = length * width')) {
|
548 |
+
showFeedback(feedbackElement, "β
Correct! The area is calculated properly.", true);
|
549 |
+
} else {
|
550 |
+
showFeedback(feedbackElement, "β Try calculating the area by multiplying length and width", false);
|
551 |
+
}
|
552 |
+
}
|
553 |
+
}
|
554 |
+
|
555 |
+
function checkControlExercise(language) {
|
556 |
+
const feedbackId = `${language}-control-feedback`;
|
557 |
+
const feedbackElement = document.getElementById(feedbackId);
|
558 |
+
|
559 |
+
if (language === 'java') {
|
560 |
+
const code = document.getElementById('java-control-code').textContent;
|
561 |
+
if (code.includes("if (i % 15 == 0)") ||
|
562 |
+
(code.includes("i % 3 == 0") && code.includes("i % 5 == 0"))) {
|
563 |
+
showFeedback(feedbackElement, "β
Excellent FizzBuzz implementation!", true);
|
564 |
+
} else if (code.includes("System.out.println") && code.includes("for")) {
|
565 |
+
showFeedback(feedbackElement, "β οΈ Close! Did you handle the FizzBuzz case (divisible by 3 and 5)?", false);
|
566 |
+
} else {
|
567 |
+
showFeedback(feedbackElement, "β Try using a for loop and if-else conditions", false);
|
568 |
+
}
|
569 |
+
} else { // python
|
570 |
+
const code = document.getElementById('python-control-code').textContent;
|
571 |
+
if (code.includes("if i % 15 == 0") ||
|
572 |
+
(code.includes("i % 3 == 0") && code.includes("i % 5 == 0"))) {
|
573 |
+
showFeedback(feedbackElement, "β
Perfect Python FizzBuzz solution!", true);
|
574 |
+
} else if (code.includes("print") && code.includes("for i in range")) {
|
575 |
+
showFeedback(feedbackElement, "β οΈ Almost there! Check your conditions for FizzBuzz", false);
|
576 |
+
} else {
|
577 |
+
showFeedback(feedbackElement, "β Remember Python uses indentation and elif", false);
|
578 |
+
}
|
579 |
+
}
|
580 |
+
}
|
581 |
+
|
582 |
+
function showFeedback(element, message, isSuccess) {
|
583 |
+
element.classList.remove('hidden');
|
584 |
+
element.textContent = message;
|
585 |
+
element.className = isSuccess ? 'mt-3 text-green-600' : 'mt-3 text-red-600';
|
586 |
+
}
|
587 |
+
</script>
|
588 |
+
<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=Puretarantino/learning-tools" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
|
589 |
+
</html>
|
prompts.txt
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
What is flex
|
2 |
+
Continue with a full detailed lesson that will teach me Java , python the basics. Take as much time needed to assemble this rubric learning tool the goal is to teach real users a skill in this this photo is the theme place it somewhere
|