Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » sci.math.* » sci.math

Topic: 4 colors problem
Replies: 86   Last Post: Mar 13, 2014 4:36 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
stumblin' in

Posts: 58
Registered: 3/3/14
Re: 4 colors problem
Posted: Mar 13, 2014 9:41 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

\* begin comment

This is a program in Shen from shenlanguage.org.
(fourcolors 16)
(makearray 8 (fourcolors 64))

end comment *\

(define pairs -> [0 1 0 2 0 3 1 0 2 0 3 0 1 2 1 3 2 1 3 1 2 3 3 2])

(define fourcolors0
0 _ M -> M
N L M -> (let b ((protect RANDOM) 12)
(if (or (and (< (length M) 8) (= L (hd (pickcolor b))) )
(and (>= (length M) 8) (not (integer? (/ (length M) 8)))
(or (= L (hd (pickcolor b)))
(not (column-ok? (pickcolor b) M))))
(and (>= (length M) 8) (integer? (/ (length M) 8))
(not (column-ok? (pickcolor b) M))))
(fourcolors0 N L M)
(fourcolors0 (- N 1) (hd (tl (pickcolor b)))
(append M (pickcolor b))) )))

(define fourcolors
N -> (fourcolors0 N -1 []))


(define column-ok?
L M -> (if (or (= (from (- (length M) 8) M) (hd L))
(= (from (- (length M) 7) M) (hd (tl L))) )
false true))

(define pickcolor
N -> [(from (* 2 N) (pairs)) (from (+ (* 2 N) 1) (pairs))])

(define from
0 L -> (head L)
N [X|Y] -> (from (- N 1) Y))

(define makearray1
0 N L -> (append (reverse N) [L])
M N L -> (if (< M (length L)) (makearray1 M (cons (take M L) N) (drop M L))
(makearray1 0 N L)))

(define makearray
M _ -> [] where (= M 0)
M L -> (makearray1 M [] L))

(define take0
0 M _ -> (reverse M)
N M [X|Y] -> (take0 (- N 1) (cons X M) Y))

(define take
N L -> (if (< N 0) (drop (- (length L) (abs N)) L) (take0 N [] L)))

(define drop
0 L -> L
N L -> (if (< N 0) (take (- (length L) (abs N)) L) (drop (- N 1) (tl L))))

(define abs
N -> (* N -1) where (< N 0)
N -> N)



