diff options
author | zakk <zakk@edf5b092-35ff-0310-97b2-ce42778d08ea> | 2005-08-26 17:39:27 +0000 |
---|---|---|
committer | zakk <zakk@edf5b092-35ff-0310-97b2-ce42778d08ea> | 2005-08-26 17:39:27 +0000 |
commit | 6bf20c78f5b69d40bcc4931df93d29198435ab67 (patch) | |
tree | e3eda937a05d7db42de725b7013bd0344b987f34 /lcc/tst/8q.c | |
parent | 872d4d7f55af706737ffb361bb76ad13e7496770 (diff) | |
download | ioquake3-aero-6bf20c78f5b69d40bcc4931df93d29198435ab67.tar.gz ioquake3-aero-6bf20c78f5b69d40bcc4931df93d29198435ab67.zip |
newlines fixed
git-svn-id: svn://svn.icculus.org/quake3/trunk@6 edf5b092-35ff-0310-97b2-ce42778d08ea
Diffstat (limited to 'lcc/tst/8q.c')
-rwxr-xr-x | lcc/tst/8q.c | 78 |
1 files changed, 39 insertions, 39 deletions
diff --git a/lcc/tst/8q.c b/lcc/tst/8q.c index e55ba1a..60a65a9 100755 --- a/lcc/tst/8q.c +++ b/lcc/tst/8q.c @@ -1,39 +1,39 @@ -int up[15], down[15], rows[8], x[8];
-int queens(), print();
-
-main()
-{
- int i;
-
- for (i = 0; i < 15; i++)
- up[i] = down[i] = 1;
- for (i = 0; i < 8; i++)
- rows[i] = 1;
- queens(0);
- return 0;
-}
-
-queens(c)
-{
- int r;
-
- for (r = 0; r < 8; r++)
- if (rows[r] && up[r-c+7] && down[r+c]) {
- rows[r] = up[r-c+7] = down[r+c] = 0;
- x[c] = r;
- if (c == 7)
- print();
- else
- queens(c + 1);
- rows[r] = up[r-c+7] = down[r+c] = 1;
- }
-}
-
-print()
-{
- int k;
-
- for (k = 0; k < 8; k++)
- printf("%c ", x[k]+'1');
- printf("\n");
-}
+int up[15], down[15], rows[8], x[8]; +int queens(), print(); + +main() +{ + int i; + + for (i = 0; i < 15; i++) + up[i] = down[i] = 1; + for (i = 0; i < 8; i++) + rows[i] = 1; + queens(0); + return 0; +} + +queens(c) +{ + int r; + + for (r = 0; r < 8; r++) + if (rows[r] && up[r-c+7] && down[r+c]) { + rows[r] = up[r-c+7] = down[r+c] = 0; + x[c] = r; + if (c == 7) + print(); + else + queens(c + 1); + rows[r] = up[r-c+7] = down[r+c] = 1; + } +} + +print() +{ + int k; + + for (k = 0; k < 8; k++) + printf("%c ", x[k]+'1'); + printf("\n"); +} |