How to get input data of each questions?


#1

The coeinGame is amazing.
But, in my opinion the biggest downside is the poor IDE.
I prefer to work on my local machine in my Eclipse.
The problem is, I have failed to find a way to get the System.in data into my Eclipse.

The current CodeinGame Sync only copy-paste the code from IDE to a local file, which is not a big deal. It wouldn't work if i cannot read System.in data
Do you have any idea?

Any help would be amazing
Otherwise i have to leave this amazing site


#2

For IN/OUT puzzle, you have access to the testcases provided in the XHR:startTestSession

{success: {puzzle: {forumPostId: "temperatures-puzzle-discussion/33", title: "Températures",…},…}}
	success:{puzzle: {forumPostId: "temperatures-puzzle-discussion/33", title: "Températures",…},…}
		currentQuestion:{question: {,…}, answer: {,…}, lastSubmissionId: 4966397}
		answer:{,…}
		lastSubmissionId:4966397
		question:{,…}
		duration:2400
		id:30498
		index:0
		initialId:30498
		languages:["Bash", "C", "C#", "C++", "Clojure", "Dart", "F#", "Go", "Groovy", "Haskell", "Java", "Javascript",…]
		stubGenerator:"read n:int↵read temps:string(256)↵write result↵↵INPUT↵n:the number of temperatures to analyse↵temps:the n temperatures expressed as integers ranging from -273 to 5526"
		testCases:
			0:{index: 1, inputBinaryId: 9550255581217, outputBinaryId: 9550268409219, label: "Données simples"}
			1:{index: 2, inputBinaryId: 9550291896965, outputBinaryId: 9550304079680,…}
			2:{index: 3, inputBinaryId: 9550334298001, outputBinaryId: 9550344075094,…}
			3:{index: 4, inputBinaryId: 9550372375663, outputBinaryId: 9550389156049,…}
			4:{index: 5, inputBinaryId: 9550412408699, outputBinaryId: 9550424938595, label: "Données complexes"}
			5:{index: 6, inputBinaryId: 9550456476867, outputBinaryId: 9550468118956, label: "Pas de température"}
		title:"Températures - GE"
		type:"MULTIPLE_LANGUAGES"
		userId:-2
		direct:false
		needAccount:true
		puzzle:{forumPostId: "temperatures-puzzle-discussion/33", title: "Températures",…}
		questions:[{questionId: 30498, title: "Températures - GE", hasResult: true, score: 1}]
		shareable:true

Then you have access to the provided data:
https://static.codingame.com/servlet/fileservlet?id=9550255581217

For Multi/Dynamic-puzzle, you will have to create your own referee.

There is no out-of-the-box feature for CodinGame.


#3

As far as I know, there is no way to get the input to your IDE directly (the code is run on the server, not on client-side).
For most of the puzzles you can look at the input. In my local setup I read from a file, where I copied that input to.
For multiplayer games I use the System.error output to print the input (and some more information to reconstruct the game state if necessary, e.g. blocked fields in Tron). I then paste this output to the file, from where I read from.


#4

It looks like a json file.
Does it come from a REST application?

What are the end points?

Currently, I am working on this question, so how can i have the inputs?


#5

That's a dynamic game, there is no way to work in your local IDE since the server gives you differents inputs depend on your previous output.


#6

How can i have test cases for this question?


#7

You will need to write your own game simulation and run your code in a test harness. That's the only way. At one point I was considering creating a GitHub with all of my game simulations that I have written. Maybe I'll get around to that someday...

  • danBhentschel