All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > General
Only 6īs and 9īs (Posted on 2005-11-14) Difficulty: 2 of 5
Look at the 3x3 grid below :
             (3) (1) (6)
            +---+---+---+
        (2) | 6 | 6 | 9 |
            +---+---+---+
        (5) | 9 | 6 | 9 |
            +---+---+---+
        (4) | 9 | 6 | 6 |
            +---+---+---+
To fill it, we used only the digits 6 and 9, achieving 6 different three-digit numbers, three horizontally and three vertically. The (1) outside the second column indicates that 666 is the first number, when the six numbers are arranged in ascending order. The (4) outside of the third row indicates that 966 is the fourth number in the sequence, etc... Thus, reading the six numbers in the grid, following the sequence showed by the outside numbers, we have : 666 / 669 / 699 / 966 / 969 / 996.

Using the same rule above, fill the three 4x4 grids below (note, you can use only the digits 6 and 9 to fill each grid, and you have no restrictions on how many 6īs or how many 9īs you may use).
       (3) (7) (6) (4)          (3) (2) (8) (5)          (2) (4) (5) (6)  
      +---+---+---+---+        +---+---+---+---+        +---+---+---+---+
  (5) |   |   |   |   |    (1) |   |   |   |   |    (1) |   |   |   |   |
      +---+---+---+---+        +---+---+---+---+        +---+---+---+---+          
  (2) |   |   |   |   |    (7) |   |   |   |   |    (7) |   |   |   |   |
      +---+---+---+---+        +---+---+---+---+        +---+---+---+---+
  (8) |   |   |   |   |    (6) |   |   |   |   |    (3) |   |   |   |   |
      +---+---+---+---+        +---+---+---+---+        +---+---+---+---+
  (1) |   |   |   |   |    (4) |   |   |   |   |    (8) |   |   |   |   |
      +---+---+---+---+        +---+---+---+---+        +---+---+---+---+

See The Solution Submitted by pcbouhid    
Rating: 3.4000 (5 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution computer solution | Comment 5 of 7 |

The three grids are:

6996
6669
9966
6666
6699
9996
9696
6999
6699
9969
6996
9996

Found by variations on the following program.  The only differences are in the line that says  IF ident$ = "r1c1r3c2c3c4r2r4" THEN.

DECLARE SUB build (n!)
CLEAR , , 25000
DIM SHARED s$(4)

build 1

END

SUB build (n)
 IF LEN(s$(n)) < 4 THEN
  s$(n) = s$(n) + "6"
  build n
  MID$(s$(n), LEN(s$(n)), 1) = "9"
  build n
  s$(n) = LEFT$(s$(n), LEN(s$(n)) - 1)
 ELSE
  IF n = 4 THEN
   REDIM n$(8), id$(8)
   FOR i = 1 TO 4
    n$(i) = s$(i)
    id$(i) = "r" + LTRIM$(STR$(i))
   NEXT
   FOR i = 1 TO 4
    FOR j = 1 TO 4
     n$(i + 4) = n$(i + 4) + MID$(s$(j), i, 1)
    NEXT
    id$(i + 4) = "c" + LTRIM$(STR$(i))
   NEXT
   DO
    flag = 0
    FOR i = 1 TO 7
     IF n$(i) > n$(i + 1) THEN
      SWAP n$(i), n$(i + 1)
      SWAP id$(i), id$(i + 1)
      flag = 1
     ELSEIF n$(i) = n$(i + 1) THEN flag = 2: EXIT FOR
     END IF
    NEXT
   LOOP UNTIL flag = 0 OR flag = 2
  
   IF flag = 0 THEN
    ident$ = id$(1) + id$(2) + id$(3) + id$(4) + id$(5) + id$(6) + id$(7) + id$(8)

    IF ident$ = "r1c1r3c2c3c4r2r4" THEN
     FOR i = 1 TO 4
      PRINT s$(i)
     NEXT
     PRINT
    END IF
   END IF
  ELSE
   build n + 1
  END IF
 END IF

END SUB

 


  Posted by Charlie on 2005-11-14 13:33:32
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (4)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2017 by Animus Pactum Consulting. All rights reserved. Privacy Information