Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nested loops don't work. #2

Open
RustyRaptor opened this issue Oct 17, 2019 · 1 comment
Open

Nested loops don't work. #2

RustyRaptor opened this issue Oct 17, 2019 · 1 comment

Comments

@RustyRaptor
Copy link

I was testing this in repl.it it doesn't support nested loops. The LCI interpreter does however. I mean you can just test this with a simple nested loop but here's the code im using.

I HAS A a ITZ 1
I HAS A b ITZ 1
I HAS A c ITZ 1
I HAS A n
I HAS A message ITZ "pls entr teh var N thxlol"
VISIBLE message
GIMMEH n



IM IN YR ah UPPIN YR a TIL BOTH SAEM a AN 5
	IM IN YR bh UPPIN YR b TIL BOTH SAEM b AN 5
		IM IN YR ch UPPIN YR c TIL BOTH SAEM c AN 5
			VISIBLE a
			VISIBLE b
			VISIBLE c
			VISIBLE "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
		IM OUTTA YR ch
	IM OUTTA YR bh
IM OUTTA YR ah
@Camto
Copy link

Camto commented Jul 4, 2020

This is not a bug, c just stays at 5 after the innermost loop, so even when a and b change, nothing will be printed. Here's a working example:

I HAS A a ITZ 1
I HAS A b ITZ 1
I HAS A c ITZ 1

IM IN YR ah UPPIN YR a TIL BOTH SAEM a AN 5
	b R 1
	IM IN YR bh UPPIN YR b TIL BOTH SAEM b AN 5
		c R 1
		IM IN YR ch UPPIN YR c TIL BOTH SAEM c AN 5
			VISIBLE a
			VISIBLE b
			VISIBLE c
			VISIBLE "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
		IM OUTTA YR ch
	IM OUTTA YR bh
IM OUTTA YR ah

(https://repl.it/@Camto/Nested-Loops)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants