Sudoku with fwh

Sudoku with fwh

Postby Silvio.Falconi » Sat Jan 17, 2015 11:21 am

I 'm trying to create a small sudoku with fwh

I create 9X9 get and I create a function as a valid to control each region, lines and column

Image

the numbers on blod are numbers inserted by procedure ( it load a sudoku froma file txt - random)

the numbers on yellow color are the numbers inserted by me

but I not think is right and I wish make a function to show if the numbers inserted are right or not

I'd like also a function to resolve it by pc but it is very hard

Someone Know a method easy to resolve it ?
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7090
Joined: Thu Oct 18, 2012 7:17 pm

Re: Sudoku with fwh

Postby ukoenig » Sat Jan 17, 2015 1:39 pm

Silvio,

I think it comes close to the logic I'm using for my MEMORY-game
this is much more complicated. You can use 4 players the same time with score-countings.
You can download it for a test.

viewtopic.php?f=3&t=24794&p=137123&hilit=memory.zip#p137123

Image

Image

best regards
Uwe :?:
Last edited by ukoenig on Mon Jan 19, 2015 3:09 pm, edited 1 time in total.
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Sudoku with fwh

Postby Silvio.Falconi » Sat Jan 17, 2015 8:08 pm

Uwe
it not is the same
perhaps you not know the rule of sudoku please go here www.sudoku.name
I made this evening the resolve functions with some methods
I saw the functions are good for the sudoku level 1,2,and 3 but from level4 i have some hard problems
it is dtrange because on dos (clipper 52E ) the function s are good also on level6
notice :
the rule of sudoku is to complete 81 numbers from 1 to
Each regions must have the sequence 123456789
each line must have the sequence 123456789
each column must have the sequence 123456789

I have many tests files for each level -
Level1 45 numbers inserted from pc
level2 40 numbers
level3 35 numbers
level4 30 numbers
level5 27 numbers
level6 25 numbers
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7090
Joined: Thu Oct 18, 2012 7:17 pm

Re: Sudoku with fwh

Postby Silvio.Falconi » Mon Jan 19, 2015 7:56 am

I think it can be made with xbrowse but I not Know how
I try with a simply array ( 9,9) but then I don't Know How control each cell of xbrowse
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7090
Joined: Thu Oct 18, 2012 7:17 pm

Re: Sudoku with fwh

Postby ukoenig » Mon Jan 19, 2015 10:00 am

Silvio,

YES,
that is what I wanted to tell You, using xBrowse.
My memory-game is created with XBROWSE.
That makes is possible,to control all cells.

Just in short the logic :
each image is saved to a array like Image[5][6] // 5 Rows and 6 Cols.
The 1. cell-click opens a image and saves the image-name to a var.
The 2. click on any cell opens a 2. image and scans the array, if the opend image belongs to the
1. saved image-name ( the image is still visible ).
If image-name 1 <> Image-name 2, ihe images are closed and +1 is counted to the TRIAL-table, otherwise +1 is saved to the SCORE-table.
There are 15 double images defined. The 30 Image-names are saved to the array.
Because You are using only numbers, might not as difficult as using images.

( You need a array like < numbers[9][9] > for the xBrowse, like You posted above )

To keep the cellsize, don't forget to include :

oBrw:lAllowRowSizing := .F.
Code: Select all  Expand view  RUN

FOR nCol := 1 to 9
     WITH OBJECT oBrw:aCols[ nCol ]
          :lAllowSizing := .F.
     END
NEXT
 


best regards
Uwe :lol:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Sudoku with fwh

Postby Silvio.Falconi » Mon Jan 19, 2015 12:26 pm

yes allready made
Bu then i not Know How control each cell

