When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.
21 messages · Page 1 of 1 (latest)
When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.
@vestal wolf Has your question been resolved? If so, type !solved :)
what's wrong with it? ah nevermind, you said that
my beamsplitter " | " would only go down, and my beamsplitter " " would only go right, I want it reflect both ways.
This is probably because you have this:c++ if (direction == "left" || direction == "right") { direction = "up"; direction = "down"; }
this doesn't do what you want it to do
but I'm not sure what that is. Do you want the beam to go in two directions simultaneously?
yes I want it to be able to split both going up and down until it is no longer visible in the 7x7 grid
I think its overriding to only using the down and right
yeah that's what it's doing
this sounds like a typical DFS exercise
by the way, you should really use an enum class instead of strings for the directions
if you have a typo somewhere, like doen instead of down, then the compiler won't tell you if you're using strings
but with an enum class, it will
or maybe it's BFS instead of DFS, actually
Is there anything way I can have it reflect both ways (up and down) and (left and right)?
your function already takes a laserQueue as parameter
you can insert new nodes into that queue
if you're unsure how exactly you should do that, then it's probably a good idea to look up how BFS works
got it thank you so much! heading to another class will update you asap