Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: Another coffee break problem?

From: tomc:darkwing:uoregon at: 13-Nov-2003 10:30

On Wed, 12 Nov 2003, Tom Conlin wrote:
> On Tue, 11 Nov 2003, Joel Neely wrote: > > > > > Hi, Gregg, > > > > Gregg Irwin wrote: > > > > > > JN> The following 3-by-3 display is a simple magic square: > > > > > > JN> 0 8 4 > > > JN> 5 1 6 > > > JN> 7 3 2 > > > > > > JN> because each row and each column sums to 12... > > > > > > No diagonals? I thought magic squares had to work on the diagonal as > > > well? (not to be nit-picky or anything :) > > > > > > > To be equally picky ;-) > > > > That's why I said "simple magic" square instead of "totally magic". I > > was going to post a follow-up problem to refine the first program so > > that it also checks diagonals. > > > > Also, not all sources I've looked at insist on diagonal operations. One > > interesting way to generalize the problem is to "magic" rectangles with > > different height and width. In that case, the definition of "diagonal" > > becomes more interesting... > > > > -jn- >
I did wake up in in the middle of the night remembering I had only coverd a third of the cases. and it looks like I should not have those dups in there ... pprint b 3 ; normal pprint flip b 3 3 ; about vertical axis pprint reflect b 3 3 ; rotate left 90 flip b 3 3 ; back to normal pprint reflect b 3 3 ; about backslash b: head reverse b pprint b 3 ; rotated 180 degrees pprint flip b 3 3 ; about horizontal axis pprint reflect b 3 3 ; rotate right 90 flip b 3 3 ; back to 180 pprint reflect b 3 3 ; about slash but still have to handle the other 16 cases