Update app.py
Browse files
app.py
CHANGED
|
@@ -562,7 +562,7 @@ If you find any "Code-Blocks" then,
|
|
| 562 |
|
| 563 |
3. **Pseudo‑code formatting**:
|
| 564 |
- Represent each block or nested block on its own line.
|
| 565 |
-
- Indent nested blocks by 4 spaces under their parent (`forever`, `if`, etc.).
|
| 566 |
- No comments or explanatory text—just the block sequence.
|
| 567 |
- a natural language breakdown of each step taken after the event, formatted as a multi-line string representing pseudo-code. Ensure clarity and granularity—each described action should map closely to a Scratch block or tight sequence.
|
| 568 |
|
|
@@ -573,71 +573,57 @@ If you find any "Code-Blocks" then,
|
|
| 573 |
|
| 574 |
5. **Examples for reference**:
|
| 575 |
**Correct** pattern for a simple start script:
|
| 576 |
-
|
| 577 |
-
|
| 578 |
-
|
| 579 |
-
|
| 580 |
-
|
| 581 |
-
|
| 582 |
-
|
| 583 |
-
|
| 584 |
**Correct** pattern for updating the high score variable handling:
|
| 585 |
-
|
| 586 |
-
|
| 587 |
-
|
| 588 |
-
|
| 589 |
-
|
| 590 |
-
|
| 591 |
-
|
| 592 |
-
|
| 593 |
**Correct** pattern for level up and increase difficulty use:
|
| 594 |
-
|
| 595 |
-
|
| 596 |
-
|
| 597 |
-
|
| 598 |
-
|
| 599 |
-
|
| 600 |
**Correct** pattern for jumping mechanics use:
|
| 601 |
-
|
| 602 |
-
|
| 603 |
-
|
| 604 |
-
|
| 605 |
-
|
| 606 |
-
|
| 607 |
-
|
| 608 |
-
|
| 609 |
-
|
| 610 |
-
|
| 611 |
-
|
| 612 |
-
|
| 613 |
-
**Correct** pattern for continuos moving objects use:
|
| 614 |
-
```
|
| 615 |
-
when green flag clicked
|
| 616 |
-
go to x: (240) y: (-100)
|
| 617 |
-
set [speed v] to (-5)
|
| 618 |
-
show variable [speed v]
|
| 619 |
-
forever
|
| 620 |
-
change x by ([speed v])
|
| 621 |
-
if <((x position)) < (-240)> then
|
| 622 |
-
go to x: (240) y: (-100)
|
| 623 |
-
end
|
| 624 |
-
end
|
| 625 |
-
end
|
| 626 |
-
```
|
| 627 |
**Correct** pattern for continuos moving objects use:
|
| 628 |
-
|
| 629 |
-
|
| 630 |
-
|
| 631 |
-
|
| 632 |
-
|
| 633 |
-
|
| 634 |
-
|
| 635 |
-
|
| 636 |
-
|
| 637 |
-
|
| 638 |
-
|
| 639 |
-
|
| 640 |
-
|
| 641 |
6. **Donot** add any explaination of logic or comments to justify or explain just put the logic content in the json.
|
| 642 |
7. **Output**:
|
| 643 |
Return **only** a JSON object, using double quotes everywhere:
|
|
|
|
| 562 |
|
| 563 |
3. **Pseudo‑code formatting**:
|
| 564 |
- Represent each block or nested block on its own line.
|
| 565 |
+
- **Indent nested blocks by 4 spaces under their parent (`forever`, `if`, etc.).This is a critical requirement.**
|
| 566 |
- No comments or explanatory text—just the block sequence.
|
| 567 |
- a natural language breakdown of each step taken after the event, formatted as a multi-line string representing pseudo-code. Ensure clarity and granularity—each described action should map closely to a Scratch block or tight sequence.
|
| 568 |
|
|
|
|
| 573 |
|
| 574 |
5. **Examples for reference**:
|
| 575 |
**Correct** pattern for a simple start script:
|
| 576 |
+
```
|
| 577 |
+
when green flag clicked
|
| 578 |
+
switch backdrop to [blue sky v]
|
| 579 |
+
set [score v] to (0)
|
| 580 |
+
show variable [score v]
|
| 581 |
+
broadcast [Game Start v]
|
| 582 |
+
end
|
| 583 |
+
```
|
| 584 |
**Correct** pattern for updating the high score variable handling:
|
| 585 |
+
```
|
| 586 |
+
when I receive [Game Over v]
|
| 587 |
+
if <((score)) > (([High Score v]))> then
|
| 588 |
+
set [High Score v] to ([score v])
|
| 589 |
+
end
|
| 590 |
+
switch backdrop to [Game Over v]
|
| 591 |
+
end
|
| 592 |
+
```
|
| 593 |
**Correct** pattern for level up and increase difficulty use:
|
| 594 |
+
```
|
| 595 |
+
when I receive [Level Up v]
|
| 596 |
+
change [level v] by (1)
|
| 597 |
+
set [ballSpeed v] to ((([ballSpeed v]) * (1.1)))
|
| 598 |
+
end
|
| 599 |
+
```
|
| 600 |
**Correct** pattern for jumping mechanics use:
|
| 601 |
+
```
|
| 602 |
+
when [space v] key pressed
|
| 603 |
+
if <((y position)) = (-100)> then
|
| 604 |
+
repeat (5)
|
| 605 |
+
change y by (100)
|
| 606 |
+
wait (0.1) seconds
|
| 607 |
+
change y by (-100)
|
| 608 |
+
wait (0.1) seconds
|
| 609 |
+
end
|
| 610 |
+
end
|
| 611 |
+
end
|
| 612 |
+
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 613 |
**Correct** pattern for continuos moving objects use:
|
| 614 |
+
```
|
| 615 |
+
when green flag clicked
|
| 616 |
+
go to x: (240) y: (-100)
|
| 617 |
+
set [speed v] to (-5)
|
| 618 |
+
show variable [speed v]
|
| 619 |
+
forever
|
| 620 |
+
change x by ([speed v])
|
| 621 |
+
if <((x position)) < (-240)> then
|
| 622 |
+
go to x: (240) y: (-100)
|
| 623 |
+
end
|
| 624 |
+
end
|
| 625 |
+
end
|
| 626 |
+
```
|
| 627 |
6. **Donot** add any explaination of logic or comments to justify or explain just put the logic content in the json.
|
| 628 |
7. **Output**:
|
| 629 |
Return **only** a JSON object, using double quotes everywhere:
|