Skip to content

Commit b375f4c

Browse files
committed
Reordered exercises and improved formulations
1 parent 583d100 commit b375f4c

1 file changed

Lines changed: 55 additions & 47 deletions

File tree

lib/utils/my_exercises.dart

Lines changed: 55 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -3,42 +3,65 @@ import 'package:code_juge/utils/exercise_datamodell.dart';
33
class MyExercises {
44
final List<ExerciseDatamodell> exercises = [
55

6+
// Difficulty Level 0
7+
ExerciseDatamodell(
8+
name: "Message Length Analyzer",
9+
description: "Basic string processing.",
10+
task: "A system receives the identifier string \"HelloWorld\". "
11+
"Determine how many characters this identifier contains and output the number.",
12+
solution: "10",
13+
difficultyLevel: 0,
14+
),
15+
16+
// Difficulty Level 1
617
ExerciseDatamodell(
718
name: "Energy Pulse Calculation",
819
description: "A basic mathematical operation involving exponentiation.",
9-
task: "In a physics simulation, a small energy pulse has an intensity value of 12 units. "
20+
task: "In a physics simulation, a small energy pulse has an intensity of 12 units. "
1021
"The total energy released is defined as the square of this intensity. "
11-
"Calculate the energy released and output the resulting value.",
22+
"Calculate and output the resulting energy value.",
1223
solution: "144",
1324
difficultyLevel: 1,
1425
hint: "You only need to multiply the number by itself.",
1526
),
27+
ExerciseDatamodell(
28+
name: "Character Encoding Lookup",
29+
description: "Understanding ASCII encoding.",
30+
task: "In a low-level communication protocol, the character 'A' is transmitted. "
31+
"Determine the ASCII value of 'A' and output it.",
32+
solution: "65",
33+
difficultyLevel: 1,
34+
),
35+
36+
// Difficulty Level 2
1637
ExerciseDatamodell(
1738
name: "Accumulated Workload",
1839
description: "Summation of a numerical series.",
1940
task: "A researcher records daily workload values from day 1 to day 50. "
20-
"To estimate the total effort, calculate the sum of all integers from 1 to 50 and output the result.",
41+
"Calculate the sum of all integers from 1 to 50 and output the result.",
2142
solution: "1275",
2243
difficultyLevel: 2,
2344
hint: "A loop or a mathematical formula can help you sum consecutive numbers.",
2445
),
2546
ExerciseDatamodell(
2647
name: "Sensor Data Averaging",
2748
description: "Working with multiple fixed numeric values.",
28-
task: "A measurement device produced the following readings: 4, 18, 22, 9, and 17. "
29-
"To smooth out fluctuations, compute the average of these five values and output the result as a whole number.",
49+
task: "A measurement device produced the readings: 4, 18, 22, 9, and 17. "
50+
"Compute the average of these five values and output the result as a whole number.",
3051
solution: "14",
3152
difficultyLevel: 2,
3253
),
3354
ExerciseDatamodell(
3455
name: "Weather Station Conversion",
3556
description: "Applying a temperature conversion formula.",
3657
task: "A weather station reports a temperature of 68°F. "
37-
"Convert this value to Celsius using the standard formula and output the result as a whole number.",
58+
"Convert this value to Celsius using the standard formula and output the whole-number result.",
3859
solution: "20",
3960
difficultyLevel: 2,
40-
hint: "Use the formula: 1°C = (1°F - 32) × 5/9.",
61+
hint: "Use the formula: (°F - 32) × 5/9.",
4162
),
63+
64+
// Difficulty Level 3
4265
ExerciseDatamodell(
4366
name: "Circular Field Area",
4467
description: "Applying geometric formulas.",
@@ -47,22 +70,6 @@ class MyExercises {
4770
solution: "154",
4871
difficultyLevel: 3,
4972
),
50-
ExerciseDatamodell(
51-
name: "Message Length Analyzer",
52-
description: "Basic string processing.",
53-
task: "A system receives the identifier string \"HelloWorld\". "
54-
"Determine how many characters this identifier contains and output the number.",
55-
solution: "10",
56-
difficultyLevel: 1,
57-
),
58-
ExerciseDatamodell(
59-
name: "Character Encoding Lookup",
60-
description: "Understanding ASCII encoding.",
61-
task: "In a low-level communication protocol, the character 'A' is transmitted. "
62-
"Determine the ASCII value of 'A' and output it.",
63-
solution: "65",
64-
difficultyLevel: 1,
65-
),
6673
ExerciseDatamodell(
6774
name: "Fibonacci Growth Model",
6875
description: "Working with a classical recursive sequence.",
@@ -72,6 +79,8 @@ class MyExercises {
7279
difficultyLevel: 3,
7380
hint: "Each number is the sum of the previous two.",
7481
),
82+
83+
// Difficulty Level 4
7584
ExerciseDatamodell(
7685
name: "Prime Distribution Analysis",
7786
description: "Algorithmic reasoning with number theory.",
@@ -90,60 +99,59 @@ class MyExercises {
9099
difficultyLevel: 4,
91100
hint: "The main diagonal uses indices [0][0], [1][1], [2][2].",
92101
),
102+
ExerciseDatamodell(
103+
name: "Array Rotation Mechanism",
104+
description: "Array manipulation and index shifting.",
105+
task: "Rotate the array [1, 2, 3, 4, 5, 6] three positions to the right. "
106+
"Output the resulting array as a comma-separated string.",
107+
solution: "4,5,6,1,2,3",
108+
difficultyLevel: 4,
109+
hint: "Elements moved off the end reappear at the beginning.",
110+
),
111+
112+
// Difficulty Level 5
93113
ExerciseDatamodell(
94114
name: "Encrypted Transmission Decoder",
95-
description: "A challenging task involving character shifting and basic cryptographic transformation.",
115+
description: "Decoding a Caesar cipher with character shifting.",
96116
task: "A satellite sends the encrypted message \"KHOORZRUOG\" using a Caesar cipher with a shift of +3. "
97-
"Write a program that decodes the message by reversing the shift and outputs the original plaintext.",
117+
"Decode the message by reversing the shift and output the original plaintext.",
98118
solution: "HELLOWORLD",
99119
difficultyLevel: 5,
100-
hint: "In a Caesar cipher with a shift of +3, each letter in the encrypted text was moved three positions forward in the alphabet. "
101-
"To decode it, shift each letter three positions backward (e.g., D → A, E → B). "
102-
"Remember that the alphabet wraps around.",
120+
hint: "Shift each letter three positions backward. The alphabet wraps around.",
103121
),
104122
ExerciseDatamodell(
105123
name: "Lexicographical Sort Engine",
106-
description: "Implementing a sorting algorithm without relying on built-in sort functions.",
107-
task: "A dataset contains the following words: [\"zebra\", \"apple\", \"moon\", \"delta\", \"car\"]. "
124+
description: "Implementing a sorting algorithm without built-in sort functions.",
125+
task: "A dataset contains the words: [\"zebra\", \"apple\", \"moon\", \"delta\", \"car\"]. "
108126
"Sort these words in ascending lexicographical order using your own sorting logic and output them "
109-
"as a single string separated by commas.",
127+
"as a single comma-separated string.",
110128
solution: "apple,car,delta,moon,zebra",
111129
difficultyLevel: 5,
112130
hint: "Compare strings character by character, similar to dictionary order.",
113131
),
114132
ExerciseDatamodell(
115133
name: "Maximum Frequency Analyzer",
116-
description: "A frequency-counting task requiring iteration and comparison logic.",
134+
description: "A frequency-counting task requiring iteration and comparison.",
117135
task: "Given the string \"MISSISSIPPI\", determine which character appears most frequently. "
118-
"If multiple characters have the same highest frequency, output the alphabetically first one. "
119-
"Output only the character.",
136+
"If multiple characters tie, output the alphabetically first one.",
120137
solution: "I",
121138
difficultyLevel: 5,
122139
),
123140
ExerciseDatamodell(
124141
name: "Binary Search Simulation",
125-
description: "Simulating a binary search manually on a fixed dataset.",
142+
description: "Simulating a binary search on a fixed dataset.",
126143
task: "You are given the sorted array [3, 8, 15, 23, 42, 56, 78, 91]. "
127-
"Simulate a binary search for the value 42 and output the index at which it is found. "
144+
"Simulate a binary search for the value 42 and output the index where it is found. "
128145
"Use zero-based indexing.",
129146
solution: "4",
130147
difficultyLevel: 5,
131148
hint: "Binary search repeatedly halves the search interval.",
132149
),
133-
ExerciseDatamodell(
134-
name: "Array Rotation Mechanism",
135-
description: "A task involving array manipulation and index shifting.",
136-
task: "Rotate the array [1, 2, 3, 4, 5, 6] three positions to the right. "
137-
"Output the resulting array as a comma-separated string.",
138-
solution: "4,5,6,1,2,3",
139-
difficultyLevel: 4,
140-
hint: "Elements moved off the end reappear at the beginning.",
141-
),
142150
ExerciseDatamodell(
143151
name: "Checksum Validator",
144-
description: "A more advanced algorithmic task involving weighted summation.",
152+
description: "A weighted summation task for validating numeric codes.",
145153
task: "A device generates the identification code \"57281\". "
146-
"To validate it, compute the checksum by multiplying each digit by its 1-based index "
154+
"Compute the checksum by multiplying each digit by its 1-based index "
147155
"(first digit × 1, second digit × 2, ...). "
148156
"Sum all products and output the checksum.",
149157
solution: "62",

0 commit comments

Comments
 (0)