Official Everybody Edits Forums

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.

#1 2018-09-04 15:09:52, last edited by Anatoly (2018-09-04 15:13:44)

Anatoly
Guest

(Switch System Question)

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

#2 2018-09-04 15:23:10

LukeM
Member
From: England
Joined: 2016-06-03
Posts: 3,009
Website

Re: (Switch System Question)

I don't understand, what exactly is it that you're checking for?

Offline

Wooted by:

#3 2018-09-04 15:30:51

Anatoly
Guest

Re: (Switch System Question)

I can't explain better than what I did //forums.everybodyedits.com/img/smilies/sad

#4 2018-09-04 15:33:25, last edited by LukeM (2018-09-04 15:33:48)

LukeM
Member
From: England
Joined: 2016-06-03
Posts: 3,009
Website

Re: (Switch System Question)

Anatoly wrote:

I can't explain better than what I did //forums.everybodyedits.com/img/smilies/sad

You didn't explain what it is you're checking for at all did you? //forums.everybodyedits.com/img/smilies/tongue

You said you have two sets of 10 switches, each with one switch on (which was explained well //forums.everybodyedits.com/img/smilies/smile), 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

Wooted by:

#5 2018-09-04 15:49:23

Anatoly
Guest

Re: (Switch System Question)

LukeM wrote:
Anatoly wrote:

I can't explain better than what I did //forums.everybodyedits.com/img/smilies/sad

You didn't explain what it is you're checking for at all did you? //forums.everybodyedits.com/img/smilies/tongue

You said you have two sets of 10 switches, each with one switch on (which was explained well //forums.everybodyedits.com/img/smilies/smile), 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

#6 2018-09-04 15:51:44

LukeM
Member
From: England
Joined: 2016-06-03
Posts: 3,009
Website

Re: (Switch System Question)

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?)

Offline

#7 2018-09-04 15:56:12

Anatoly
Guest

Re: (Switch System Question)

LukeM wrote:
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();
}
Wooted by:

#8 2018-09-04 15:57:37

LukeM
Member
From: England
Joined: 2016-06-03
Posts: 3,009
Website

Re: (Switch System Question)

Anatoly wrote:
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 //forums.everybodyedits.com/img/smilies/smile
(I'll give it a go in a bit)

Offline

#9 2018-09-04 16:00:24, last edited by Pingohits (2018-09-04 16:17:51)

Pingohits
Banned
From: aids lizard
Joined: 2015-02-15
Posts: 7,591

Re: (Switch System Question)

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

Hidden text

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


791mAP8.png

Offline

Wooted by: (3)

#10 2018-09-04 16:12:39

Anatoly
Guest

Re: (Switch System Question)

Correct. Anyways, during the thread I evolved my own system, bit glitchy, but seems to work.

Thank s to everyone

NT5t7xJ.png

#11 2018-09-04 16:15:13, last edited by LukeM (2018-09-04 16:15:54)

LukeM
Member
From: England
Joined: 2016-06-03
Posts: 3,009
Website

Re: (Switch System Question)

https://everybodyedits.com/games/PW_xTGIIKRcEI

That should work //forums.everybodyedits.com/img/smilies/smile

Edit: Seems you've already come up with a solution though //forums.everybodyedits.com/img/smilies/tongue

Offline

#12 2018-09-04 16:47:39

mutantdevle
Moderation Team
From: Hell
Joined: 2015-03-31
Posts: 3,847
Website

Re: (Switch System Question)

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.


kMMA0S6.png dxGW6FY.png

Offline

#13 2018-09-05 15:53:54

MWstudios
Member
From: World 4-2
Joined: 2018-04-06
Posts: 1,331

Re: (Switch System Question)


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
giphy.gif 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

#14 2018-09-05 17:43:16

Pingohits
Banned
From: aids lizard
Joined: 2015-02-15
Posts: 7,591

Re: (Switch System Question)

all you did was link to a discussion regarding switch resetters, which is entirely different from the topic at hand


791mAP8.png

Offline

#15 2018-09-05 17:45:50, last edited by MWstudios (2018-09-05 17:46:16)

MWstudios
Member
From: World 4-2
Joined: 2018-04-06
Posts: 1,331

Re: (Switch System Question)

Pingohits 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
giphy.gif 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

#16 2018-09-05 17:48:31

Pingohits
Banned
From: aids lizard
Joined: 2015-02-15
Posts: 7,591

Re: (Switch System Question)

MWstudios wrote:

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


791mAP8.png

Offline

Wooted by: (3)

#17 2018-09-05 18:06:13

Anatoly
Guest

Re: (Switch System Question)

Answered = Closed

//forums.everybodyedits.com/img/smilies/smile

Anatoly1536167173723395

Board footer

Powered by FluxBB

[ Started around 1711637168.6281 - Generated in 0.109 seconds, 11 queries executed - Memory usage: 1.68 MiB (Peak: 1.91 MiB) ]