try this test
Code: Select all  Expand view  RUN
Function Main()
      Local odlg

      Local aSudoku  := { { 0, 0, 0, 2, 0, 3, 8, 0, 1 }, ;
                { 0, 0, 0, 7, 0, 6, 0, 5, 2 }, ;
                { 2, 0, 0, 0, 0, 0, 0, 7, 9 }, ;
                { 0, 2, 0, 1, 5, 7, 9, 3, 4 }, ;
                { 0, 0, 3, 0, 0, 0, 1, 0, 0 }, ;
                { 9, 1, 7, 3, 8, 4, 0, 2, 0 }, ;
                { 1, 8, 0, 0, 0, 0, 0, 0, 6 }, ;
                { 7, 3, 0, 6, 0, 1, 0, 0, 0 }, ;
                { 6, 0, 5, 8, 0, 9, 0, 0, 0 }  }

      DEFINE DIALOG oDlg SIZE 81*5,81*5;
             COLOR CLR_BLACK,CLR_WHITE


  @ 1,1 XBROWSE oBrw OF oDlg array aSudoku             ;
         LINES CELL cols{ 1,2,3,4,5,6,7,8,9 }          ;
         HEADER "1", "2", "3", "4","5","6","7","8","9" ;
         COLSIZES 25,25,25,25,25,25,25,25,25      ;
         SIZE 140,100  NOBORDER

  Ut_BrwRowConfig( oBrw )
  oBrw:CreateFromCode()
 aeval( oBrw:aCols, { |oCols| oCols:nEditType := EDIT_GET } )

  ACTIVATE DIALOG oDlg
RETURN NIL
FUNCTION Ut_BrwRowConfig( oBrw )

   oBrw:lRecordSelector     := .F. // .t.
   oBrw:lAllowRowSizing     := .F.
   oBrw:lColDividerComplete := .t. // .f.
   oBrw:lAllowColSwapping   := .f.
   oBrw:lAllowColHiding     := .f.
   oBrw:lFastEdit           := .f.


   oBrw:nRowSel      := 1
   oBrw:nColSel      := 1
   oBrw:nColOffset   := 1
   oBrw:nFreeze      := 0
   oBrw:nCaptured    := 0
   oBrw:nLastEditCol := 0

   oBrw:nStretchCol         := -1
   oBrw:lRecordSelector     := .F.
   oBrw:lHScroll            := .F.
   oBrw:lVScroll            := .F.

   oBrw:nRowDividerStyle := LINESTYLE_LIGHTGRAY
   oBrw:nColDividerStyle := LINESTYLE_LIGHTGRAY // LINESTYLE_NOLINES
  * oBrw:nMarqueeStyle    := MARQSTYLE_HIGHLROW  // MARQSTYLE_SOLIDCELL
  oBrw:lheader:=.f.
   RETURN nil
 




When I tried with all gets I used this to determine the position of get

blo1 := {"a1","a2","a3","b1","b2","b3","c1","c2","c3"}
....
local xblocco := "blo" + str(blocco,1)
...

for xn := 1 to 9

xpos := substr(&xblocco.[xn],1,1) + "x" + substr(&xblocco.[xn],2,1)

if campo == &xpos.
ct ++
endif

next

then I obtain ct I can to control it
widtth xbrowse How I must do ?
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7090
Joined: Thu Oct 18, 2012 7:17 pm

Re: Sudoku with fwh

Postby ukoenig » Mon Jan 19, 2015 12:33 pm

Silvio,

I will try to add the missing parts / logic

best regards
Uwe :D
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Sudoku with fwh

Postby ukoenig » Mon Jan 19, 2015 3:11 pm

Silvio,

