Article View: be.comp.programming
Article #6649visual basic
From: Christian
Date: Sun, 17 Nov 2002 19:58
Date: Sun, 17 Nov 2002 19:58
116 lines
3363 bytes
3363 bytes
Hallo,
Wanneer ik de code van hieronder laat werken, dan wordt er mij eerst
gevraagd hoeveel kinderen er zijn, bv 5.
Daarna wordt mij gevraagd uit hoeveel lettergrepen het versje bestaat, bv 4.
Hierna wordt me door het programma meegedeeld welk kind er over blijft. Op
deze manier : kind 1, 2, 3 en 4 vald af. Het programma begint opnieuw te
tellen vanaf 5. 5, 1, 2 en 3 vald af enz... tot wanneer kind 1 over blijft.
Dit begrijp ik allemaal wel, maar niet wat er zich nu juist in de code
afspeeld. Vooral niet in het stuk : 'simulatie van het aftelrijmpje
Is er iemand die me dit kan uitleggen aub? En vooral waarvoor deze
variabelen staan : bytPointKind, bytPointLetter.
Alvast bedankt,
Christian.
Sub Main()
'declaratie van een aantal hulpvariabelen
Dim bytAantSnoep, bytAantKindStart, bytAantLetter As Byte
Dim bytPointKind, bytPointLetter As Byte
'opvragen van het aantal kinderen
Console.Write("hoeveel kinderen : ")
bytAantSnoep = Console.ReadLine()
bytAantKindStart = bytAantSnoep
'declaratie van de tabel
Dim tblTabel(bytAantSnoep - 1) As Byte
'opvragen van het aantal lettergrepen
Console.Write("hoeveel lettergrepen : ")
bytAantLetter = Console.ReadLine()
'simulatie van het aftelrijmpje
Do While bytAantSnoep > 1
bytPointLetter = 0
Do Until bytPointLetter = bytAantLetter
bytPointLetter += 1
Do
If bytPointKind > bytAantKindStart - 1 Then
bytPointKind = 1
Else
bytPointKind += 1
End If
Loop Until tblTabel(bytPointKind - 1) = 0
Loop
tblTabel(bytPointKind - 1) = 1
bytAantSnoep -= 1
Console.WriteLine("kind " & bytPointKind & " is 'af'")
Loop
'afdrukken van het 'overgebleven' kind
For bytPointKind = 1 To bytAantKindStart
If tblTabel(bytPointKind - 1) = 0 Then _
Console.WriteLine("kind " & bytPointKind & " is 'over'")
Next
Console.ReadLine()
End Sub
Technical Details
Message-ID:
<xxSB9.6259$Ti2.834@afrodite.telenet-ops.be>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-05!sn-xit-06!sn-xit-04!supernews.com!newsfeed.gamma.ru!Gamma.RU!isdnet!skynet.be!skynet.be!ossa.telenet-ops.be!afrodite.telenet-ops.be.POSTED!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: DUTCH,ASCII-7-bit X-Google-Thread: fcea4,bd0c30061cae82ce,start X-Google-Attributes: gidfcea4,public X-Google-ArrivalTime: 2002-11-17 12:07:53 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-05!sn-xit-06!sn-xit-04!supernews.com!newsfeed.gamma.ru!Gamma.RU!isdnet!skynet.be!skynet.be!ossa.telenet-ops.be!afrodite.telenet-ops.be.POSTED!not-for-mail From: "Christian" <Christian.Rosseel@pandora.be> Newsgroups: be.comp.programming Subject: visual basic Lines: 125 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2720.3000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Message-ID: <xxSB9.6259$Ti2.834@afrodite.telenet-ops.be> Date: Sun, 17 Nov 2002 19:58:21 GMT NNTP-Posting-Host: 213.118.192.185 X-Complaints-To: abuse@telenet.be X-Trace: afrodite.telenet-ops.be 1037563101 213.118.192.185 (Sun, 17 Nov 2002 20:58:21 MET) NNTP-Posting-Date: Sun, 17 Nov 2002 20:58:21 MET Organization: Telenet Internet