vb 2008

how to find and fill the next number in a dynamic array

Page 1 of 1

0 Replies - 667 Views - Last Post: 16 September 2009 - 07:59 AM Rate Topic: -----

#1 janaki   User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 22
  • Joined: 11-April 08

vb 2008

Posted 16 September 2009 - 07:59 AM

I have an Idea how to look for next number but I need some help to put into vb 2008 code I am new to vb so please help me

Findnext(fromcell, fromvalue):boolean
• Result=false;
• Insert Fromvalue into Fromcell
• If Fromvalue is the last point (NxN) then set result=true and exit.
• Fromvalue not the last point:
o Set Nextvalue=Fromvalue+1,
o For each of the 4 directions check the neighbor (Nextcell)
 Is Nextcell empty and Nextvalue not predefined?
 Yes: Result=Findnext(.Nextpoint, Nextvalue)
 No: If Nextcell already contains Nextval then this is a predefined number,
 Result=Findnext(Nextcell,Nextval);
o end neighbor search loop
• if Result=False and Fromvalue was not predefined then set Fromcell abck to empty

I have to write a function findnext()

Can please some one help me

Thank you

Is This A Good Question/Topic? 0
  • +

Page 1 of 1