Date Subject Author
3/3/14
Read 4 colors problem
stumblin' in
3/3/14
Read Re: 4 colors problem
Brian Q. Hutchings
3/3/14
Read Re: 4 colors problem
stumblin' in
3/4/14
Read Re: 4 colors problem
g.resta@iit.cnr.it
3/3/14
Read Re: 4 colors problem
stumblin' in
3/4/14
Read Re: 4 colors problem
stumblin' in
3/4/14
Read Re: 4 colors problem
g.resta@iit.cnr.it
3/4/14
Read Re: 4 colors problem
stumblin' in
3/4/14
Read Re: 4 colors problem
stumblin' in
3/4/14
Read Re: 4 colors problem
stumblin' in
3/4/14
Read Re: 4 colors problem
stumblin' in
3/4/14
Read Re: 4 colors problem
stumblin' in
3/4/14
Read Re: 4 colors problem
g.resta@iit.cnr.it
3/4/14
Read Re: 4 colors problem
magidin@math.berkeley.edu
3/4/14
Read Re: 4 colors problem
stumblin' in
3/4/14
Read Re: 4 colors problem
Port563
3/4/14
Read Re: 4 colors problem
stumblin' in
3/4/14
Read Re: 4 colors problem
Brian Q. Hutchings
3/4/14
Read Re: 4 colors problem
stumblin' in
3/4/14
Read Re: 4 colors problem
stumblin' in
3/4/14
Read Re: 4 colors problem
stumblin' in
3/4/14
Read Re: 4 colors problem
stumblin' in
3/4/14
Read Re: 4 colors problem
Port563
3/4/14
Read Re: 4 colors problem
stumblin' in
3/4/14
Read Re: 4 colors problem
Brian Q. Hutchings
3/4/14
Read Re: 4 colors problem
stumblin' in
3/4/14
Read Re: 4 colors problem
stumblin' in
3/4/14
Read there should be a noncomputer proof of 4CT, I agree
Brian Q. Hutchings
3/4/14
Read Re: 4 colors problem
g.resta@iit.cnr.it
3/4/14
Read Re: 4 colors problem
stumblin' in
3/4/14
Read Re: 4 colors problem
Port563
3/4/14
Read Re: 4 colors problem
stumblin' in
3/5/14
Read Re: 4 colors problem
stumblin' in
3/5/14
Read Re: 4 colors problem
magidin@math.berkeley.edu
3/5/14
Read Re: 4 colors problem
stumblin' in
3/5/14
Read Re: 4 colors problem
magidin@math.berkeley.edu
3/5/14
Read Re: 4 colors problem
quasi
3/5/14
Read Re: 4 colors problem
stumblin' in
3/5/14
Read Re: 4 colors problem
magidin@math.berkeley.edu
3/5/14
Read Re: 4 colors problem
stumblin' in
3/5/14
Read Re: 4 colors problem
quasi
3/5/14
Read Re: 4 colors problem
magidin@math.berkeley.edu
3/5/14
Read also, what is the spatial analog
Brian Q. Hutchings
3/5/14
Read Re: 4 colors problem
stumblin' in
3/5/14
Read Re: 4 colors problem
magidin@math.berkeley.edu
3/5/14
Read Re: 4 colors problem
stumblin' in
3/5/14
Read Re: 4 colors problem
Brian Q. Hutchings
3/5/14
Read Re: 4 colors problem
Virgil
3/5/14
Read Re: 4 colors problem
stumblin' in
3/5/14
Read Re: 4 colors problem
stumblin' in
3/5/14
Read Re: 4 colors problem
stumblin' in
3/5/14
Read Re: 4 colors problem
stumblin' in
3/5/14
Read Re: 4 colors problem
stumblin' in
3/5/14
Read Re: 4 colors problem
stumblin' in
3/5/14
Read Re: 4 colors problem
Virgil
3/5/14
Read Re: 4 colors problem
stumblin' in
3/6/14
Read Re: 4 colors problem
Virgil
3/6/14
Read Re: 4 colors problem
Virgil
3/6/14
Read Re: 4 colors problem
Brian Q. Hutchings
3/6/14
Read Re: 4 colors problem
stumblin' in
3/6/14
Read Re: 4 colors problem
ross.finlayson@gmail.com
3/7/14
Read Re: 4 colors problem
Brian Q. Hutchings
3/7/14
Read Re: 4 colours problem
Robin Chapman
3/6/14
Read Re: 4 colors problem
stumblin' in
3/6/14
Read Re: 4 colors problem
stumblin' in
3/7/14
Read Re: 4 colors problem
magidin@math.berkeley.edu
3/7/14
Read Re: 4 colors problem
Peter Percival
3/7/14
Read Re: 4 colors problem
Peter Percival
3/6/14
Read Re: 4 colors problem
stumblin' in
3/7/14
Read Re: 4 colors problem
stumblin' in
3/7/14
Read Re: 4 colors problem
magidin@math.berkeley.edu
3/7/14
Read Re: 4 colors problem
Peter Percival
3/7/14
Read Re: 4 colors problem
Peter Percival
3/7/14
Read Re: 4 colors problem
stumblin' in
3/7/14
Read Re: 4 colors problem
stumblin' in
3/9/14
Read Re: 4 colors problem
stumblin' in
3/9/14
Read Re: 4 colors problem
Peter Percival
3/9/14
Read Re: 4 colors problem
stumblin' in
3/9/14
Read Re: 4 colors problem
magidin@math.berkeley.edu
3/9/14
Read Re: 4 colors problem
Brian Q. Hutchings
3/9/14
Read Re: 4 colors problem
stumblin' in
3/9/14
Read Re: 4 colors problem
stumblin' in
3/11/14
Read Re: 4 colors problem
stumblin' in
3/11/14
Read Re: 4 colors problem
Brian Q. Hutchings
3/13/14
Read Re: 4 colors problem
stumblin' in
3/13/14
Read Re: 4 colors problem
Brian Q. Hutchings
3/13/14
Read Re: 4 colors problem
stumblin' in

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.