Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
herrmanno opened this issue Jan 14, 2023 · 1 comment
Open

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

herrmanno opened this issue Jan 14, 2023 · 1 comment

Comments

@herrmanno
Copy link

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
Copy link
Contributor

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}

herrmanno added a commit to herrmanno/informaticup-2023 that referenced this issue Jan 15, 2023
CLI format was changed in the meantime
(see informatiCup/informatiCup2023#12).

This commit adapts to handle the new format.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants