N-queens minimum and knights and bishops: Difference between revisions

→‎{{header|Go}}: Improvement for knights.
(Oops!)
(→‎{{header|Go}}: Improvement for knights.)
Line 128:
 
=={{header|Go}}==
This was originally a translation of the Wren entry but was substantially improved by [[User:Petelomax|Pete Lomax]] using suggestions from the talk page and has been improved further since then, resulting in an overall execution time of about 2822.24 seconds.
 
Timing is for an Intel Core i7-8565U machine running Ubuntu 20.04.
Line 252:
}
if countSoFar <= maxCount {
si := 0ti
sj := 0tj
if piece !== "K" {
si = tisi - 2
sj = tjsj - 2
if si < 0 {
si = 0
}
if sj < 0 {
sj = 0
}
}
for i := si; i < n; i++ {
Line 415 ⟶ 421:
. . . . . . . . . .
 
Took 2822.174576435s383253365s
 
</pre>
 
9,476

edits