Re: Pengine http requests

Jan Wielemaker <[email protected]>
Newsgroups gmane.comp.ai.prolog.swi
Message-ID <[email protected]>
On 02/08/2014 04:04 PM, Anne Ogborn wrote:
> My game board map has 540 squares.
> Every time the map is updated (happens relatively infrequently)
> the client will do something like
>
>
> new_board :-  between(0,18, LatNum),
>               between(0,27, LongNum),
>               board_status(LatNum, LongNum, Status),
>               pengine_output(point(LatNum, LongNum, Status)).
>
> Is this going to generate 532 http requests?

Suppose so.  The way to avoid that is by generating an array and
outputting that.  E.g.,

new_board :-
	findall(Row,
		( between(0,18, LatNum),
		  findall(( between(0,27,LongNum),
			    board_status(LatNum, Long, Status)
			  ),
			  Row)
		), Board),
	pengine_output(Board).

	Cheers --- Jan
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.