It is currently Sat Apr 21, 2018 11:43 am Advanced search

Readln vs EOF ?

Topics about starter packages, visualizer or any other third party tools.
Please submit new language requests in the Language Request Forum.

Readln vs EOF ?

Postby lindel » Sat Dec 03, 2011 10:28 am

Hello,
in Pascal (sorry about the old stuff ;) ), there is a big difference between using ReadLN and EOF for reading the input stream. ReadLN is blocking while EOF/Read is not.
The StarterBot uses ReadLN to get the initial conditions and then to read the turn information. Basically the bot waits for the input.
Would it be against the letter or the intent of the rules to replace ReadLN by a "while not eof" loop and do some processing in between, on just one process?
Lindel
lindel
Cadet
 
Posts: 2
Joined: Sat Dec 03, 2011 10:21 am

Re: Readln vs EOF ?

Postby amstan » Sat Dec 03, 2011 5:27 pm

Nope, feel free.
Alexandru M. Stan
Contest Organizer
User avatar
amstan
Contest Organizer
 
Posts: 691
Joined: Sun Jan 31, 2010 4:02 am
Location: Stoney Creek, Ontario

Re: Readln vs EOF ?

Postby lindel » Sat Dec 03, 2011 10:09 pm

Thanks,
I'll try programming something, if I remember enough of my old IO skills.
lindel
Cadet
 
Posts: 2
Joined: Sat Dec 03, 2011 10:21 am

Re: Readln vs EOF ?

Postby Janzert » Sun Dec 04, 2011 5:46 am

Before going through a lot of work to implement the async IO, you should be aware that this is going to gain you very little thinking time. Roughly 5ms on average per turn, since your bot is paused in between each of its turns.
Janzert
Contest Organizer
 
Posts: 271
Joined: Sun Feb 07, 2010 1:59 am


Return to Starter Packages & Tools

Who is online

Users browsing this forum: Bing [Bot] and 1 guest

cron