If, as others suspect, this is homework, then this answer probably will not help. However, if this is for a real project, it might make sense to create a generator instead, which is an easy and idiomatic task in some languages ββsuch as Python. Something like that:
def letterPattern(): pattern = [0] while True: yield pattern pattern[0] += 1
Instead of giving the pattern itself, you can undo it and display from 0 to A, from 1 to B, etc., then enter a line. I ran the code above and it seems to work, but I have not tested it at all.
Hope you find this readable enough for implementation, even if you don't know Python. (For Pythonistas there, yes, the "for i in range (...)" loop is ugly and fearless, but from my point of view, I donβt know another way to do what I do here)
source share