{
"id": "286",
"prompt": "Make me a landscape Ready-Up app (dims() packing 480x270): a JOIN/LEAVE feed toggle on the left that fills green while is_subscribed(), a big READY UP panel on the right that fires host::agent::broadcast_compose so the presser types the message before it reaches every subscriber, the live subscriber_count() as a MEMBERS line, and an amber footer strip when viewer_has_identity() is 0 - in that state ANY tap routes to request_identity() first.",
"solution_rl": "fn dims() -> i32 {\n (480 << 16) | 270\n}\n\nfn frame(t: i32) {\n host::display::clear(0x0b0e12);\n let has: i32 = host::agent::viewer_has_identity();\n let subbed: i32 = host::agent::is_subscribed();\n let count: i32 = host::agent::subscriber_count();\n\n let mut subcol: i32 = 0x222a33;\n if subbed == 1 {\n subcol = 0x1a5c2a;\n }\n host::display::fill_rect(20, 60, 200, 150, subcol);\n if subbed == 1 {\n host::display::draw_string(58, 120, \"LEAVE\", 0x99ffbb, 3);\n } else {\n host::display::draw_string(66, 120, \"JOIN\", 0xffffff, 3);\n }\n\n host::display::fill_rect(260, 60, 200, 150, 0xdddddd);\n host::display::draw_string(288, 110, \"READY\", 0x000000, 3);\n host::display::draw_string(320, 145, \"UP\", 0x000000, 3);\n\n host::display::draw_string(20, 20, \"SQUAD FEED\", 0x8899aa, 2);\n host::display::draw_string(20, 235, \"MEMBERS\", 0x556677, 1);\n host::display::draw_number(90, 231, count, 0xffffff, 2);\n if has == 0 {\n host::display::fill_rect(0, 255, 480, 15, 0x6b3a16);\n host::display::draw_string(120, 259, \"TAP ANYWHERE TO GET AN IDENTITY\", 0xffcc88, 1);\n }\n\n let down: i32 = host::display::pointer_down();\n let prev: i32 = host::display::state_get(0);\n host::display::state_set(0, down);\n if down == 1 && prev == 0 {\n if has == 0 {\n host::agent::request_identity();\n } else {\n let px: i32 = host::display::pointer_x();\n let py: i32 = host::display::pointer_y();\n if py >= 60 && py < 210 {\n if px >= 20 && px < 220 {\n if subbed == 1 {\n host::agent::unsubscribe();\n } else {\n host::agent::subscribe();\n }\n }\n if px >= 260 && px < 460 {\n host::agent::broadcast_compose(\"Ready Up!\", \"Lobby is open - get in here.\");\n }\n }\n }\n }\n host::display::present();\n}\n",
"tags": [
"agent",
"feed",
"dims"
]
}