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

Disqualified: new worker on top of another ant #6

Closed
GNiklasch opened this issue Jan 13, 2018 · 2 comments

Comments

Projects
None yet
1 participant
@GNiklasch
Copy link
Owner

commented Jan 13, 2018

Noted by trichoplax (thanks!) in posted v1.0:

Disqualification reason: "Cannot create new worker on top of another ant." Input: [{"color":7,"food":0,"ant":{"food":0,"type":2,"friend":false‌​}},{"color":4,"food"‌​:0,"ant":{"food":1,"‌​type":3,"friend":fal‌​se}},{"color":4,"foo‌​d":0,"ant":null},{"c‌​olor":3,"food":0,"an‌​t":null},{"color":8,‌​"food":0,"ant":{"foo‌​d":5,"type":5,"frien‌​d":true}},{"color":4‌​,"food":0,"ant":null‌​},{"color":2,"food":‌​0,"ant":{"food":1,"t‌​ype":4,"friend":true‌​}},{"color":7,"food"‌​:0,"ant":{"food":0,"‌​type":4,"friend":tru‌​e}},{"color":5,"food‌​":0,"ant":null}] Output: {"cell":1,"type":1}

@GNiklasch

This comment has been minimized.

Copy link
Owner Author

commented Jan 13, 2018

Doh, had missed a one-character edit after a paste. This occurs in the self-defence code in runQueenOperatingMineStrategy() when no enemy queen is in the Windmill queen's view but she can see that her gardener has detected an enemy queen one cell further out.

The code was doing:

    } else if (view[CCW[compass]].ant.food > 0) {
	// A food-bearing enemy queen has appeared next to our gardener.
	if ((myFood > 0) &&
	    (view[CCW[compass+7]].color == LCL_ALERT) &&
	    destOK[CCW[compass+7]]) {
	    // The gardener has spotted the intruder queen on a cell we can't
	    // see directly, but visible from the alert-colored cell.
	    // Put a miner there.
	    debugme("Enemy queen beyond our own view reported by the gardener.");
	    return {cell:CCW[compass+5], type:ANT_JUNIOR_MINER};
	}

The destOK check is correct. The CCW subscript in the return statement (line 1168 of the un-minified source) is wrong.

@GNiklasch

This comment has been minimized.

Copy link
Owner Author

commented Jan 15, 2018

Fixed in v1.1 by 56c9cdc.

@GNiklasch GNiklasch closed this Jan 15, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.