Do you think I could just leave this part blank and it'd be okay? We're just going to replace the whole thing with a header image anyway, right?
You are not logged in.
Pages: 1
Topic closed
Hello,
let's say I have the switches 1, 2, 3, 4, 5, 6, 7, 8, 9 and 0, and the switches 11, 12, 13, 14, 15, 16, 17, 18, 19, 10. Of each set (0-9 and 10-19 one switch is activated (e.g. 5 and 17). How do I check all 20 switches how fast as possible and with very few space?
Gravity is down, any other combinations (e.g. 5 and 17) should redirect to portal A (lose), (e.g. 15 and 5) should be redirected to portal B (win)
Thanks in advance
I can't explain better than what I did
I can't explain better than what I did
You didn't explain what it is you're checking for at all did you?
You said you have two sets of 10 switches, each with one switch on (which was explained well ), but then just said you need to 'check' them, and that some 'other?' combinations should go to portal A, and some should go to portal B.
Offline
Anatoly wrote:I can't explain better than what I did
You didn't explain what it is you're checking for at all did you?
You said you have two sets of 10 switches, each with one switch on (which was explained well
), but then just said you need to 'check' them, and that some 'other?' combinations should go to portal A, and some should go to portal B.
"representiv"
1 - 11
2 - 12
3 - 14
4 - 15
5 - 16
...
e.g. 6 - 14 would make an error
Anatoly wrote:▼LukeM wrote:"representiv"
1 - 11
2 - 12
3 - 14
4 - 15
5 - 16
...e.g. 6 - 14 would make an error
So checking if the same switch is enabled in both sets? (and the 3-14, etc ones are typos?)
switchList1 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 0];
switchList2 = [11, 12, 13, 14, 15, 16, 17, 18, 19, 10];
// I need something like this:
if (switchList1.indexOf(true) == switchList2.indexOf(true)) {
redirectToPortalA();
} else {
redirectToPortalB();
}
LukeM wrote:▼Anatoly wrote:So checking if the same switch is enabled in both sets? (and the 3-14, etc ones are typos?)
switchList1 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 0]; switchList2 = [11, 12, 13, 14, 15, 16, 17, 18, 19, 10]; // I need something like this: if (switchList1.indexOf(true) == switchList2.indexOf(true)) { redirectToPortalA(); } else { redirectToPortalB(); }
Ok, yes then
(I'll give it a go in a bit)
Offline
So it's essentially checking one-to-one correspondence of sets A and B, such that A = {1, 2, ...9, 0} and B= {11, 12, ...19, 10}, am I correct? So (1,11) and (5, 15) would return true, while (6, 17) and (2, 10) would return false
EDIT: here you go
you can test it here (PW7YNomYvZcEI)
unsure if you want it to check for elements that are greater than 2 (i.e. (1,11,5) would return false), but if you do I'll make another
Offline
Correct. Anyways, during the thread I evolved my own system, bit glitchy, but seems to work.
Thank s to everyone
https://everybodyedits.com/games/PW_xTGIIKRcEI
That should work
Edit: Seems you've already come up with a solution though
Offline
I have a method of solving this which is more compact than Pingo's (I think) and also makes it so that key input is futile when inside the system but both your own and Pingo's solutions work fine. If you want my approach then feel free to PM me though.
Offline
Time before becoming a Member - Leaderboard
1. Whirl - 9 months
2. KirbyKareem - 8 months
3. pwnzor - 2.4 months
4. MWstudios - 2 months
5. ILikeTofuuJoe - 1.5 months Piskel is the best GIF maker I've seen
HG's signature for me - Anatoly's signature for me
The Mashed Potatoes Song - The longest post on EE forums - Play my Minesweeper
Offline
all you did was link to a discussion regarding switch resetters, which is entirely different from the topic at hand
Offline
MWstudios wrote:all you did was link to a discussion regarding switch resetters, which is entirely different from the topic at hand
aren't you discussing switch resetting? then I think I missed what is this topic about
Time before becoming a Member - Leaderboard
1. Whirl - 9 months
2. KirbyKareem - 8 months
3. pwnzor - 2.4 months
4. MWstudios - 2 months
5. ILikeTofuuJoe - 1.5 months Piskel is the best GIF maker I've seen
HG's signature for me - Anatoly's signature for me
The Mashed Potatoes Song - The longest post on EE forums - Play my Minesweeper
Offline
aren't you discussing switch resetting? then I think I missed what is this topic about
no, anatoly is asking for systems that check for one-to-one correspondence between sets of equal cardinality
i dont know why i said it that way, but if you have A = {1, 2, 3} and B = {4, 5, 6}, anatoly wants the system to return TRUE for (1,4), (2,5), and (3,6). That is, correspondence between two collections of numbers
Offline
Answered = Closed
Pages: 1
Topic closed
[ Started around 1741020709.8886 - Generated in 0.083 seconds, 13 queries executed - Memory usage: 1.69 MiB (Peak: 1.92 MiB) ]