the way You can control a xBrowse-cell from the matrix 9x9.
Message on cell-click ( add the calculations what ever You want to do ) :
( only a click on a EMPTY cell is accepted )
I changed from numeric to character, to show empty cells
It means for calculations the VAL( aSudoku[... ) must be used.


possible to define the blue color of the 4 lines ?
Image

added some lines to Your sample :

Code: Select all  Expand view  RUN

#include "FiveWin.ch"
#include "xbrowse.ch"

FUNCTION MAIN()
Local odlg, oSay[9]
Local aSudoku  := { { " ", " ", " ",  "2", " ", "3",  "8", " ", "1" }, ;
                { " ", " ", " ",  "7", " ", "6",  " ", "5", "2" }, ;
                {  "2", " ",  " ", " ", " ", " ", " ", "7", "9" }, ;
                { " ", "2", " ", "1", "5", "7",  "9", "3", "4" }, ;
                {  " ", " ", "3", " ", " ", " ", "1", " ", " " }, ;
                { "9", "1", "7", "3", "8", "4", " ", "2", " " }, ;
                { "1", "8", " ",  " ", " ", " ", " ", " ", "6" }, ;
                { "7", "3", " ",  "6", " ", "1", " ", " ", " " }, ;
                { "6", " ", "5", "8", " ", "9", " ", " ", " " }  }
 Local aPrompt := { "  a", "  b", "  c", "  d", "  e", "  f", "  g", "  h", "  i" }

DEFINE DIALOG oDlg SIZE 81*5,81*5;
COLOR CLR_BLACK,CLR_WHITE PIXEL

I := 1
nRow := 20
FOR I := 1 TO 9
    @ nRow, 8 SAY oSay[I] PROMPT aPrompt[I] SIZE 12, 9 COLOR 0, 16772055 PIXEL
    nRow := nRow +9
NEXT

@ 10, 20 XBROWSE oBrw OF oDlg ARRAY aSudoku  ;
         LINES CELL cols{ 1,2,3,4,5,6,7,8,9 }          ;
         HEADER "1", "2", "3", "4","5","6", "7","8","9" ;
         COLSIZES 25, 25, 25, 25, 25, 25, 25, 25, 25, 25 ;
         SIZE 125, 91  NOBORDER PIXEL

oBrw:bLClicked := { | nRow, nCol | C_ACTION( aSudoku, oBrw:KeyNo(), oBrw:SelectedCol():nCreationOrder, aPrompt ) }

Ut_BrwRowConfig( oBrw )
oBrw:CreateFromCode()
aeval( oBrw:aCols, { |oCols| oCols:nEditType := EDIT_GET, ;
                             oCols:lAllowSizing := .F., ;
                             oCols:nDataStrAlign := AL_CENTER } )

ACTIVATE DIALOG oDlg

RETURN NIL

// ---------

FUNCTION C_ACTION(aSudoku, nRPos, nCPos, aPrompt)

IF EMPTY( aSudoku[nRPos][nCPos] )
                MsgAlert( "Row : " + aPrompt[nRPos] + CRLF + ;
                          "Col : " + ALLTRIM(STR(nCPos)), "Position" )
ENDIF

RETURN(NIL)
// ------

FUNCTION Ut_BrwRowConfig( oBrw )

oBrw:lRecordSelector        := .F. // .t.
oBrw:lAllowRowSizing        := .F.
oBrw:lColDividerComplete    := .t. // .f.
oBrw:lAllowColSwapping  := .f.
oBrw:lAllowColHiding        := .f.
oBrw:lFastEdit          := .f.

oBrw:nRowSel            := 1
oBrw:nColSel                := 1
oBrw:nColOffset         := 1
oBrw:nFreeze            := 0
oBrw:nCaptured          := 0
oBrw:nLastEditCol       := 0

oBrw:nStretchCol            := -1
oBrw:lRecordSelector        := .F.
oBrw:lHScroll               := .F.
oBrw:lVScroll               := .F.

oBrw:nRowDividerStyle   := LINESTYLE_LIGHTGRAY
oBrw:nColDividerStyle       := LINESTYLE_LIGHTGRAY // LINESTYLE_NOLINES
* oBrw:nMarqueeStyle        := MARQSTYLE_HIGHLROW  // MARQSTYLE_SOLIDCELL
oBrw:lheader                :=.t.

RETURN nil
 


best regards
Uwe :D
Last edited by ukoenig on Wed Jan 21, 2015 8:29 pm, edited 1 time in total.
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Sudoku with fwh

Postby Silvio.Falconi » Mon Jan 19, 2015 8:42 pm

for the color we can thik after

I think we must first create another array atest for insert the vertical datas

aPrompt[n], asudoku[n][1]....

as first column there are the letters and then the other columns
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7090
Joined: Thu Oct 18, 2012 7:17 pm

Re: Sudoku with fwh

Postby ukoenig » Wed Jan 21, 2015 5:25 pm

I added some more functions :

1. The old selection

Image

2. Load the file

Image

3. Display the textfile ( includes 20 possible games ) with xBrowse and select a line

Image

4. The result of the new selection

Image

best regards
Uwe :D
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Sudoku with fwh

Postby Silvio.Falconi » Wed Jan 21, 2015 6:20 pm

yes but the user easy select allways the same sudoku ( he learn how resolve it )... ahahahahh :)

