Discuss Scratch
- SuperDoom
-
Scratcher
1000+ posts
___ or ___ but not both block [XOR]
+0
Workaround:
Workaround:
<<<> or < >> and <not <<> and < >>>>
- Nether_before
-
Scratcher
1000+ posts
___ or ___ but not both block [XOR]
Semi support, seems useful and less messy but there's an easy workaround.
- rdococ
-
Scratcher
1000+ posts
___ or ___ but not both block [XOR]
No support.
Just use this:
Just use this:
<not <(x) = (y)>>replacing x with the first boolean to test, and y with the second.
- codeman1044
-
Scratcher
1000+ posts
___ or ___ but not both block [XOR]
You could use something like this:
Almost all (if not all) logic gates can be made using <and> and <not>
<<<(value1)=[true]> or <(value2)=[true]>>and<not<(value1)=(value2)>>>Basically word for word what you're requesting.
Almost all (if not all) logic gates can be made using <and> and <not>
Last edited by codeman1044 (May 17, 2019 17:41:44)
- Games_Frosch
-
Scratcher
41 posts
___ or ___ but not both block [XOR]
I find that an xor block would be useful to have in scratch. I definatly support that topic! Of course you can do {if 1 or 2 and not 1 and 2} but an xor block would be quicker, easier and very useful. 

- --Explosion--
-
Scratcher
1000+ posts
___ or ___ but not both block [XOR]
Workaround:
<((<boolean #1::grey>) + (<boolean #2::grey))=[1]>Note, I am not block spamming or not supporting this suggestion because there is a workaround, I am simply providing the workaround to add to this discussion
- Bacteria999
-
Scratcher
1000+ posts
___ or ___ but not both block [XOR]
Isn't xor the same thing as ≠?
<[2] ≠ [1] :: operators>
Last edited by Bacteria999 (April 7, 2020 16:30:21)
- Games_Frosch
-
Scratcher
41 posts
___ or ___ but not both block [XOR]
The xor block would be useful for many numbers. {If 1 or 2 or 3 and not 1 and 2 and not 1 and 3 and not 2 and 3} if quite long even though there are only 3 numbers. Maybe you need 100 numbers! Imagine that! {If 1 or 2 or 3 or 4 or 5 or 6… or 100 and not 1 and 2 and not 1 and 3 … and not 1 and 100 and not 2 and 3 and not … 2 and 100 …….. and not 99 and 100} That would take AGES only for that block!
- Bacteria999
-
Scratcher
1000+ posts
___ or ___ but not both block [XOR]
can anyone answer my question?
Last edited by Bacteria999 (April 7, 2020 18:53:36)
- Super_Scratch_Bros20
-
Scratcher
1000+ posts
___ or ___ but not both block [XOR]
if <<> or <>> then
if <not <<> and <>>> then
end
end
Edit: Here's a simple workaround I discovered. Of course, this may help with experienced Scratchers. But as for new Scratchers, the concept of XOR may be found complicated, especially if they don't know what they're doing. It's simple to understand the concepts “and”, “not” or “or”, but they may not catch onto XOR, especially after Scratch got rid of the block identification thing after 3.0. (I don't remember what it's called. Sorry!)
Last edited by Super_Scratch_Bros20 (April 7, 2020 19:59:32)
- Super_Scratch_Bros20
-
Scratcher
1000+ posts
___ or ___ but not both block [XOR]
-snip-
@Za-Chary* said that what I previously said was false.
@Za-Chary* said that what I previously said was false.
Last edited by Super_Scratch_Bros20 (April 10, 2020 01:16:55)
- Za-Chary
-
Scratcher
1000+ posts
___ or ___ but not both block [XOR]
-snip-No, that workaround is correct. If a and b are both false, then a = b and so not(a = b) is false. Similarly, if a and b are both true, then a = b and so not(a = b) is false. But if a is true and b is false (or vice versa) then a = b is false, making not(a = b) true. Thus the script runs as intended — if exactly one is true, then it returns true, otherwise it returns false.
- Bacteria999
-
Scratcher
1000+ posts
___ or ___ but not both block [XOR]
Isn't xor the same thing as ≠?
Hello? Can anyone answer my question?
<[2] ≠ [1] :: operators>
Hello? Can anyone answer my question?
Last edited by Bacteria999 (April 8, 2020 21:12:47)
- lisa_wolfgang
-
Scratcher
100+ posts
___ or ___ but not both block [XOR]
Isn't xor the same thing as ≠?No.<[2] ≠ [1] :: operators>
XOR compares two booleans and returns true if one or the other (not both) is true.
≠ compares two values (which can be booleans) and returns true if they are not equal.
However, they do return the same results when using booleans, so that's why the ≠ workaround works.
Last edited by lisa_wolfgang (April 8, 2020 21:57:32)
- lisa_wolfgang
-
Scratcher
100+ posts
___ or ___ but not both block [XOR]
NOTE TO ALL FUTURE REPLIERS:
The following workarounds have already been proposed and tested. Please don't suggest these again; rather, contribute to the discussion about adding an XOR block to the blocks palette in the Scratch editor.
The following workarounds have already been proposed and tested. Please don't suggest these again; rather, contribute to the discussion about adding an XOR block to the blocks palette in the Scratch editor.
<not <<boolean1> = <boolean2>>>
<<<boolean1> or <boolean2>> and <not <<boolean1> and <boolean2>>>>
- trieuminh
-
Scratcher
100+ posts
___ or ___ but not both block [XOR]
No support. Just use a workaround.
<not <[var] = [var2]>>













