prthm11 commited on
Commit
ba9769b
·
verified ·
1 Parent(s): 3f7a37b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -1283,7 +1283,7 @@ def pseudo_generator_node(state: GameState):
1283
  for t in project_json["targets"] if t.get("isStage")
1284
  for c in t.get("costumes", [])
1285
  ]
1286
- refinement_prompt = """
1287
  You are an expert Scratch 3.0 programmer. Your task is to analyze an image of Scratch code blocks and convert it into a structured JSON object containing precise pseudocode.
1288
 
1289
  ---
@@ -1306,7 +1306,7 @@ You are an expert Scratch 3.0 programmer. Your task is to analyze an image of Sc
1306
  - **Reporter Blocks:** Enclose in double parentheses. `((x position))`.
1307
  - **Boolean Conditions:** Enclose in angle brackets. `<((score)) > (50)>`, `<not <touching [edge v]?>>`.
1308
  - **Line Breaks:** Use `\n` to separate each block onto a new line. The entire pseudocode must be a single JSON string.
1309
- - **Indentation:** Use **4 spaces** to indent blocks nested inside C-Blocks (like `if`, `repeat`, `forever`).
1310
  - **Termination:**
1311
  - **Every script** (starting with a hat block) MUST conclude with `end`.
1312
  - **Every C-Block** (`if`, `repeat`, `forever`) MUST also have its own corresponding `end` at the correct indentation level. This is critical.
 
1283
  for t in project_json["targets"] if t.get("isStage")
1284
  for c in t.get("costumes", [])
1285
  ]
1286
+ refinement_prompt = f"""
1287
  You are an expert Scratch 3.0 programmer. Your task is to analyze an image of Scratch code blocks and convert it into a structured JSON object containing precise pseudocode.
1288
 
1289
  ---
 
1306
  - **Reporter Blocks:** Enclose in double parentheses. `((x position))`.
1307
  - **Boolean Conditions:** Enclose in angle brackets. `<((score)) > (50)>`, `<not <touching [edge v]?>>`.
1308
  - **Line Breaks:** Use `\n` to separate each block onto a new line. The entire pseudocode must be a single JSON string.
1309
+ - **Indentation:** Use **4 spaces** to indent blocks nested inside C-Blocks (like `if`, `if else`, `repeat`, `forever`).
1310
  - **Termination:**
1311
  - **Every script** (starting with a hat block) MUST conclude with `end`.
1312
  - **Every C-Block** (`if`, `repeat`, `forever`) MUST also have its own corresponding `end` at the correct indentation level. This is critical.