Instead I made another function :


the procedure select a sudolu on nRandom...


Code: Select all  Expand view  RUN


Function SudokuLoad(nLevel)
  Local aLoadstring:= Load_File_Sudoku(nLevel)
  Local nConteggioSudoku:=Len(aLoadstring)
  Local nSudoku:= nRandom(nConteggioSudoku-1)+1
  Local nBlocchi,nCelle ,nGet:= 0
  Local cSudoku:= alltrim(aLoadstring[nSudoku])
  Local atest:= {}
  Local anumeri := {}
  Local cNumeri:=""
  Local nNumero:= 0
   local arows:= {}
local acols:= {}
   Local ncol:= 0

  For nBlocchi=1 to 9
            For nCelle=1 to 9
                  ncol+= 1
                  nNumero+=1

                If alltrim(StrChar( cSudoku,  nNumero ))=="0"
                       cStringa:=" "
                   else
                      cStringa:=alltrim(StrChar( cSudoku, nNumero))
                endif

                aadd( acols, cStringa)


                   IF nCol== 9
                       aadd( arows, {acols[1],;
                                          acols[2],;
                                          acols[3],;
                                          acols[4],;
                                          acols[5],;
                                          aCols[6],;
                                          acols[7],;
                                          aCols[8],;
                                          aCols[9]} )
                                nCol:= 0
                               acols:= {}
               endif
           next
next
return arows

Function Load_File_Sudoku(nLevel)
   Local cPathdata:=".\data\"
   Local cFile:=cPathdata+"
level"+alltrim(str(nLevel))+".txt"
   Local aTest := {}
   Local n
   Local oText

    oText:= TTxtFile():New( cFile )

FOR n = 1 to oText:RecCount()
      AADD( aTest,  oText:ReadLine() )
    //  MsgAlert( aTest[n], "
Array-line : " + ALLTRIM(STR(n)) )
      oText:Skip()
NEXT
oText:Close()
Return atest




on main inset aSudoku := SudokuLoad(1) //nLevl1


Image

notice !!
I change the header od test ...run ok
I create the new array with letters
I not Like the idea to create two xbrowse one for the letters and one for the number ... i believe it must one xbrowse to create sudoku

Code: Select all  Expand view  RUN


//Project sudoku with xbrowse

#include "Fivewin.ch"
#include "Xbrowse.ch"



Static oSquare
Static aData
Static aSudoku
Static aOriginal
static oSayText1
static cMessage


FUNCTION MAIN()
 Local odlg, oSay[9]
 Local aPrompt := { "a", "b", "c", "d", "e", "f", "g", "h", "i" }
 Local oFontSquare

 cMessage :="MESSAGE"
 aData:= {}
 aSudoku  :=  SudokuLoad(1)  //nLevl1
 aOriginal:= aSudoku

 //create the aData
   For n=1 to 9
      aadd( aData,{aprompt[n],aSudoku[1][n],;
                              aSudoku[2][n],;
                              aSudoku[3][n],;
                              aSudoku[4][n],;
                              aSudoku[5][n],;
                              aSudoku[6][n],;
                              aSudoku[7][n],;
                              aSudoku[8][n],;
                              aSudoku[9][n],;
                              })
     next





DEFINE FONT oFontSquare NAME "Ms Sans Serif" SIZE 0, -22
DEFINE DIALOG oDlg SIZE 81*5,81*5;
COLOR CLR_BLACK,CLR_WHITE PIXEL ;
Title "Sudoku with Xbrowse"



