options = "zero -1 two three four -55555 six -7777777 eight nine ten -11 twelve thirteen fourteen -123454321 -15 sixteen -17"
hyphenIndex, spaceIndex, tokenTuple = (), (), ()
pos = 0
print(options)
while pos < len(options):
if options[pos] == "-":
hyphenIndex = hyphenIndex + (pos,)
print("HYPH: \'-\'", pos)
tmpPos = options.find(" ", pos)
if tmpPos != -1:
pos = tmpPos
spaceIndex = spaceIndex + (pos,)
print("ZERO: \' \'", pos)
if len(hyphenIndex) > len(spaceIndex):
spaceIndex = spaceIndex + (len(options),)
pos += 1
flagSlices = tuple(zip(hyphenIndex, spaceIndex))
print(flagSlices)
for start, end in flagSlices:
print(start, end)
print(options[start:end])
I don't know, it works, fuck you.
It's really annoying ho there's no required semi-colon to end statements and how loops / conditions / whatever else ends in colon. The tab thing is kind of cool, the "immutable" lie is stupid AF and I spent more time working through that than anything else. That I can't change the step rate of my iterator in a for loop is just bad.
Oh, range(5) = [0, 4], but it's actually [0, 5), it's dumb, I hate it, it doesn't mimic C as is often claimed and ... what ever.
Oh, "HUMAN READABLE" kill yourself.
options = "zero -1 two three four -55555 six -7777777 eight nine ten -11 twelve thirteen fourteen -123454321 -15 sixteen -17"
hyphenIndex, spaceIndex, tokenTuple = (), (), ()
pos = 0
print(options)
while pos < len(options):
if options[pos] == "-":
hyphenIndex = hyphenIndex + (pos,)
print("HYPH: \'-\'", pos)
tmpPos = options.find(" ", pos)
if tmpPos != -1:
pos = tmpPos
spaceIndex = spaceIndex + (pos,)
print("ZERO: \' \'", pos)
if len(hyphenIndex) > len(spaceIndex):
spaceIndex = spaceIndex + (len(options),)
pos += 1
flagSlices = tuple(zip(hyphenIndex, spaceIndex))
print(flagSlices)
for start, end in flagSlices:
print(start, end)
print(options[start:end])
I don't know, it works, fuck you.
It's really annoying ho there's no required semi-colon to end statements and how loops / conditions / whatever else ends in colon. The tab thing is kind of cool, the "immutable" lie is stupid AF and I spent more time working through that than anything else. That I can't change the step rate of my iterator in a for loop is just bad.
Oh, range(5) = [0, 4], but it's actually [0, 5), it's dumb, I hate it, it doesn't mimic C as is often claimed and ... what ever.
Oh, "HUMAN READABLE" kill yourself.
(post is archived)