informatiCup / informatiCup2023

Der InformatiCup 2023
6 stars 4 forks source link

Simulator does not handle cli (Task + Solution) files anymore #12

Open herrmanno opened 1 year ago

herrmanno commented 1 year ago

It seems the Simulator at https://profit.phinau.de does not handly imports of cli files (JSON-Array of Task + Solution) anymore. I'm pretty sure it did some time ago. I append an old JSON file of mine, which I used to test in the simulator.

[{"width":40,"height":20,"objects":[{"type":"deposit","x":5,"y":0,"subtype":0,"width":3,"height":3},{"type":"deposit","x":5,"y":4,"subtype":1,"width":8,"height":5},{"type":"obstacle","x":0,"y":14,"width":40,"height":1}],"products":[{"type":"product","subtype":0,"resources":[10,0,0,0,0,0,0,0],"points":10}],"turns":100},[{"type":"conveyor","x":1,"y":0,"subtype":0},{"type":"conveyor","x":0,"y":3,"subtype":1},{"type":"conveyor","x":1,"y":6,"subtype":2},{"type":"conveyor","x":0,"y":9,"subtype":3},{"type":"conveyor","x":15,"y":0,"subtype":4},{"type":"conveyor","x":14,"y":3,"subtype":5},{"type":"conveyor","x":15,"y":7,"subtype":6},{"type":"conveyor","x":14,"y":10,"subtype":7},{"type":"mine","x":1,"y":16,"subtype":0},{"type":"mine","x":5,"y":17,"subtype":1},{"type":"mine","x":9,"y":17,"subtype":2},{"type":"mine","x":13,"y":17,"subtype":3},{"type":"combiner","x":20,"y":17,"subtype":0},{"type":"combiner","x":24,"y":17,"subtype":1},{"type":"combiner","x":28,"y":17,"subtype":2},{"type":"combiner","x":32,"y":17,"subtype":3},{"type":"factory","x":20,"y":0,"subtype":0},{"type":"factory","x":20,"y":7,"subtype":1}]]
bitflipp commented 1 year ago

Yes, this file format has been deprecated.

Let your list be named cliJSON. You may append cliJSON[1] to cliJSON[0].objects and use cliJSON[0] as input object:

{"width":40,"height":20,"objects":[{"type":"deposit","x":5,"y":0,"subtype":0,"width":3,"height":3},{"type":"deposit","x":5,"y":4,"subtype":1,"width":8,"height":5},{"type":"obstacle","x":0,"y":14,"width":40,"height":1},{"type":"conveyor","x":1,"y":0,"subtype":0},{"type":"conveyor","x":0,"y":3,"subtype":1},{"type":"conveyor","x":1,"y":6,"subtype":2},{"type":"conveyor","x":0,"y":9,"subtype":3},{"type":"conveyor","x":15,"y":0,"subtype":4},{"type":"conveyor","x":14,"y":3,"subtype":5},{"type":"conveyor","x":15,"y":7,"subtype":6},{"type":"conveyor","x":14,"y":10,"subtype":7},{"type":"mine","x":1,"y":16,"subtype":0},{"type":"mine","x":5,"y":17,"subtype":1},{"type":"mine","x":9,"y":17,"subtype":2},{"type":"mine","x":13,"y":17,"subtype":3},{"type":"combiner","x":20,"y":17,"subtype":0},{"type":"combiner","x":24,"y":17,"subtype":1},{"type":"combiner","x":28,"y":17,"subtype":2},{"type":"combiner","x":32,"y":17,"subtype":3},{"type":"factory","x":20,"y":0,"subtype":0},{"type":"factory","x":20,"y":7,"subtype":1}],"products":[{"type":"product","subtype":0,"resources":[10,0,0,0,0,0,0,0],"points":10}],"turns":100,"time":300}