|
1 | 1 | import React, { useState, useEffect, useRef } from 'react' |
2 | 2 | import OutputComponent from './OutputComponent' |
| 3 | +import InfoComponent from './InfoComponent' |
3 | 4 |
|
4 | 5 | export default function LevelComponent() { |
5 | 6 |
|
6 | 7 | return ( |
7 | 8 | <div className="w-screen h-screen flex gap-10 p-4 font-mono overflow-hidden"> |
8 | 9 | <div className="flex gap-4 p-4 w-6/7 mx-auto"> |
9 | | - {/* Left panel */} |
10 | | - <div className="flex-1 bg-[#2a2a2a] rounded-2xl p-3 flex flex-col gap-3"> |
11 | | - |
12 | | - {/* Title */} |
13 | | - <h1 className="text-center text-5xl tracking-widest text-green-400"> |
14 | | - GLORPYTHON |
15 | | - </h1> |
16 | | - |
17 | | - {/* Code panels */} |
18 | | - <div className="flex gap-3"> |
19 | | - {/* Python */} |
20 | | - <div className="m-5 flex-1 bg-[#3a7bd5] rounded-2xl overflow-hidden"> |
21 | | - <div className="bg-[#2d5fa8] text-white text-s text-center py-2 tracking-widest font-bold"> |
22 | | - *** PYTHON CODE *** |
23 | | - </div> |
24 | | - <div className="bg-[#4a8be0] m-2 rounded-xl p-3"> |
25 | | - <pre className="text-white text-xs leading-relaxed m-0">{`nums = [1,2,3] |
26 | | - sum = 0 |
27 | | - for i in nums: |
28 | | - sum += i |
29 | | - print(sum)`}</pre> |
30 | | - </div> |
31 | | - </div> |
32 | | - |
33 | | - {/* Alien */} |
34 | | - <div className="m-5 flex-1 bg-[#2d7a3a] rounded-2xl overflow-hidden"> |
35 | | - <div className="bg-[#1f5c29] text-white text-s text-center py-2 tracking-widest font-bold"> |
36 | | - *** ALIEN CODE *** |
37 | | - </div> |
38 | | - <div className="bg-[#3a9447] m-2 rounded-xl p-3"> |
39 | | - <pre className="text-white text-xs leading-relaxed m-0">{`nums eats [1,2,3] |
40 | | - sum eats 0 |
41 | | - i eats nums slowly: |
42 | | - sum eats more i |
43 | | - print eats sum`}</pre> |
44 | | - </div> |
45 | | - </div> |
46 | | - </div> |
47 | | - |
48 | | - {/* Goal text */} |
49 | | - <div className="text-gray-300 text-m leading-relaxed text-center" > |
50 | | - <p className="mb-2">The code above are equivalent.</p> |
51 | | - <p className="mb-2">YOUR GOAL: Write a program in ALIEN CODE that outputs the<br /> |
52 | | - SQUARE OF THE LENGTH OF nums.</p> |
53 | | - <p className="mb-2">Assume nums is already defined.</p> |
54 | | - <p>(Hint: you cannot use any +-*/ or **)</p> |
55 | | - </div> |
56 | 10 |
|
| 11 | + <div className="flex-1 bg-[#2a2a2a] rounded-2xl p-3 flex flex-col gap-3"> |
| 12 | + <InfoComponent /> |
57 | 13 | </div> |
58 | 14 | <div className="flex-1 bg-[#2a2a2a] rounded-2xl p-3 flex flex-col gap-3"> |
59 | 15 | <OutputComponent /> |
|
0 commit comments