Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c > #396684 > unrolled thread
| Started by | DFS <nospam@dfs.com> |
|---|---|
| First post | 2026-02-19 16:55 -0500 |
| Last post | 2026-03-16 09:04 +0100 |
| Articles | 20 on this page of 218 — 21 participants |
Back to article view | Back to comp.lang.c
Sort of trivial code challenge - may be interesting to you anyway DFS <nospam@dfs.com> - 2026-02-19 16:55 -0500
Re: Sort of trivial code challenge - may be interesting to you anyway jayjwa <jayjwa@atr2.ath.cx.invalid> - 2026-02-25 15:56 -0500
Re: Sort of trivial code challenge - may be interesting to you anyway DFS <nospam@dfs.com> - 2026-02-26 10:05 -0500
Re: Sort of trivial code challenge - may be interesting to you anyway jayjwa <jayjwa@atr2.ath.cx.invalid> - 2026-02-26 13:20 -0500
Re: Sort of trivial code challenge - may be interesting to you anyway Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2026-02-26 17:06 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2026-02-26 17:27 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway DFS <nospam@dfs.com> - 2026-02-26 14:31 -0500
Re: Sort of trivial code challenge - may be interesting to you anyway jayjwa <jayjwa@atr2.ath.cx.invalid> - 2026-02-26 13:33 -0500
Re: Sort of trivial code challenge - may be interesting to you anyway Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2026-02-26 18:49 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2026-02-26 18:55 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2026-02-26 19:17 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2026-02-26 19:34 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2026-02-26 20:01 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway DFS <nospam@dfs.com> - 2026-03-06 10:36 -0500
Re: Sort of trivial code challenge - may be interesting to you anyway Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2026-03-06 17:38 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2026-03-06 17:48 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway Bart <bc@freeuk.com> - 2026-02-27 00:12 +0000
[OT] Bart's scripting language solution (was Re: Sort of trivial code challenge - may be interesting to you anyway) Janis Papanagnou <janis_papanagnou@hotmail.com> - 2026-03-06 06:37 +0100
Re: [OT] Bart's scripting language solution (was Re: Sort of trivial code challenge - may be interesting to you anyway) Bart <bc@freeuk.com> - 2026-03-06 15:48 +0000
Re: [OT] Bart's scripting language solution (was Re: Sort of trivial code challenge - may be interesting to you anyway) Janis Papanagnou <janis_papanagnou@hotmail.com> - 2026-03-06 18:17 +0100
Re: [OT] Bart's scripting language solution (was Re: Sort of trivial code challenge - may be interesting to you anyway) Bart <bc@freeuk.com> - 2026-03-06 21:46 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-03-02 00:44 -0800
Re: Sort of trivial code challenge - may be interesting to you anyway Michael S <already5chosen@yahoo.com> - 2026-03-02 11:07 +0200
Re: Sort of trivial code challenge - may be interesting to you anyway Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-03-02 06:35 -0800
Re: Sort of trivial code challenge - may be interesting to you anyway Bart <bc@freeuk.com> - 2026-03-02 17:50 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-03-02 21:15 -0800
Re: Sort of trivial code challenge - may be interesting to you anyway Bart <bc@freeuk.com> - 2026-03-03 20:48 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-03-03 22:47 +0100
Re: Sort of trivial code challenge - may be interesting to you anyway David Brown <david.brown@hesbynett.no> - 2026-03-04 08:48 +0100
Re: Sort of trivial code challenge - may be interesting to you anyway Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-03-04 01:07 -0800
Re: Sort of trivial code challenge - may be interesting to you anyway Michael S <already5chosen@yahoo.com> - 2026-03-04 12:09 +0200
Re: Sort of trivial code challenge - may be interesting to you anyway Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-03-04 11:19 -0800
Re: Sort of trivial code challenge - may be interesting to you anyway David Brown <david.brown@hesbynett.no> - 2026-03-04 12:58 +0100
Re: Sort of trivial code challenge - may be interesting to you anyway Bonita Montero <Bonita.Montero@gmail.com> - 2026-03-11 11:31 +0100
Re: Sort of trivial code challenge - may be interesting to you anyway Bart <bc@freeuk.com> - 2026-03-04 13:20 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway DFS <nospam@dfs.com> - 2026-03-04 08:30 -0500
Re: Sort of trivial code challenge - may be interesting to you anyway Bart <bc@freeuk.com> - 2026-03-04 14:36 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway DFS <nospam@dfs.com> - 2026-03-04 10:02 -0500
Re: Sort of trivial code challenge - may be interesting to you anyway Michael S <already5chosen@yahoo.com> - 2026-03-04 19:27 +0200
Re: Sort of trivial code challenge - may be interesting to you anyway DFS <nospam@dfs.com> - 2026-03-05 13:49 -0500
Re: Sort of trivial code challenge - may be interesting to you anyway Michael S <already5chosen@yahoo.com> - 2026-03-05 21:02 +0200
Re: Sort of trivial code challenge - may be interesting to you anyway Bart <bc@freeuk.com> - 2026-03-05 20:39 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway DFS <nospam@dfs.com> - 2026-03-05 19:24 -0500
Re: Sort of trivial code challenge - may be interesting to you anyway Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-03-05 13:54 -0800
Re: Sort of trivial code challenge - may be interesting to you anyway Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-03-12 05:50 -0700
Re: Sort of trivial code challenge - may be interesting to you anyway Bart <bc@freeuk.com> - 2026-03-13 11:58 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway Bart <bc@freeuk.com> - 2026-03-13 23:00 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-03-15 15:54 -0700
Re: Sort of trivial code challenge - may be interesting to you anyway Bart <bc@freeuk.com> - 2026-03-15 23:42 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-04-06 12:02 -0700
Re: Sort of trivial code challenge - may be interesting to you anyway Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-03-15 15:43 -0700
Re: Sort of trivial code challenge - may be interesting to you anyway DFS <nospam@dfs.com> - 2026-03-02 17:40 -0500
Re: Sort of trivial code challenge - may be interesting to you anyway Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-03-02 21:09 -0800
Re: Sort of trivial code challenge - may be interesting to you anyway DFS <nospam@dfs.com> - 2026-03-03 08:23 -0500
Re: Sort of trivial code challenge - may be interesting to you anyway Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-03-03 06:20 -0800
Re: Sort of trivial code challenge - may be interesting to you anyway Michael S <already5chosen@yahoo.com> - 2026-03-03 23:56 +0200
Re: Sort of trivial code challenge - may be interesting to you anyway Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-03-03 15:51 -0800
Re: Sort of trivial code challenge - may be interesting to you anyway Michael S <already5chosen@yahoo.com> - 2026-03-04 11:45 +0200
Re: Sort of trivial code challenge - may be interesting to you anyway Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-03-04 07:01 -0800
Re: Sort of trivial code challenge - may be interesting to you anyway Bonita Montero <Bonita.Montero@gmail.com> - 2026-03-11 11:37 +0100
Re: Sort of trivial code challenge - may be interesting to you anyway DFS <nospam@dfs.com> - 2026-03-04 08:29 -0500
Re: Sort of trivial code challenge - may be interesting to you anyway Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2026-03-04 16:02 +0100
Re: Sort of trivial code challenge - may be interesting to you anyway Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-03-04 08:09 -0800
Re: Sort of trivial code challenge - may be interesting to you anyway DFS <nospam@dfs.com> - 2026-03-06 10:34 -0500
Re: Sort of trivial code challenge - may be interesting to you anyway Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-03-06 08:46 -0800
Re: Sort of trivial code challenge - may be interesting to you anyway Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-03-04 11:25 -0800
Re: Sort of trivial code challenge - may be interesting to you anyway DFS <nospam@dfs.com> - 2026-03-05 13:46 -0500
Re: Sort of trivial code challenge - may be interesting to you anyway David Brown <david.brown@hesbynett.no> - 2026-03-05 21:34 +0100
Re: Sort of trivial code challenge - may be interesting to you anyway Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2026-03-05 19:09 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2026-03-05 21:12 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-03-05 14:12 -0800
Re: Sort of trivial code challenge - may be interesting to you anyway Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2026-03-05 22:24 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway Michael S <already5chosen@yahoo.com> - 2026-03-06 01:00 +0200
Re: Sort of trivial code challenge - may be interesting to you anyway Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-03-05 15:08 -0800
Re: Sort of trivial code challenge - may be interesting to you anyway Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-03-05 15:05 -0800
Re: Sort of trivial code challenge - may be interesting to you anyway Janis Papanagnou <janis_papanagnou@hotmail.com> - 2026-03-06 00:18 +0100
Re: Sort of trivial code challenge - may be interesting to you anyway Michael S <already5chosen@yahoo.com> - 2026-03-07 22:04 +0200
Re: Sort of trivial code challenge - may be interesting to you anyway Janis Papanagnou <janis_papanagnou@hotmail.com> - 2026-03-08 00:26 +0100
Re: Sort of trivial code challenge - may be interesting to you anyway Michael S <already5chosen@yahoo.com> - 2026-03-08 02:45 +0200
Re: Sort of trivial code challenge - may be interesting to you anyway Janis Papanagnou <janis_papanagnou@hotmail.com> - 2026-03-08 17:05 +0100
Re: Sort of trivial code challenge - may be interesting to you anyway Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-03-11 07:57 -0700
Re: Sort of trivial code challenge - may be interesting to you anyway Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2026-03-06 00:12 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2026-03-06 00:14 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-03-05 20:31 -0800
Re: Sort of trivial code challenge - may be interesting to you anyway Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2026-03-06 13:51 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-03-06 08:53 -0800
Re: Sort of trivial code challenge - may be interesting to you anyway DFS <nospam@dfs.com> - 2026-03-06 19:36 -0500
Re: Sort of trivial code challenge - may be interesting to you anyway Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-03-06 18:14 -0800
Re: Sort of trivial code challenge - may be interesting to you anyway Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2026-03-07 18:21 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-03-07 11:55 -0800
Re: Sort of trivial code challenge - may be interesting to you anyway Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2026-03-07 20:10 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-03-11 10:44 -0700
Re: Sort of trivial code challenge - may be interesting to you anyway Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-03-07 12:02 -0800
Re: Sort of trivial code challenge - may be interesting to you anyway Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2026-03-07 20:14 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-03-11 10:53 -0700
Re: Sort of trivial code challenge - may be interesting to you anyway DFS <nospam@dfs.com> - 2026-03-07 16:58 -0500
Re: Sort of trivial code challenge - may be interesting to you anyway Michael S <already5chosen@yahoo.com> - 2026-03-08 00:35 +0200
Re: Sort of trivial code challenge - may be interesting to you anyway Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-03-11 08:23 -0700
Re: Sort of trivial code challenge - may be interesting to you anyway Janis Papanagnou <janis_papanagnou@hotmail.com> - 2026-03-08 00:40 +0100
Re: Sort of trivial code challenge - may be interesting to you anyway DFS <nospam@dfs.com> - 2026-03-08 10:42 -0400
Re: Sort of trivial code challenge - may be interesting to you anyway Bart <bc@freeuk.com> - 2026-03-08 15:18 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway DFS <nospam@dfs.com> - 2026-03-08 12:21 -0400
Re: Sort of trivial code challenge - may be interesting to you anyway Bart <bc@freeuk.com> - 2026-03-08 19:29 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway DFS <nospam@dfs.com> - 2026-03-09 21:20 -0400
Re: Sort of trivial code challenge - may be interesting to you anyway scott@slp53.sl.home (Scott Lurndal) - 2026-03-10 14:43 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway Michael S <already5chosen@yahoo.com> - 2026-03-10 18:08 +0200
Re: Sort of trivial code challenge - may be interesting to you anyway Giovanni <lsodgf0@home.net.it> - 2026-03-10 17:18 +0100
Re: Sort of trivial code challenge - may be interesting to you anyway scott@slp53.sl.home (Scott Lurndal) - 2026-03-10 16:32 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-03-10 15:25 -0700
Re: Sort of trivial code challenge - may be interesting to you anyway Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-03-11 07:07 -0700
Re: Sort of trivial code challenge - may be interesting to you anyway Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-03-11 13:49 -0700
Re: Sort of trivial code challenge - may be interesting to you anyway Bart <bc@freeuk.com> - 2026-03-10 20:24 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-03-10 15:29 -0700
Re: Sort of trivial code challenge - may be interesting to you anyway Bart <bc@freeuk.com> - 2026-03-11 00:29 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway scott@slp53.sl.home (Scott Lurndal) - 2026-03-11 00:33 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway Bart <bc@freeuk.com> - 2026-03-11 11:04 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway antispam@fricas.org (Waldek Hebisch) - 2026-03-10 20:18 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-03-12 05:37 -0700
Re: Sort of trivial code challenge - may be interesting to you anyway Janis Papanagnou <janis_papanagnou@hotmail.com> - 2026-03-08 17:57 +0100
Re: Sort of trivial code challenge - may be interesting to you anyway Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-03-08 13:19 -0700
Re: Sort of trivial code challenge - may be interesting to you anyway Bart <bc@freeuk.com> - 2026-03-09 01:12 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway scott@slp53.sl.home (Scott Lurndal) - 2026-03-08 21:42 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2026-03-08 15:58 -0700
Re: Sort of trivial code challenge - may be interesting to you anyway David Brown <david.brown@hesbynett.no> - 2026-03-09 08:09 +0100
Re: Sort of trivial code challenge - may be interesting to you anyway Janis Papanagnou <janis_papanagnou@hotmail.com> - 2026-03-09 08:53 +0100
Re: Sort of trivial code challenge - may be interesting to you anyway "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2026-03-09 15:25 -0700
Re: Sort of trivial code challenge - may be interesting to you anyway Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-03-11 14:40 -0700
Re: Sort of trivial code challenge - may be interesting to you anyway Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-03-12 05:55 -0700
Re: Sort of trivial code challenge - may be interesting to you anyway Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2026-03-08 16:00 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-03-11 12:44 -0700
Re: Sort of trivial code challenge - may be interesting to you anyway Janis Papanagnou <janis_papanagnou@hotmail.com> - 2026-03-08 17:36 +0100
Re: Sort of trivial code challenge - may be interesting to you anyway Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-03-08 13:27 -0700
Re: Sort of trivial code challenge - may be interesting to you anyway Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-03-11 06:33 -0700
Re: Sort of trivial code challenge - may be interesting to you anyway David Brown <david.brown@hesbynett.no> - 2026-03-08 12:22 +0100
Re: Sort of trivial code challenge - may be interesting to you anyway Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-03-11 06:27 -0700
Re: Sort of trivial code challenge - may be interesting to you anyway Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-03-07 16:43 -0800
Re: Sort of trivial code challenge - may be interesting to you anyway Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-03-11 07:29 -0700
Re: Sort of trivial code challenge - may be interesting to you anyway Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-03-11 14:22 -0700
Re: Sort of trivial code challenge - may be interesting to you anyway Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-04-25 10:07 -0700
Re: Sort of trivial code challenge - may be interesting to you anyway Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-04-25 15:54 -0700
Re: Sort of trivial code challenge - may be interesting to you anyway Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-04-30 03:13 -0700
Re: Sort of trivial code challenge - may be interesting to you anyway Bart <bc@freeuk.com> - 2026-03-06 16:02 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway DFS <nospam@dfs.com> - 2026-03-06 12:11 -0500
Re: Sort of trivial code challenge - may be interesting to you anyway DFS <nospam@dfs.com> - 2026-03-06 13:01 -0500
Re: Sort of trivial code challenge - may be interesting to you anyway DFS <nospam@dfs.com> - 2026-03-06 13:28 -0500
Re: Sort of trivial code challenge - may be interesting to you anyway Bart <bc@freeuk.com> - 2026-03-06 21:53 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway DFS <nospam@dfs.com> - 2026-03-06 22:14 -0500
Re: Sort of trivial code challenge - may be interesting to you anyway Janis Papanagnou <janis_papanagnou@hotmail.com> - 2026-03-07 07:33 +0100
Re: Sort of trivial code challenge - may be interesting to you anyway DFS <nospam@dfs.com> - 2026-03-07 10:24 -0500
Re: Sort of trivial code challenge - may be interesting to you anyway Janis Papanagnou <janis_papanagnou@hotmail.com> - 2026-03-07 19:16 +0100
Re: Sort of trivial code challenge - may be interesting to you anyway DFS <nospam@dfs.com> - 2026-03-07 14:18 -0500
Re: Sort of trivial code challenge - may be interesting to you anyway Janis Papanagnou <janis_papanagnou@hotmail.com> - 2026-03-08 00:47 +0100
Re: Sort of trivial code challenge - may be interesting to you anyway DFS <nospam@dfs.com> - 2026-03-09 22:18 -0400
Re: Sort of trivial code challenge - may be interesting to you anyway Richard Harnden <richard.nospam@gmail.invalid> - 2026-03-10 10:14 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway Richard Harnden <richard.nospam@gmail.invalid> - 2026-03-11 11:40 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway Bart <bc@freeuk.com> - 2026-03-07 13:33 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway Richard Harnden <richard.nospam@gmail.invalid> - 2026-03-07 14:53 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway Bart <bc@freeuk.com> - 2026-03-07 15:44 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway Michael S <already5chosen@yahoo.com> - 2026-03-07 19:53 +0200
Re: Sort of trivial code challenge - may be interesting to you anyway DFS <nospam@dfs.com> - 2026-03-07 10:22 -0500
Re: Sort of trivial code challenge - may be interesting to you anyway Bonita Montero <Bonita.Montero@gmail.com> - 2026-03-11 11:40 +0100
Re: Sort of trivial code challenge - may be interesting to you anyway DFS <nospam@dfs.com> - 2026-03-11 11:00 -0400
Re: Sort of trivial code challenge - may be interesting to you anyway wij <wyniijj5@gmail.com> - 2026-03-12 00:00 +0800
Re: Sort of trivial code challenge - may be interesting to you anyway Bonita Montero <Bonita.Montero@gmail.com> - 2026-03-11 18:03 +0100
Re: Sort of trivial code challenge - may be interesting to you anyway scott@slp53.sl.home (Scott Lurndal) - 2026-03-11 17:52 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway wij <wyniijj5@gmail.com> - 2026-03-12 23:14 +0800
Re: Sort of trivial code challenge - may be interesting to you anyway Bonita Montero <Bonita.Montero@gmail.com> - 2026-03-12 16:23 +0100
Re: Sort of trivial code challenge - may be interesting to you anyway Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-03-12 16:11 -0700
Re: Sort of trivial code challenge - may be interesting to you anyway Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-03-05 14:04 -0800
Re: Sort of trivial code challenge - may be interesting to you anyway Bonita Montero <Bonita.Montero@gmail.com> - 2026-03-11 11:36 +0100
Re: Sort of trivial code challenge - may be interesting to you anyway Bonita Montero <Bonita.Montero@gmail.com> - 2026-03-11 11:35 +0100
Re: Sort of trivial code challenge - may be interesting to you anyway Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2026-03-03 15:40 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-03-03 16:23 -0800
Re: Sort of trivial code challenge - may be interesting to you anyway Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2026-03-04 15:31 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-03-04 09:38 -0800
Re: Sort of trivial code challenge - may be interesting to you anyway Bonita Montero <Bonita.Montero@gmail.com> - 2026-03-03 16:39 +0100
Re: Sort of trivial code challenge - may be interesting to you anyway DFS <nospam@dfs.com> - 2026-03-03 12:00 -0500
Re: Sort of trivial code challenge - may be interesting to you anyway Bonita Montero <Bonita.Montero@gmail.com> - 2026-03-04 11:44 +0100
Re: Sort of trivial code challenge - may be interesting to you anyway DFS <nospam@dfs.com> - 2026-03-04 17:44 -0500
Re: Sort of trivial code challenge - may be interesting to you anyway Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2026-03-04 15:13 -0800
Re: Sort of trivial code challenge - may be interesting to you anyway DFS <nospam@dfs.com> - 2026-03-04 21:07 -0500
Re: Sort of trivial code challenge - may be interesting to you anyway scott@slp53.sl.home (Scott Lurndal) - 2026-03-04 23:37 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway Bonita Montero <Bonita.Montero@gmail.com> - 2026-03-05 07:32 +0100
Re: Sort of trivial code challenge - may be interesting to you anyway Bonita Montero <Bonita.Montero@gmail.com> - 2026-03-05 08:23 +0100
Re: Sort of trivial code challenge - may be interesting to you anyway DFS <nospam@dfs.com> - 2026-03-05 02:24 -0500
Re: Sort of trivial code challenge - may be interesting to you anyway Bonita Montero <Bonita.Montero@gmail.com> - 2026-03-05 08:46 +0100
Re: Sort of trivial code challenge - may be interesting to you anyway Bonita Montero <Bonita.Montero@gmail.com> - 2026-03-05 09:52 +0100
Re: Sort of trivial code challenge - may be interesting to you anyway tTh <tth@none.invalid> - 2026-03-05 10:49 +0100
Re: Sort of trivial code challenge - may be interesting to you anyway Bonita Montero <Bonita.Montero@gmail.com> - 2026-03-05 11:03 +0100
Re: Sort of trivial code challenge - may be interesting to you anyway gazelle@shell.xmission.com (Kenny McCormack) - 2026-03-05 15:22 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway DFS <nospam@dfs.com> - 2026-03-05 05:06 -0500
Re: Sort of trivial code challenge - may be interesting to you anyway Bonita Montero <Bonita.Montero@gmail.com> - 2026-03-05 11:13 +0100
Re: Sort of trivial code challenge - may be interesting to you anyway DFS <nospam@dfs.com> - 2026-03-05 14:11 -0500
Re: Sort of trivial code challenge - may be interesting to you anyway Bonita Montero <Bonita.Montero@gmail.com> - 2026-03-06 03:35 +0100
Re: Sort of trivial code challenge - may be interesting to you anyway scott@slp53.sl.home (Scott Lurndal) - 2026-03-05 14:49 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway Janis Papanagnou <janis_papanagnou@hotmail.com> - 2026-03-05 19:27 +0100
Re: Sort of trivial code challenge - may be interesting to you anyway Bonita Montero <Bonita.Montero@gmail.com> - 2026-03-05 19:46 +0100
Re: Sort of trivial code challenge - may be interesting to you anyway tTh <tth@none.invalid> - 2026-03-05 20:50 +0100
Re: Sort of trivial code challenge - may be interesting to you anyway Michael S <already5chosen@yahoo.com> - 2026-03-05 22:34 +0200
Re: Sort of trivial code challenge - may be interesting to you anyway Bonita Montero <Bonita.Montero@gmail.com> - 2026-03-06 07:48 +0100
Re: Sort of trivial code challenge - may be interesting to you anyway Michael S <already5chosen@yahoo.com> - 2026-03-06 11:49 +0200
Re: Sort of trivial code challenge - may be interesting to you anyway Bonita Montero <Bonita.Montero@gmail.com> - 2026-03-06 13:41 +0100
Re: Sort of trivial code challenge - may be interesting to you anyway Michael S <already5chosen@yahoo.com> - 2026-03-06 15:33 +0200
Re: Sort of trivial code challenge - may be interesting to you anyway Bonita Montero <Bonita.Montero@gmail.com> - 2026-03-06 14:42 +0100
Re: Sort of trivial code challenge - may be interesting to you anyway Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-03-05 13:49 -0800
Re: Sort of trivial code challenge - may be interesting to you anyway scott@slp53.sl.home (Scott Lurndal) - 2026-03-06 02:17 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-03-05 20:06 -0800
Re: Sort of trivial code challenge - may be interesting to you anyway scott@slp53.sl.home (Scott Lurndal) - 2026-03-06 14:58 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway Michael S <already5chosen@yahoo.com> - 2026-03-06 17:13 +0200
Re: Sort of trivial code challenge - may be interesting to you anyway Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-03-06 08:37 -0800
Re: Sort of trivial code challenge - may be interesting to you anyway scott@slp53.sl.home (Scott Lurndal) - 2026-03-03 17:29 +0000
Re: Sort of trivial code challenge - may be interesting to you anyway Bonita Montero <Bonita.Montero@gmail.com> - 2026-03-03 19:20 +0100
Re: Sort of trivial code challenge - may be interesting to you anyway Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-03-03 16:26 -0800
Re: Sort of trivial code challenge - may be interesting to you anyway Bonita Montero <Bonita.Montero@gmail.com> - 2026-03-04 05:27 +0100
Re: Sort of trivial code challenge - may be interesting to you anyway Opus <ifonly@youknew.org> - 2026-03-04 22:42 +0100
Re: Sort of trivial code challenge - may be interesting to you anyway peter <peter.noreply@tin.it> - 2026-03-14 10:42 +0100
Re: Sort of trivial code challenge - may be interesting to you anyway Tim Rentsch <tr.17687@z991.linuxsc.com> - 2026-03-15 15:09 -0700
Re: Sort of trivial code challenge - may be interesting to you anyway Bonita Montero <Bonita.Montero@gmail.com> - 2026-03-16 09:04 +0100
Page 8 of 11 — ← Prev page 1 … 6 7 [8] 9 10 11 Next page →
| From | Tim Rentsch <tr.17687@z991.linuxsc.com> |
|---|---|
| Date | 2026-04-30 03:13 -0700 |
| Message-ID | <86ecjwzrfn.fsf@linuxsc.com> |
| In reply to | #397955 |
Keith Thompson <Keith.S.Thompson+u@gmail.com> writes: > Tim Rentsch <tr.17687@z991.linuxsc.com> writes: > >> Keith Thompson <Keith.S.Thompson+u@gmail.com> writes: >> >>> Tim Rentsch <tr.17687@z991.linuxsc.com> writes: >>> >>>> Keith Thompson <Keith.S.Thompson+u@gmail.com> writes: >>>> >>>>> Tim Rentsch <tr.17687@z991.linuxsc.com> writes: >>>>> [...] >>>>> >>>>>> typedef size_t Z; >>>>>> typedef _Bool B; >>>>> >>>>> [...] >>>>> >>>>> Why do you do this? I find that it makes the code more difficult >>>>> to read. >>>> >>>> The reaction from Lew Pitcher was "Brilliant!". The reaction from >>>> DFS was "I think he knocked it out of the park." Because Lew and >>>> DFS (and to some extent Michael S) are the ones who had expressed >>>> an interest in my counter challenge, they were my target audience. >>>> So from my point of view there is no reason to be dissatisfied with >>>> what was posted. >>> >>> You are of course not obligated to answer, but surely it would be easier >>> not to post a followup at all. >> >> I'm baffled by your comment. You asked a question. I didn't >> have any reason to think the question was rhetorical. I had >> something to say in response. I posted it. As to the last >> point, surely it would have been easier if you had not posted >> your comments either. And yet you did. > > You responded, but you didn't answer. I still don't know why you > wrote those typedefs, nor do I know why you chose not to answer > my direct question. > > I'm still slightly curious why you would use (IMHO) silly names > like Z and B (that was the specific questio I asked), but I'm no > longer asking you to explain. > > I'll try to cut back on asking you why you write things. I wrote what I wrote because it seemed like a good choice when I wrote it. Nothing I have learned since then has given me cause to think otherwise.
[toc] | [prev] | [next] | [standalone]
| From | Bart <bc@freeuk.com> |
|---|---|
| Date | 2026-03-06 16:02 +0000 |
| Message-ID | <10oetq4$pb3m$2@dont-email.me> |
| In reply to | #396805 |
On 06/03/2026 00:12, Lew Pitcher wrote: > OK, it's not pretty, but here it is I tried it really just to see if my C compiler would manage it, which it did. So nothing too scary in it. I assume it works according to the spec, where I admit I don't fully understand the conditions. So input of '10 10 90' is fine (prints 1-90 within 10x10 matrix) omits final column), but input of '90' fails, even though it's the same square matrix. One thing I've noticed is that numbers are shown left-justified when narrower than the maximum, so '9 ' rather than ' 9'. For tabular data in they're normally right-justified.
[toc] | [prev] | [next] | [standalone]
| From | DFS <nospam@dfs.com> |
|---|---|
| Date | 2026-03-06 12:11 -0500 |
| Message-ID | <10of1rv$r1t9$1@dont-email.me> |
| In reply to | #396824 |
On 3/6/2026 11:02 AM, Bart wrote: > I assume it works according to the spec, where I admit I don't fully > understand the conditions. So input of '10 10 90' is fine (prints 1-90 > within 10x10 matrix) omits final column), but input of '90' fails, even > though it's the same square matrix. The condition is "Can a square matrix contain only 1-N?" Only a non-square matrix of 10x9 or 9x10 can contain 1-90. Only a square matrix of 10x10 can contain 1-91.
[toc] | [prev] | [next] | [standalone]
| From | DFS <nospam@dfs.com> |
|---|---|
| Date | 2026-03-06 13:01 -0500 |
| Message-ID | <10of4pn$snu1$2@dont-email.me> |
| In reply to | #396829 |
On 3/6/2026 12:11 PM, DFS wrote: > On 3/6/2026 11:02 AM, Bart wrote: > >> I assume it works according to the spec, where I admit I don't fully >> understand the conditions. So input of '10 10 90' is fine (prints 1-90 >> within 10x10 matrix) omits final column), but input of '90' fails, >> even though it's the same square matrix. > > > The condition is "Can a square matrix contain only 1-N?" > > Only a non-square matrix of 10x9 or 9x10 can contain 1-90. > > Only a square matrix of 10x10 can contain 1-91. Let me be a little more clear. I stated the condition correctly, but the examples didn't adhere to it. The question is "Can a square matrix contain only 1-N?" Examples: 1) only a non-square matrix of 10x9 or 9x10 can contain only 1-90. 10x9 --------------------------- 1 2 3 4 5 6 7 8 9 --------------------------- 1 11 21 31 41 51 61 71 81 2 12 22 32 42 52 62 72 82 3 13 23 33 43 53 63 73 83 4 14 24 34 44 54 64 74 84 5 15 25 35 45 55 65 75 85 6 16 26 36 46 56 66 76 86 7 17 27 37 47 57 67 77 87 8 18 28 38 48 58 68 78 88 9 19 29 39 49 59 69 79 89 10 20 30 40 50 60 70 80 90 9x10 ------------------------------ 1 2 3 4 5 6 7 8 9 10 ------------------------------ 1 10 19 28 37 46 55 64 73 82 2 11 20 29 38 47 56 65 74 83 3 12 21 30 39 48 57 66 75 84 4 13 22 31 40 49 58 67 76 85 5 14 23 32 41 50 59 68 77 86 6 15 24 33 42 51 60 69 78 87 7 16 25 34 43 52 61 70 79 88 8 17 26 35 44 53 62 71 80 89 9 18 27 36 45 54 63 72 81 90 2) only a square matrix of 10x10 can contain only 1-91 (92 93 ... 100) ------------------------------ 1 2 3 4 5 6 7 8 9 10 ------------------------------ 1 11 21 31 41 51 61 71 81 91 2 12 22 32 42 52 62 72 82 3 13 23 33 43 53 63 73 83 4 14 24 34 44 54 64 74 84 5 15 25 35 45 55 65 75 85 6 16 26 36 46 56 66 76 86 7 17 27 37 47 57 67 77 87 8 18 28 38 48 58 68 78 88 9 19 29 39 49 59 69 79 89 10 20 30 40 50 60 70 80 90 This is kind-of a constraint maximization exercise. The answer provides the fewest rows and columns necessary to consume the data points. One use of this calculation might be to determine - in order to maximize available horizontal screen space - how many columns you can use to print sorted data to screen, given screen width, # of data points, spacing and length of data. If you know you have 91-100 data points (numbers or text) you need one more column than if you have 81-90 data points. Or you can just print the sorted data in 1 column and suffer professional embarrassment...
[toc] | [prev] | [next] | [standalone]
| From | DFS <nospam@dfs.com> |
|---|---|
| Date | 2026-03-06 13:28 -0500 |
| Message-ID | <10of6d6$snu1$4@dont-email.me> |
| In reply to | #396833 |
On 3/6/2026 1:01 PM, DFS wrote: > On 3/6/2026 12:11 PM, DFS wrote: > 1) only a non-square matrix of 10x9 or 9x10 can contain only 1-90. Dum dum! Obviously any row x column combination that equals 90 is sufficient. > 2) only a square matrix of 10x10 can contain only 1-91 I do believe this is a true statement. > ------------------------------ > 1 2 3 4 5 6 7 8 9 10 > ------------------------------ > 1 11 21 31 41 51 61 71 81 91 > 2 12 22 32 42 52 62 72 82 > 3 13 23 33 43 53 63 73 83 > 4 14 24 34 44 54 64 74 84 > 5 15 25 35 45 55 65 75 85 > 6 16 26 36 46 56 66 76 86 > 7 17 27 37 47 57 67 77 87 > 8 18 28 38 48 58 68 78 88 > 9 19 29 39 49 59 69 79 89 > 10 20 30 40 50 60 70 80 90
[toc] | [prev] | [next] | [standalone]
| From | Bart <bc@freeuk.com> |
|---|---|
| Date | 2026-03-06 21:53 +0000 |
| Message-ID | <10ofict$11e47$2@dont-email.me> |
| In reply to | #396829 |
On 06/03/2026 17:11, DFS wrote: > On 3/6/2026 11:02 AM, Bart wrote: > >> I assume it works according to the spec, where I admit I don't fully >> understand the conditions. So input of '10 10 90' is fine (prints 1-90 >> within 10x10 matrix) omits final column), but input of '90' fails, >> even though it's the same square matrix. > > > The condition is "Can a square matrix contain only 1-N?" > > Only a non-square matrix of 10x9 or 9x10 can contain 1-90. > > Only a square matrix of 10x10 can contain 1-91. > I still don't get it. Doesn't an input of '10 10 90' specify a square matrix? But it still prints the numbers 1-90: c:\cx>t 10 10 90 # run LP's program 1 11 21 31 41 51 61 71 81 2 12 22 32 42 52 62 72 82 3 13 23 33 43 53 63 73 83 4 14 24 34 44 54 64 74 84 5 15 25 35 45 55 65 75 85 6 16 26 36 46 56 66 76 86 7 17 27 37 47 57 67 77 87 8 18 28 38 48 58 68 78 88 9 19 29 39 49 59 69 79 89 10 20 30 40 50 60 70 80 90 But this fails: c:\cx>t 90 Cut off value 90 not possible where rows=cols Usage: t #_rows #_cols [ cut-off ] or t cut-off This second invocation couldn't print 1-90 within a 10x10 matrix, but the first one could. Or is that first one not considered square; it's a rectangle where height and width happen to be the same?
[toc] | [prev] | [next] | [standalone]
| From | DFS <nospam@dfs.com> |
|---|---|
| Date | 2026-03-06 22:14 -0500 |
| Message-ID | <10og566$1751a$2@dont-email.me> |
| In reply to | #396836 |
On 3/6/2026 4:53 PM, Bart wrote:
> On 06/03/2026 17:11, DFS wrote:
>> On 3/6/2026 11:02 AM, Bart wrote:
>>
>>> I assume it works according to the spec, where I admit I don't fully
>>> understand the conditions. So input of '10 10 90' is fine (prints
>>> 1-90 within 10x10 matrix) omits final column), but input of '90'
>>> fails, even though it's the same square matrix.
>>
>>
>> The condition is "Can a square matrix contain only 1-N?"
>>
>> Only a non-square matrix of 10x9 or 9x10 can contain 1-90.
>>
>> Only a square matrix of 10x10 can contain 1-91.
>>
>
> I still don't get it. Doesn't an input of '10 10 90' specify a square
> matrix? But it still prints the numbers 1-90:
>
> c:\cx>t 10 10 90 # run LP's program
> 1 11 21 31 41 51 61 71 81
> 2 12 22 32 42 52 62 72 82
> 3 13 23 33 43 53 63 73 83
> 4 14 24 34 44 54 64 74 84
> 5 15 25 35 45 55 65 75 85
> 6 16 26 36 46 56 66 76 86
> 7 17 27 37 47 57 67 77 87
> 8 18 28 38 48 58 68 78 88
> 9 19 29 39 49 59 69 79 89
> 10 20 30 40 50 60 70 80 90
That's a 10x9 matrix.
> But this fails:
>
> c:\cx>t 90
> Cut off value 90 not possible where rows=cols
> Usage: t #_rows #_cols [ cut-off ]
> or t cut-off
>
> This second invocation couldn't print 1-90 within a 10x10 matrix, but
> the first one could. Or is that first one not considered square; it's a
> rectangle where height and width happen to be the same?
Every number N can be contained *somewhere within* a square matrix.
But the question is: is there a 'row equals columns' matrix that can
contain *only* 1 thru N.
For 90 that answer is no. Only matrices where row != column stop at 90.
r c
1 90
2 45
3 30
4
5 18
6 15
7
8
9 10
10 9
For 91 the answer is Yes: it is possible to construct a rows=columns
matrix containing only 1-91.
------------------------------
1 2 3 4 5 6 7 8 9 10
------------------------------
1 11 21 31 41 51 61 71 81 91
2 12 22 32 42 52 62 72 82
3 13 23 33 43 53 63 73 83
4 14 24 34 44 54 64 74 84
5 15 25 35 45 55 65 75 85
6 16 26 36 46 56 66 76 86
7 17 27 37 47 57 67 77 87
8 18 28 38 48 58 68 78 88
9 19 29 39 49 59 69 79 89
10 20 30 40 50 60 70 80 90
I think your initial BartScript code got it exactly right, using a
simple formula.
For another view:
Input Sqr Matrix? sqrt(Input)
----------------------------------
1 possible 1.00
2 not possible 1.41
3 possible 1.73
4 possible 2.00
5 not possible 2.24
6 not possible 2.45
7 possible 2.65
8 possible 2.83
9 possible 3.00
10 not possible 3.16
11 not possible 3.32
12 not possible 3.46
13 possible 3.61
14 possible 3.74
15 possible 3.87
16 possible 4.00
17 not possible 4.12
18 not possible 4.24
19 not possible 4.36
20 not possible 4.47
21 possible 4.58
22 possible 4.69
23 possible 4.80
24 possible 4.90
25 possible 5.00
26 not possible 5.10
27 not possible 5.20
28 not possible 5.29
29 not possible 5.39
30 not possible 5.48
31 possible 5.57
32 possible 5.66
33 possible 5.74
34 possible 5.83
35 possible 5.92
36 possible 6.00
37 not possible 6.08
38 not possible 6.16
39 not possible 6.24
40 not possible 6.32
41 not possible 6.40
42 not possible 6.48
43 possible 6.56
44 possible 6.63
45 possible 6.71
46 possible 6.78
47 possible 6.86
48 possible 6.93
49 possible 7.00
50 not possible 7.07
51 not possible 7.14
52 not possible 7.21
53 not possible 7.28
54 not possible 7.35
55 not possible 7.42
56 not possible 7.48
57 possible 7.55
58 possible 7.62
59 possible 7.68
60 possible 7.75
61 possible 7.81
62 possible 7.87
63 possible 7.94
64 possible 8.00
65 not possible 8.06
66 not possible 8.12
67 not possible 8.19
68 not possible 8.25
69 not possible 8.31
70 not possible 8.37
71 not possible 8.43
72 not possible 8.49
73 possible 8.54
74 possible 8.60
75 possible 8.66
76 possible 8.72
77 possible 8.77
78 possible 8.83
79 possible 8.89
80 possible 8.94
81 possible 9.00
82 not possible 9.06
83 not possible 9.11
84 not possible 9.17
85 not possible 9.22
86 not possible 9.27
87 not possible 9.33
88 not possible 9.38
89 not possible 9.43
90 not possible 9.49
91 possible 9.54
92 possible 9.59
93 possible 9.64
94 possible 9.70
95 possible 9.75
96 possible 9.80
97 possible 9.85
98 possible 9.90
99 possible 9.95
100 possible 10.00
Look at the square roots, and you'll see a pattern that determines
whether the square matrix is possible or not.
[toc] | [prev] | [next] | [standalone]
| From | Janis Papanagnou <janis_papanagnou@hotmail.com> |
|---|---|
| Date | 2026-03-07 07:33 +0100 |
| Message-ID | <10oggqt$1afaj$1@dont-email.me> |
| In reply to | #396839 |
On 07.03.26 04:14, DFS wrote: > [...] > > For another view: > > Input Sqr Matrix? sqrt(Input) > ---------------------------------- > 1 possible 1.00 > 2 not possible 1.41 > 3 possible 1.73 > 4 possible 2.00 > 5 not possible 2.24 > 6 not possible 2.45 > 7 possible 2.65 > 8 possible 2.83 > 9 possible 3.00 > 10 not possible 3.16 > 11 not possible 3.32 > 12 not possible 3.46 > 13 possible 3.61 > 14 possible 3.74 > 15 possible 3.87 > 16 possible 4.00 > 17 not possible 4.12 > 18 not possible 4.24 > 19 not possible 4.36 > 20 not possible 4.47 > 21 possible 4.58 > 22 possible 4.69 > 23 possible 4.80 > 24 possible 4.90 > 25 possible 5.00 > 26 not possible 5.10 > 27 not possible 5.20 > 28 not possible 5.29 > 29 not possible 5.39 > 30 not possible 5.48 > 31 possible 5.57 > 32 possible 5.66 > 33 possible 5.74 > 34 possible 5.83 > 35 possible 5.92 > 36 possible 6.00 > 37 not possible 6.08 > 38 not possible 6.16 > 39 not possible 6.24 > 40 not possible 6.32 > 41 not possible 6.40 > 42 not possible 6.48 > 43 possible 6.56 > 44 possible 6.63 > 45 possible 6.71 > 46 possible 6.78 > 47 possible 6.86 > 48 possible 6.93 > 49 possible 7.00 > 50 not possible 7.07 > 51 not possible 7.14 > 52 not possible 7.21 > 53 not possible 7.28 > 54 not possible 7.35 > 55 not possible 7.42 > 56 not possible 7.48 > 57 possible 7.55 > 58 possible 7.62 > 59 possible 7.68 > 60 possible 7.75 > 61 possible 7.81 > 62 possible 7.87 > 63 possible 7.94 > 64 possible 8.00 > 65 not possible 8.06 > 66 not possible 8.12 > 67 not possible 8.19 > 68 not possible 8.25 > 69 not possible 8.31 > 70 not possible 8.37 > 71 not possible 8.43 > 72 not possible 8.49 > 73 possible 8.54 > 74 possible 8.60 > 75 possible 8.66 > 76 possible 8.72 > 77 possible 8.77 > 78 possible 8.83 > 79 possible 8.89 > 80 possible 8.94 > 81 possible 9.00 > 82 not possible 9.06 > 83 not possible 9.11 > 84 not possible 9.17 > 85 not possible 9.22 > 86 not possible 9.27 > 87 not possible 9.33 > 88 not possible 9.38 > 89 not possible 9.43 > 90 not possible 9.49 > 91 possible 9.54 > 92 possible 9.59 > 93 possible 9.64 > 94 possible 9.70 > 95 possible 9.75 > 96 possible 9.80 > 97 possible 9.85 > 98 possible 9.90 > 99 possible 9.95 > 100 possible 10.00 > > Look at the square roots, and you'll see a pattern that determines > whether the square matrix is possible or not. I don't see what the sqrt value would demonstrate here. But the pattern can be seen directly and derived from the second column; it's a sequence of 1 possible, 1 not possible, 2 possible, 2 not possible, 3 possible, 3 not possible, ... 9 possible, 9 not possible, ... Janis
[toc] | [prev] | [next] | [standalone]
| From | DFS <nospam@dfs.com> |
|---|---|
| Date | 2026-03-07 10:24 -0500 |
| Message-ID | <10ohfv9$1kres$2@dont-email.me> |
| In reply to | #396840 |
On 3/7/2026 1:33 AM, Janis Papanagnou wrote: > On 07.03.26 04:14, DFS wrote: <snip> >> Look at the square roots, and you'll see a pattern that determines >> whether the square matrix is possible or not. > > I don't see what the sqrt value would demonstrate here. Look at the remainders of the square roots.
[toc] | [prev] | [next] | [standalone]
| From | Janis Papanagnou <janis_papanagnou@hotmail.com> |
|---|---|
| Date | 2026-03-07 19:16 +0100 |
| Message-ID | <10ohq18$1ol8p$1@dont-email.me> |
| In reply to | #396844 |
On 07.03.26 16:24, DFS wrote: > On 3/7/2026 1:33 AM, Janis Papanagnou wrote: >> On 07.03.26 04:14, DFS wrote: > >>> Look at the square roots, and you'll see a pattern that determines >>> whether the square matrix is possible or not. >> >> I don't see what the sqrt value would demonstrate here. > > Look at the remainders of the square roots. I did of course. (Why would I have otherwise asked.) I don't see what the sqrt value would demonstrate here. Mind to explain what you meant? Janis
[toc] | [prev] | [next] | [standalone]
| From | DFS <nospam@dfs.com> |
|---|---|
| Date | 2026-03-07 14:18 -0500 |
| Message-ID | <10ohtld$1p0l0$1@dont-email.me> |
| In reply to | #396847 |
On 3/7/2026 1:16 PM, Janis Papanagnou wrote:
> On 07.03.26 16:24, DFS wrote:
>> On 3/7/2026 1:33 AM, Janis Papanagnou wrote:
>>> On 07.03.26 04:14, DFS wrote:
>>
>>>> Look at the square roots, and you'll see a pattern that determines
>>>> whether the square matrix is possible or not.
>>>
>>> I don't see what the sqrt value would demonstrate here.
>>
>> Look at the remainders of the square roots.
>
> I did of course. (Why would I have otherwise asked.)
>
> I don't see what the sqrt value would demonstrate here.
>
> Mind to explain what you meant?
>
> Janis
The values of the remainders correspond 1:1 with the possibility of a
square matrix.
remainder between 0.01 and 0.50: square matrix not possible
#include <math.h>
double r = modf(sqrt(N), &i);
printf("square matrix for 1-%d %s\n", N, (r > 0.01 && r < 0.50) ? "not
possible" : "possible");
From what I can tell, 1/2 of all numbers can be captured in a square
matrix, and 1/2 cannot.
[toc] | [prev] | [next] | [standalone]
| From | Janis Papanagnou <janis_papanagnou@hotmail.com> |
|---|---|
| Date | 2026-03-08 00:47 +0100 |
| Message-ID | <10oidfb$1u9aa$3@dont-email.me> |
| In reply to | #396849 |
On 07.03.26 20:18, DFS wrote: > On 3/7/2026 1:16 PM, Janis Papanagnou wrote: >> On 07.03.26 16:24, DFS wrote: >>> On 3/7/2026 1:33 AM, Janis Papanagnou wrote: >>>> On 07.03.26 04:14, DFS wrote: >>> >>>>> Look at the square roots, and you'll see a pattern that determines >>>>> whether the square matrix is possible or not. >>>> >>>> I don't see what the sqrt value would demonstrate here. >>> >>> Look at the remainders of the square roots. >> >> I did of course. (Why would I have otherwise asked.) >> >> I don't see what the sqrt value would demonstrate here. >> >> Mind to explain what you meant? > > The values of the remainders correspond 1:1 with the possibility of a > square matrix. > > remainder between 0.01 and 0.50: square matrix not possible [...] Okay, thanks for explaining. - I saw later that someone amended some mathematical derivation in the sqrt() context. My critical stance here remains that the visible pattern I mentioned is IMO much easier seen compared to a (sort of) ad hoc math function with truncated values presented. A mathematical derivation (as we've seen) would of course be necessary in both cases- Janis
[toc] | [prev] | [next] | [standalone]
| From | DFS <nospam@dfs.com> |
|---|---|
| Date | 2026-03-09 22:18 -0400 |
| Message-ID | <10onv21$3srkg$1@dont-email.me> |
| In reply to | #396859 |
On 3/7/2026 6:47 PM, Janis Papanagnou wrote:
> On 07.03.26 20:18, DFS wrote:
> My critical stance here remains that the visible pattern I mentioned
> is IMO much easier seen compared to a (sort of) ad hoc math function
> with truncated values presented.
It's easier to see, but that glaring pattern, where groups of 'possible'
alternate with growing same-size groups of 'not possible', is by itself
nearly useless for determining if 1-N fits in a square matrix, whereas
the remainders of the square root tell you immediately.
remainder between 0.01 and 0.50 = square matrix not possible
Input Sqr Matrix? sqrt(Input)
----------------------------------
1 possible 1.00
2 not possible 1.41
3 possible 1.73
4 possible 2.00
5 not possible 2.24
6 not possible 2.45
7 possible 2.65
8 possible 2.83
9 possible 3.00
10 not possible 3.16
11 not possible 3.32
12 not possible 3.46
13 possible 3.61
14 possible 3.74
15 possible 3.87
16 possible 4.00
17 not possible 4.12
18 not possible 4.24
19 not possible 4.36
20 not possible 4.47
21 possible 4.58
22 possible 4.69
23 possible 4.80
24 possible 4.90
25 possible 5.00
26 not possible 5.10
27 not possible 5.20
28 not possible 5.29
29 not possible 5.39
30 not possible 5.48
In all the posting I didn't see whether anyone came up with a formula
just using the Input nbr. I think maybe Lew Pitcher or Bart did.
There's probably a simple formula in Rentsch's brainfsck-code, but it
would take some work to decipher it.
> A mathematical derivation (as we've seen) would of course be necessary
> in both cases-
I may post a question to sci.math and see if anyone is interested.
Don't know if this kind of thing fits into the topic of sequences?
[toc] | [prev] | [next] | [standalone]
| From | Richard Harnden <richard.nospam@gmail.invalid> |
|---|---|
| Date | 2026-03-10 10:14 +0000 |
| Message-ID | <10ooqtt$4tli$1@dont-email.me> |
| In reply to | #396881 |
On 10/03/2026 02:18, DFS wrote:
> In all the posting I didn't see whether anyone came up with a formula
> just using the Input nbr. I think maybe Lew Pitcher or Bart did.
Avoids sqrt and fmod ...
int is_possible(int n)
{
int side=1;
int min, max;
while (side < 100)
{
max = side * side;
min = max - side + 1;
if ( n >= min && n <= max )
return 1;
if ( max > n )
break;
side++;
}
return 0;
}
[toc] | [prev] | [next] | [standalone]
| From | Richard Harnden <richard.nospam@gmail.invalid> |
|---|---|
| Date | 2026-03-11 11:40 +0000 |
| Message-ID | <10orkah$122vf$1@dont-email.me> |
| In reply to | #396881 |
On 10/03/2026 02:18, DFS wrote: > On 3/7/2026 6:47 PM, Janis Papanagnou wrote: >> On 07.03.26 20:18, DFS wrote: > > >> My critical stance here remains that the visible pattern I mentioned >> is IMO much easier seen compared to a (sort of) ad hoc math function >> with truncated values presented. > > It's easier to see, but that glaring pattern, where groups of 'possible' > alternate with growing same-size groups of 'not possible', is by itself > nearly useless for determining if 1-N fits in a square matrix, whereas > the remainders of the square root tell you immediately. > > remainder between 0.01 and 0.50 = square matrix not possible > > > Input Sqr Matrix? sqrt(Input) > ---------------------------------- > 1 possible 1.00 > 2 not possible 1.41 > 3 possible 1.73 > 4 possible 2.00 > 5 not possible 2.24 > 6 not possible 2.45 > 7 possible 2.65 > 8 possible 2.83 > 9 possible 3.00 > 10 not possible 3.16 > 11 not possible 3.32 > 12 not possible 3.46 > 13 possible 3.61 > 14 possible 3.74 > 15 possible 3.87 > 16 possible 4.00 > 17 not possible 4.12 > 18 not possible 4.24 > 19 not possible 4.36 > 20 not possible 4.47 > 21 possible 4.58 > 22 possible 4.69 > 23 possible 4.80 > 24 possible 4.90 > 25 possible 5.00 > 26 not possible 5.10 > 27 not possible 5.20 > 28 not possible 5.29 > 29 not possible 5.39 > 30 not possible 5.48 > > > In all the posting I didn't see whether anyone came up with a formula > just using the Input nbr. I think maybe Lew Pitcher or Bart did. > > There's probably a simple formula in Rentsch's brainfsck-code, but it > would take some work to decipher it. > > > > A mathematical derivation (as we've seen) would of course be necessary >> in both cases- > > I may post a question to sci.math and see if anyone is interested. Don't > know if this kind of thing fits into the topic of sequences? > The possible numbers are <https://oeis.org/A004201> "Accept one, reject one, accept two, reject two, ..."
[toc] | [prev] | [next] | [standalone]
| From | Bart <bc@freeuk.com> |
|---|---|
| Date | 2026-03-07 13:33 +0000 |
| Message-ID | <10oh9g7$1i55j$1@dont-email.me> |
| In reply to | #396839 |
On 07/03/2026 03:14, DFS wrote: > On 3/6/2026 4:53 PM, Bart wrote: >> On 06/03/2026 17:11, DFS wrote: >>> On 3/6/2026 11:02 AM, Bart wrote: >>> >>>> I assume it works according to the spec, where I admit I don't fully >>>> understand the conditions. So input of '10 10 90' is fine (prints >>>> 1-90 within 10x10 matrix) omits final column), but input of '90' >>>> fails, even though it's the same square matrix. >>> >>> >>> The condition is "Can a square matrix contain only 1-N?" >>> >>> Only a non-square matrix of 10x9 or 9x10 can contain 1-90. >>> >>> Only a square matrix of 10x10 can contain 1-91. >>> >> >> I still don't get it. Doesn't an input of '10 10 90' specify a square >> matrix? But it still prints the numbers 1-90: >> >> c:\cx>t 10 10 90 # run LP's program >> 1 11 21 31 41 51 61 71 81 >> 2 12 22 32 42 52 62 72 82 >> 3 13 23 33 43 53 63 73 83 >> 4 14 24 34 44 54 64 74 84 >> 5 15 25 35 45 55 65 75 85 >> 6 16 26 36 46 56 66 76 86 >> 7 17 27 37 47 57 67 77 87 >> 8 18 28 38 48 58 68 78 88 >> 9 19 29 39 49 59 69 79 89 >> 10 20 30 40 50 60 70 80 90 > > > That's a 10x9 matrix. But the request is for a 10x10 matrix with a cut-off of 90. What's the difference between that, and a specifying only the cut-off of 90, where the numbers need to be within a square matrix for the smallest square that can display 90 numbers? That would be 10x10 too. The difference not only appears to be very subtle, but I don't understand why it is important. If I disable that restriction for my version that only does cut-offs within a square matrix, and show "-" where there is no output, then this output for N=4-7: input = 4 1 3 2 4 input = 5 not possible to output 1-5 where rows=columns input = 6 not possible to output 1-6 where rows=columns input = 7 1 4 7 2 5 3 6 becomes instead: input = 4 1 3 2 4 input = 5 1 4 - 2 5 - 3 - - input = 6 1 4 - 2 5 - 3 6 - input = 7 1 4 7 2 5 - 3 6 - What exactly is the problem? That "input = 6" version (minus the hypens) is also what I get with Lew's program with inputs of "3 3 6". I asked for 3 columns, and got only two. > 89 not possible 9.43 > 90 not possible 9.49 > 91 possible 9.54 > > Look at the square roots, and you'll see a pattern that determines > whether the square matrix is possible or not. I've looked, but can't see a pattern!
[toc] | [prev] | [next] | [standalone]
| From | Richard Harnden <richard.nospam@gmail.invalid> |
|---|---|
| Date | 2026-03-07 14:53 +0000 |
| Message-ID | <10ohe64$1k3gf$1@dont-email.me> |
| In reply to | #396841 |
On 07/03/2026 13:33, Bart wrote: > On 07/03/2026 03:14, DFS wrote: >> On 3/6/2026 4:53 PM, Bart wrote: >>> On 06/03/2026 17:11, DFS wrote: >>>> On 3/6/2026 11:02 AM, Bart wrote: >>>> >>>>> I assume it works according to the spec, where I admit I don't >>>>> fully understand the conditions. So input of '10 10 90' is fine >>>>> (prints 1-90 within 10x10 matrix) omits final column), but input of >>>>> '90' fails, even though it's the same square matrix. >>>> >>>> >>>> The condition is "Can a square matrix contain only 1-N?" >>>> >>>> Only a non-square matrix of 10x9 or 9x10 can contain 1-90. >>>> >>>> Only a square matrix of 10x10 can contain 1-91. >>>> >>> >>> I still don't get it. Doesn't an input of '10 10 90' specify a square >>> matrix? But it still prints the numbers 1-90: >>> >>> c:\cx>t 10 10 90 # run LP's program >>> 1 11 21 31 41 51 61 71 81 >>> 2 12 22 32 42 52 62 72 82 >>> 3 13 23 33 43 53 63 73 83 >>> 4 14 24 34 44 54 64 74 84 >>> 5 15 25 35 45 55 65 75 85 >>> 6 16 26 36 46 56 66 76 86 >>> 7 17 27 37 47 57 67 77 87 >>> 8 18 28 38 48 58 68 78 88 >>> 9 19 29 39 49 59 69 79 89 >>> 10 20 30 40 50 60 70 80 90 >> >> >> That's a 10x9 matrix. > > But the request is for a 10x10 matrix with a cut-off of 90. > > What's the difference between that, and a specifying only the cut-off of > 90, where the numbers need to be within a square matrix for the smallest > square that can display 90 numbers? That would be 10x10 too. > > The difference not only appears to be very subtle, but I don't > understand why it is important. > > If I disable that restriction for my version that only does cut-offs > within a square matrix, and show "-" where there is no output, then this > output for N=4-7: > > input = 4 > 1 3 > 2 4 > > input = 5 > not possible to output 1-5 where rows=columns > > input = 6 > not possible to output 1-6 where rows=columns > > input = 7 > 1 4 7 > 2 5 > 3 6 > > becomes instead: > > input = 4 > 1 3 > 2 4 > > input = 5 > 1 4 - > 2 5 - > 3 - - > > input = 6 > 1 4 - > 2 5 - > 3 6 - > > input = 7 > 1 4 7 > 2 5 - > 3 6 - > > What exactly is the problem? That "input = 6" version (minus the hypens) > is also what I get with Lew's program with inputs of "3 3 6". I asked > for 3 columns, and got only two. > > >> 89 not possible 9.43 >> 90 not possible 9.49 >> 91 possible 9.54 > >> >> Look at the square roots, and you'll see a pattern that determines >> whether the square matrix is possible or not. > > > I've looked, but can't see a pattern! > All I can see is that it's possible for x.00 and >= x.50, and not possible for < x.50 I don't know why. I could (easily) be completely wrong :)
[toc] | [prev] | [next] | [standalone]
| From | Bart <bc@freeuk.com> |
|---|---|
| Date | 2026-03-07 15:44 +0000 |
| Message-ID | <10ohh51$1lb45$1@dont-email.me> |
| In reply to | #396842 |
On 07/03/2026 14:53, Richard Harnden wrote:
> On 07/03/2026 13:33, Bart wrote:
>>> 89 not possible 9.43
>>> 90 not possible 9.49
>>> 91 possible 9.54
>>
>>>
>>> Look at the square roots, and you'll see a pattern that determines
>>> whether the square matrix is possible or not.
>>
>>
>> I've looked, but can't see a pattern!
>>
>
> All I can see is that it's possible for x.00 and >= x.50, and not
> possible for < x.50
>
> I don't know why. I could (easily) be completely wrong :)
Yes, you're right. Given N to be 1-100, then a value of fmod(sqrt(N),
1.0) which is either 0.0, or 0.5 to 1.0, means it is possible. (Whatever
significance 'possible' has!)
At least a table generated by such a loop has the same
possible/not-possible sequences that JP noticed.
But then, I still can't see the point of using square roots and floating
point. I use a solution involving integer arithmetic only. For each N I
need to calculate the Rows of the smallest Rows*Rows containing square
matrix, which I do with a loop.
Then the formula is simple:
if (Rows*Rows - N < Rows) // possible
That loop would be inefficient for large N, but traversing all values
from 1 to N and converting each as a decimal would take longer.
[toc] | [prev] | [next] | [standalone]
| From | Michael S <already5chosen@yahoo.com> |
|---|---|
| Date | 2026-03-07 19:53 +0200 |
| Message-ID | <20260307195350.00007dff@yahoo.com> |
| In reply to | #396842 |
On Sat, 7 Mar 2026 14:53:56 +0000 Richard Harnden <richard.nospam@gmail.invalid> wrote: > On 07/03/2026 13:33, Bart wrote: > > On 07/03/2026 03:14, DFS wrote: > >> On 3/6/2026 4:53 PM, Bart wrote: > >>> On 06/03/2026 17:11, DFS wrote: > >>>> On 3/6/2026 11:02 AM, Bart wrote: > >>>> > >>>>> I assume it works according to the spec, where I admit I don't > >>>>> fully understand the conditions. So input of '10 10 90' is fine > >>>>> (prints 1-90 within 10x10 matrix) omits final column), but > >>>>> input of '90' fails, even though it's the same square matrix. > >>>> > >>>> > >>>> The condition is "Can a square matrix contain only 1-N?" > >>>> > >>>> Only a non-square matrix of 10x9 or 9x10 can contain 1-90. > >>>> > >>>> Only a square matrix of 10x10 can contain 1-91. > >>>> > >>> > >>> I still don't get it. Doesn't an input of '10 10 90' specify a > >>> square matrix? But it still prints the numbers 1-90: > >>> > >>> c:\cx>t 10 10 90 # run LP's program > >>> 1 11 21 31 41 51 61 71 81 > >>> 2 12 22 32 42 52 62 72 82 > >>> 3 13 23 33 43 53 63 73 83 > >>> 4 14 24 34 44 54 64 74 84 > >>> 5 15 25 35 45 55 65 75 85 > >>> 6 16 26 36 46 56 66 76 86 > >>> 7 17 27 37 47 57 67 77 87 > >>> 8 18 28 38 48 58 68 78 88 > >>> 9 19 29 39 49 59 69 79 89 > >>> 10 20 30 40 50 60 70 80 90 > >> > >> > >> That's a 10x9 matrix. > > > > But the request is for a 10x10 matrix with a cut-off of 90. > > > > What's the difference between that, and a specifying only the > > cut-off of 90, where the numbers need to be within a square matrix > > for the smallest square that can display 90 numbers? That would be > > 10x10 too. > > > > The difference not only appears to be very subtle, but I don't > > understand why it is important. > > > > If I disable that restriction for my version that only does > > cut-offs within a square matrix, and show "-" where there is no > > output, then this output for N=4-7: > > > > input = 4 > > 1 3 > > 2 4 > > > > input = 5 > > not possible to output 1-5 where rows=columns > > > > input = 6 > > not possible to output 1-6 where rows=columns > > > > input = 7 > > 1 4 7 > > 2 5 > > 3 6 > > > > becomes instead: > > > > input = 4 > > 1 3 > > 2 4 > > > > input = 5 > > 1 4 - > > 2 5 - > > 3 - - > > > > input = 6 > > 1 4 - > > 2 5 - > > 3 6 - > > > > input = 7 > > 1 4 7 > > 2 5 - > > 3 6 - > > > > What exactly is the problem? That "input = 6" version (minus the > > hypens) is also what I get with Lew's program with inputs of "3 3 > > 6". I asked for 3 columns, and got only two. > > > > > >> 89 not possible 9.43 > >> 90 not possible 9.49 > >> 91 possible 9.54 > > > >> > >> Look at the square roots, and you'll see a pattern that determines > >> whether the square matrix is possible or not. > > > > > > I've looked, but can't see a pattern! > > > > All I can see is that it's possible for x.00 and >= x.50, and not > possible for < x.50 > > I don't know why. I could (easily) be completely wrong :) > > > It is not coincedence. For table of size n x n, the smallest possible max_val is n*(n-1)+1 = n*n - n + 1 = (n - 0.5)**2 + 0.75. Obbviosly, sqrt((n - 0.5)**2 + 0.75) > n-0.5 OTOH, max_val-1 = (n - 0.5)**2 - 0.25, so sqrt(max_val-1) < n-0.5.
[toc] | [prev] | [next] | [standalone]
| From | DFS <nospam@dfs.com> |
|---|---|
| Date | 2026-03-07 10:22 -0500 |
| Message-ID | <10ohfqp$1kres$1@dont-email.me> |
| In reply to | #396841 |
On 3/7/2026 8:33 AM, Bart wrote:
> On 07/03/2026 03:14, DFS wrote:
>> On 3/6/2026 4:53 PM, Bart wrote:
>>> On 06/03/2026 17:11, DFS wrote:
>>>> On 3/6/2026 11:02 AM, Bart wrote:
>>>>
>>>>> I assume it works according to the spec, where I admit I don't
>>>>> fully understand the conditions. So input of '10 10 90' is fine
>>>>> (prints 1-90 within 10x10 matrix) omits final column), but input of
>>>>> '90' fails, even though it's the same square matrix.
>>>>
>>>>
>>>> The condition is "Can a square matrix contain only 1-N?"
>>>>
>>>> Only a non-square matrix of 10x9 or 9x10 can contain 1-90.
>>>>
>>>> Only a square matrix of 10x10 can contain 1-91.
>>>>
>>>
>>> I still don't get it. Doesn't an input of '10 10 90' specify a square
>>> matrix? But it still prints the numbers 1-90:
>>>
>>> c:\cx>t 10 10 90 # run LP's program
>>> 1 11 21 31 41 51 61 71 81
>>> 2 12 22 32 42 52 62 72 82
>>> 3 13 23 33 43 53 63 73 83
>>> 4 14 24 34 44 54 64 74 84
>>> 5 15 25 35 45 55 65 75 85
>>> 6 16 26 36 46 56 66 76 86
>>> 7 17 27 37 47 57 67 77 87
>>> 8 18 28 38 48 58 68 78 88
>>> 9 19 29 39 49 59 69 79 89
>>> 10 20 30 40 50 60 70 80 90
>>
>>
>> That's a 10x9 matrix.
>
> But the request is for a 10x10 matrix with a cut-off of 90.
And that's what you got. But 90 stopped it from creating a 10x10
matrix. There is no size matrix where rows = columns that consumes only
1-90.
> What's the difference between that, and a specifying only the cut-off of
> 90, where the numbers need to be within a square matrix for the smallest
> square that can display 90 numbers? That would be 10x10 too.
The difference is you asked for a 10x10 matrix with a cutoff of 90.
When you put in just a single value, you're not asking for a square
matrix - you're asking if a square matrix can be created that consumes 1
to the single value. Half the time it can, and half the time it can't.
When I was writing the initial code, I noticed it happening but didn't
spend much time looking for why - I only saw that being prime wasn't the
explanation.
> The difference not only appears to be very subtle, but I don't
> understand why it is important.
Not important, it was just to kick the challenge up a notch. Otherwise
it was too easy.
> If I disable that restriction for my version that only does cut-offs
> within a square matrix, and show "-" where there is no output, then this
> output for N=4-7:
>
> input = 4
> 1 3
> 2 4
>
> input = 5
> not possible to output 1-5 where rows=columns
>
> input = 6
> not possible to output 1-6 where rows=columns
>
> input = 7
> 1 4 7
> 2 5
> 3 6
>
> becomes instead:
>
> input = 4
> 1 3
> 2 4
>
> input = 5
> 1 4 -
> 2 5 -
> 3 - -
>
> input = 6
> 1 4 -
> 2 5 -
> 3 6 -
>
> input = 7
> 1 4 7
> 2 5 -
> 3 6 -
>
> What exactly is the problem?
They're entirely consistent.
Outputting dashes, you can see how 1-5 and 1-6 can't form a square
matrix, but 1-4 and 1-7 can.
1-4: only a 2x2 matrix can use 1 to 4, and only 1 to 4
1-5: no square matrix can use 1 to 5, and only 1 to 5
1-6: no square matrix can use 1 to 6, and only 1 to 6
1-7: only a 3x3 matrix can use 1 to 7, and only 1 to 7
> That "input = 6" version (minus the hypens)
> is also what I get with Lew's program with inputs of "3 3 6". I asked
> for 3 columns, and got only two.
You got as many columns as were needed to consume 1 to 6, given the
inputs 3 3 6.
10 1 6 will give you a different number of columns, as will 1 10 6
and 2 8 6.
>> 89 not possible 9.43
>> 90 not possible 9.49
>> 91 possible 9.54
>
>>
>> Look at the square roots, and you'll see a pattern that determines
>> whether the square matrix is possible or not.
>
>
> I've looked, but can't see a pattern!
Look at the remainders of the square roots.
That will provide a hint to the mathematical explanation for why a
square matrix is or isn't possible for a given number (not that I can
formalize that mathematical explanation, but there is one).
new code that might help your understanding.
compile with =lm to use math.h
================================================================================
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
//print a separator line
void printline(int linewidth, char *linechar) {
printf(" ");
for(int i = 0; i < linewidth; i++) {
printf("%s",linechar);
}
printf("\n");
}
//print column headers
void printcolheader(int cols, int charwidth) {
printline(cols * charwidth,"-");
for (int p = 1; p <= cols; p++) {
printf("%*d",charwidth,p);
}
printf("\n");
printline(cols * charwidth,"-");
}
//with math.h: test if the fraction remainder of the square root of the
input is between .01 and .5
//if so, you can't output a square matrix that includes the input
void calc_rows_columns(int *rows, int *cols, int max) {
double i,f;
printf(" square matrix for 1-%d %s\n", max, ((modf(sqrt(max), &i) >
0.01 && modf(sqrt(max), &i) < 0.50) ) ? "not possible" : "");
*rows = *cols = ceil(sqrt(max));
}
//core routine to write row x column data to screen
void output(int rows, int cols, int max) {
//width of columns
char cw[10];
int colwidth = sprintf(cw,"%d",max) + 2;
//print column headers for visual aid
printcolheader(cols, colwidth);
//print nbr matrix
for (int r = 1; r <= rows; r++) {
if (r <= max) {
int nbr = r;
printf("%*d",colwidth,nbr);
for (int i = 0; i < cols-1; i++) {
nbr += rows;
if (nbr <= max) {
printf("%*d",colwidth,nbr);
}
}
printf("\n");
}
else
{
break;
}
}
}
int main(int argc, char *argv[]) {
int rows, cols, max;
if (argc > 2) {
rows = atoi(argv[1]);
cols = atoi(argv[2]);
max = (argc == 4) ? atoi(argv[3]) : rows * cols ;
}
if (argc == 2) {
max = atoi(argv[1]);
calc_rows_columns(&rows, &cols, max);
}
//write data to screen
output(rows, cols, max);
printf("\n");
return 0;
}
================================================================================
[toc] | [prev] | [next] | [standalone]
Page 8 of 11 — ← Prev page 1 … 6 7 [8] 9 10 11 Next page →
Back to top | Article view | comp.lang.c
csiph-web