@ 10, 20 XBROWSE oSquare OF oDlg ARRAY aData  ;
         LINES CELL cols{ 1,2,3,4,5,6,7,8,9,10 }          ;
         HEADER "","1", "2", "3", "4","5","6", "7","8","9" ;
         COLSIZES 25,30, 30, 30, 30, 30, 30, 30, 30, 30, 30 ;
         SIZE 156,156  NOBORDER PIXEL FONT oFontSquare




@ 180,10 say oSayText1  Prompt cMessage OF oDlg size 150,10  PIXEL  TRANSPARENT  update



oSquare:aCols[ 1 ]:bClrStd = { || { , 15195087 } }
oSquare:aCols[1]:nDataStrAlign := AL_CENTER

                For n= 2 to 10
                   oSquare:aCols[n]:bClrstd :=  {|| { 0, SudokuBackColor()  } }
                   oSquare:aCols[n]:nDataStrAlign := AL_CENTER
                   oSquare:aCols[n]:lAllowSizing := .F.
                   oSquare:aCols[n]:nEditType := EDIT_GET
                 next


*oSquare:bLClicked := { | nRow, nCol | C_ACTION(oSquare, aSudoku, oSquare:KeyNo(), oSquare:SelectedCol():nCreationOrder, aPrompt ) }


Ut_BrwRowConfig( oSquare )



oSquare:bchange  := { || oSayText1:SetText(WichNumber(aOriginal,aData)) }











oSquare:CreateFromCode()





ACTIVATE DIALOG oDlg

RETURN NIL

Function Colore_Grid()
   Local nColor
   Local nCol:= oSquare:SelectedCol():nCreationOrder

   Do case
   case nCol <= 3


   Do case
      case oSquare:KeyNo() <=3
          nColor:= CLR_HCYAN
       case oSquare:KeyNo() > 3 .and.  oSquare:KeyNo()  <=6
          nColor := CLR_YELLOW
       case oSquare:KeyNo() >6
          nColor := CLR_HGRAY
       Endcase

   case nCol > 3 .and. nCol <= 6
        Do case
      case oSquare:KeyNo() <=3
          nColor:= CLR_YELLOW
       case oSquare:KeyNo() > 3 .and.  oSquare:KeyNo()  <=6
          nColor := CLR_HRED
       case oSquare:KeyNo() >6
          nColor := CLR_HCYAN
       Endcase

   case nCol > 6
        Do case
      case oSquare:KeyNo() <=3
          nColor:= CLR_HCYAN
       case oSquare:KeyNo() > 3 .and.  oSquare:KeyNo()  <=6
          nColor := CLR_YELLOW
       case oSquare:KeyNo() >6
          nColor := CLR_HGRAY
       Endcase
  Endcase

   return nColor


   function SudokuBackColor()

  local rowindex := oSquare:KeyNo()
  local colindex := oSquare:SelectedCol():nCreationOrder

  do case

    case rowindex <= 3 // first row
      do case
        case colindex <= 3 // first col
          return CLR_HCYAN
        case colindex > 3 .and. colindex <= 6 // second col
          return CLR_YELLOW
        case colindex > 6 // third col
          return CLR_HCYAN
      endcase

    case rowindex > 3 .and. rowindex <= 6  // second row
      do case
        case colindex <= 3 // first col
          return CLR_HCYAN
        case colindex > 3 .and. colindex <= 6 // second col
          return CLR_YELLOW
        case colindex > 6 // third col
          return CLR_HCYAN
      endcase

    case rowindex > 6 // third row
      do case
        case colindex <= 3 // first col
          return CLR_YELLOW
        case colindex > 3 .and. colindex <= 6 // second col
          return CLR_HCYAN
        case colindex > 6 // third col
          return CLR_HCYAN
      endcase

  endcase


 
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7090
Joined: Thu Oct 18, 2012 7:17 pm

Re: Sudoku with fwh

Postby ukoenig » Wed Jan 21, 2015 8:30 pm

Silvio,

the reason for the 2. xBrowse
( moved to the right hand side )

