Android Question Crossword grid

cenyu

Active Member
Licensed User
Longtime User
Hi friends...Can you share with me some code for creation of grid like crossword?
 

Jeffrey Cameron

Well-Known Member
Licensed User
Longtime User
What exactly are you asking for? How to draw a grid on a canvas? How to create a table like an HTML table? Or are you asking for code to take a list of words and arrange them as in a crossword puzzle?

The latter request is not a trivial subject, and you can find many algorithms and discussions on-line covering this topic with a simple Google search.
 
Upvote 0

MarkusR

Well-Known Member
Licensed User
Longtime User
created at designer
B4X:
Private Panel1 As Panel

call painting
B4X:
Grid(Panel1)

B4X:
Sub Grid(PanelPaint As Panel)
   
    Dim c As Canvas
    c.Initialize(PanelPaint)
    c.DrawColor(Colors.White)
   
    Dim Rect1 As Rect
   
    For x = 0dip To 100dip Step 10dip
        For y = 0dip To 100dip Step 10dip
            Rect1.Initialize(x,y, 10dip, 10dip)
            c.DrawRect(Rect1, Colors.Black, False, 1dip)
        Next
    Next
   
    PanelPaint.Invalidate
   
End Sub
 
Upvote 0
Top