旧 TPJ 文章中的 8 queen 问题缺少 link 到主模块 Queen

8 queen problem in old TPJ aritcle is missing link to main module Queen

有没有人从 perl journal 那里得到完整的程序?

https://www.foo.be/docs/tpj/issues/vol1_4/tpj0104-0001.html

下面更具体 link 什么也没有。

http://www.tpj.com/programs.html

这是一个有 8 个皇后的节目。正在看程序,想研究一下,但是本文没有完整的程序。

#!/usr/bin/perl -w

use strict;

require Queen; 
require Queen::Null;

my $lastQueen; 
my $column; 
my $neighbor = new Queen::Null;

foreach $column (1 .. 8) { 
    $lastQueen = new Queen; 
    $lastQueen->initialColumn($column, $neighbor); 
    $neighbor = $lastQueen;
}

$lastQueen->first() and $lastQueen->print();
  1. 作者 Mike Stok 的 web page (the article in PDF)
  2. 他的GitLab