Visual Basic
If control(0) = "A" Then
procount(0) = procount(0) + 1
ElseIf control(1) = "A" Then
procount(1) = procount(1) + 1
ElseIf control(2) = "A" Then
procount(2) = procount(2) + 1
ElseIf control(3) = "A" Then
procount(3) = procount(3) + 1
End If
not to mention that this is
only checking 4 spots in an array, think of all the copying and pasting if you have 16 indices... or 64... or more!
Python
pcount = 0
control = [
"A", "B", "C", "D", "A", "A", "B", "A"
]
for x in control:
if x == "A":
pcount = pcount + 1
print pcount
Any amount in the array and the same 3 lines of the for loop works. BOOM
Or maybe I don't know how to do a for loop in VB
Actually that's probably it.Anyway I need this code for reasons. I'll try to make a map game using python with TkInter and stuff yes.
^ How far I was in VB