1. I don't want to use the keyboard, to type a cellvalue.
--- the numbered 1. col of the 2. browse works like a picklist of a number
--- I just pick a number and click on any cell, I want to add it ( much better and faster ).
2. I don't want to use buttons. The 2. col includes all the functions I need.

If You don't like it, we could click on the header of xBrowse 1, to pick a number.

FOR nFor := 1 to 9
oSquare:aCols[ nFor ]:bRClickHeader := {|r,c,f,o| nNumber := o:cHeader }
NEXT


It all works using only the mouse !!!.

On Cellclick

FUNCTION C_ACTION(aSudoku, nRPos, nCPos, nNumber)
IF EMPTY( aSudoku[nRPos][nCPos] )
aSudoku[nRPos][nCPos] := nNumber // selected number from browser 2
ENDIF
RETURN(NIL)


Image

what do You think about ?

best regards
Uwe :?:
Last edited by ukoenig on Thu Jan 22, 2015 11:23 am, edited 1 time in total.
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Sudoku with fwh

Postby Silvio.Falconi » Thu Jan 22, 2015 9:02 am

Uwe, I Wish return on old exe ( with tgets) because with xbrowse is too hard

For xbrowse

to converte Dos function I need e variables

number of the block
number of the line
number of the column


First function
Verify_all()
Info : Where I use tget class for each number i insert a valid to verify what the user insert
Syntax
Verify_all(campo,blocco,linea,colonnna,oControl)

for a sample :

@ nrow, ncol get aGet[1] var ax1 pict "9" PIXEL SIZE SIZEX,SIZEY OF oDlg NOBORDER CENTER VALID ax1 $ " 123456789" .and. Verify_all(ax1,1,1,1,aGet[1]) FONT oFontNumeri UPDATE

when the mouse is on a cell it need return these values and if I click the left button it must open a popup with a menu type

verify Block - > want number of the block
verify Line - > want number of the line
verify column - > want number of the column


on menu pulldown on the dialog can insert a menu with these command and the menuitems
Verify all

Resolve method1
Resolve method2
Resolve method3
----------------------
clear
----------------------
load a sudoku
Save a sudoku
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7090
Joined: Thu Oct 18, 2012 7:17 pm

Re: Sudoku with fwh

Postby Silvio.Falconi » Thu Jan 22, 2015 9:09 am

ON COLOR

Local nCol := oSquare:SelectedCol():nCreationOrder

IT IS BAD BECAUSE i NEED THE COLUM OD THE XBROWSE AND NOT THE COLUM SELECTED

THE ERROR : WHEN I SELECT A COLUMN IT CHANGE COLOR
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7090
Joined: Thu Oct 18, 2012 7:17 pm

Re: Sudoku with fwh

Postby ukoenig » Thu Jan 22, 2015 11:24 am

Drawing figures on a xBrowse-data-area using different colors :

Image

Code: Select all  Expand view  RUN

FOR n := 1 TO LEN(oSquare:aCols)
  WITH OBJECT oSquare:aCols[ n ]
    :nEditType := EDIT_GET
    :lAllowSizing := .F.
    :nDataStrAlign := AL_CENTER
    :nHeadStrAlign := AL_CENTER
    IF n < 4
      oSquare:aCols[n]:bClrstd := {|| { 255, IIF( oSquare:KeyNo()  > 3 .and. ;
      oSquare:KeyNo() < 7, 16768185, 16772572 ) } }      
    ELSEIF n > 3 .and. n < 7
      oSquare:aCols[n]:bClrstd := {|| { 255, IIF( oSquare:KeyNo()  > 3 .and. ;
      oSquare:KeyNo() < 7, 16772572, 16768185 ) } }      
    ELSEIF n > 6
      oSquare:aCols[n]:bClrstd := {|| { 255, IIF( oSquare:KeyNo()  > 3 .and. ;
      oSquare:KeyNo() < 7, 16768185, 16772572 ) } }    
    ENDIF
  END
NEXT
 

best regards
Uwe :D
Last edited by ukoenig on Thu Jan 22, 2015 12:15 pm, edited 4 times in total.
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: richard-service and 8 guests