Albuquerque challenge

From Esolang
Jump to navigation Jump to search

the albuquerque challenge is a programming challenge by user:tommyaweosme after getting 3-4 hours into a 17-hour video called "albuquerque but every time a word repeats it loops (normal speed)".

goal

the goal of this challenge is to make a program that takes an input from the user, and then outputs a string of text that is the input from the user, except every time a word is repeated it loops back to its previous usage.

as an example,

i am awesome person. am i cool? i guess i am

when inputted to the program, would output

i am awesome person. am awesome person. am i am awesome person. am i cool? i cool? i guess i guess i am i cool? i guess i am

(this gets out of hand very quickly.)

interpretations

there's one made in penguinmod on user:tommyaweosmes school computer, verrrry slow, and using text to speech for some reason (they blocked scratch :( )

any actual interpretations can go down here.

Here's an implementation, but performed on each letter:

printend = ""
pstr = input()#.split(" "); printend = " "
ba = [True for i in pstr]

cnt = 0
while cnt < len(pstr):
	if ba[cnt]:
		cntj = cnt-1
		while cntj >= 0:
			if pstr[cntj] == pstr[cnt]:
				ba[cnt] = False
				cnt = cntj
				break
			cntj -= 1
	print(pstr[cnt], end=printend)
	cnt += 1

Remove the only # to make it perform on words!
_i__s__l__p__t__n__g_ 04:21, 18 December 2024 (UTC)