text:
Swapping "Good" and "Bad"
Challenge Description:
Write a program that asks the user for input. The user will enter Good or Bad. You do not have to support any other input. If the user enters Good, print Bad and vice versa (to stdout etc).
Notes:
1) You cannot use any other pair of two words.
2) Your program only has to ask and print once.
3) You do not need to display prompt string.
4) The output must appear separated from the input by any means.
5) No function is allowed accepting the value and returning the result; User must interact with the program.
Good luck!

May we write a function that takes input as argument instead of prompting for it?

Congratulations on your first challenge. I've removed the [tag:code-challenge] tag, as it is only to be used for indicating alternative scoring criteria (not [tag:code-golf]). I look forward to seeing interesting challenges from you, but consider using the sandbox to design your challenges, at least the first few times.

Please edit your question about whether a function is allowed or not. I would highly recommend not restricting input to STDIN, unless you have a very good reason to (and I can't see one)

asks the user for input (stdin etc) shows that only STDIN or interactive input is allowed. Please change this to all default I/O methods

"Asks the user for input", should that be some explicit question? Because an empty CLI prompt isn't really asking for anything …

What is the purpose for this restriction? No function is allowed accepting the value and returning the result; User must interact with the program

Python 3,  32  31 bytes
exit('GBoaodd'['G'<input()::2])

Try it online!
How?
Tests if input is 'Good' by comparing 'G'<input().
Uses the fact that in Python False==0 and True==1 to use the result as the start index of a slice of 'GBoaodd' using an undefined stop and a step of 2 with 'GBoaodd'[start:stop:step].
Prints to STDERR (saving a byte with exit in place of print).

What a trick! Can't understand how this works.

Can you use a lambda to shorten bytes?

@MilkyWay90 As per the question it must be a program accepting input.

@A__ by default yes, although there is a comment by OP which suggests it could be overruled here.

@A__ OP has confirmed that printing to stderr is fine

Too bad that "Good" and "Bad" share a "d", or you could do 'GoodBad'.strip(input()) which is a byte shorter.

APL (Dyalog Unicode), 13 bytesSBCS
Full program that prompts for input from stdin and prints to stdout.
'GooBad'~¯1↓⍞

Try it online!
⍞ prompt for input from stdin; Good or Bad
¯1↓ drop the last character (d); Goo or Ba
'GooBad'~ multiset subtract those characters from these; Bad or Good

Why the downvote‽

Does the code have GooBad or GoodBad?

I think it should have GooBad, as adding a character ```d`` will make this post 14 bytes.

@NoOneIsHere Thanks. Fixed.

bash, 20 bytes
sed s/$1//<<<GoodBad

Try it online!

Turing Machine But Way Worse, 405 bytes
0 0 0 1 1 0 0
1 1 1 1 2 0 0
0 2 0 1 3 0 0
0 3 0 1 4 0 0
0 4 0 1 5 0 0
1 5 0 1 6 0 0
0 5 1 1 h 0 0
1 6 1 1 7 0 0
1 7 0 1 8 1 0
0 8 0 1 9 0 0
1 9 1 1 9 0 0
0 9 0 1 a 0 0
1 a 0 1 a 0 0
0 a 0 0 b 0 0
0 b 1 1 c 1 0
0 c 0 0 d 0 0
1 d 0 0 e 0 0
0 e 0 0 f 0 0
0 f 1 1 g 1 1
1 h 1 1 i 0 0
0 i 1 1 j 1 0
0 j 0 1 k 0 0
1 k 1 1 k 0 0
0 k 0 1 l 0 0
0 l 1 1 l 0 0
1 l 1 0 m 1 0
1 m 1 1 n 1 0
1 n 1 1 o 0 0
0 o 0 1 p 1 1

Try it online!
Well, this took a while.
UNFINISHED EXPLANATION:
0 0 0 1 1 0 0 Start going to the sixth bit
1 1 1 1 2 0 0
0 2 0 1 3 0 0
0 3 0 1 4 0 0
0 4 0 1 5 0 0 End going to the sixth bit
1 5 0 1 6 0 0 If the sixth bit is 1, then it is Good. Start transforming "G" to "B" and go to state 6
0 5 1 1 h 0 0 Else, it is Bad. Start transforming "B" to "G" and go to state h
1 6 1 1 7 0 0 Keep on transforming "G" to "B"
1 7 0 1 8 1 0 End transforming and print "B"
0 8 0 1 9 0 0 We are in the first "o" in "Good". Start moving into the 5th bit.
1 9 1 1 9 0 0
0 9 0 1 a 0 0
1 a 0 1 a 0 0 Do some looping magic and start transforming "o" to "a"
0 a 0 0 b 0 0 End looping magic
0 b 1 1 c 1 0 End transforming and print "a"
0 c 0 0 d 0 0
1 d 0 0 e 0 0 Start transforming "a" to "d"
0 e 0 0 f 0 0
0 f 1 1 g 1 1 Stop transforming, print "d", and terminate
1 h 1 1 i 0 0 Continue transforming "B" to "G"
0 i 1 1 j 1 0 Stop transforming and print out "G"
0 j 0 1 k 0 0 Start going into position to print out "oo"
1 k 1 1 k 0 0
0 k 0 1 l 0 0 Move more efficiently using LOOPING MAGIC1!1111111
0 l 1 1 l 0 0 looping magic end, start transforming
1 l 1 0 m 1 0 end transforming and print out out "o"
1 m 1 1 n 1 0 print out "o" again
1 n 1 1 o 0 0 get into the "d" byte
0 o 0 1 p 1 1 print "d" and execute YOU HAVE BEEN TERMINATED

"Turing-Machine-But-Way-Worse" is, without a doubt, my new favorite esolang.

@MikeTheLiar Thanks!

"YOU HAVE BEEN TERMINATED" ArnoldC, is that you?

@TemporalWolf It is I, ArnoldC!

@A__ It isn't actually ArnoldC; I just put the exit command as a comment as a joke

8088 Assembly, IBM PC DOS, 25 bytes
Unassembled:
BA 0110     MOV  DX, OFFSET GB  ; point DX to 'Good','Bad' string
D1 EE       SHR  SI, 1          ; point SI to DOS PSP (80H)
02 04       ADD  AL, [SI]       ; add input string length to AL, set parity flag
7B 02       JNP  DISP           ; if odd parity, input was 'Bad' so jump to display 'Good'
02 D0       ADD  DL, AL         ; otherwise add string length as offset for 'Bad' string
        DISP:
B4 09       MOV  AH, 9          ; DOS display string function
CD 21       INT  21H            ; call DOS API, write string to console
C3          RET                 ; return to DOS
        GB  DB  'Good$','Bad$'

Explanation:
Looks at the length of input string (plus leading space) that DOS stores at memory address 80H, and adds it to AL (initially 0 by DOS).  If there is an odd number of 1 bits in the binary representation of the string length, the CPU parity flag is set to odd, and vice-versa.  So input string ' Bad' length 4 (0000 0100), is odd parity and input string ' Good' is 5 (0000 0101) is even parity.
DX is initially set to point to the string 'Good$Bad$', and if parity is even (meaning input was ' Good') advance the string pointer by that length (5) so it now points to 'Bad$'.  If parity is odd, do nothing since it already points to 'Good$'.  Then use DOS API to display a $ terminated string to console.
Example:

Download and test GOODBAD.COM or build from xxd dump:
0000000: ba10 01d1 ee02 047b 0202 d0b4 09cd 21c3  .......{......!.
0000010: 476f 6f64 2442 6164 24                   Good$Bad$

Python 3, 38 37 34 33 bytes
exit("C">input()and"Good"or"Bad")

Try it online!
exit() : returns an exit code as output
"C">input() : Checks whether the input is larger than the string C in the alphabetical order
and"Good" : If the result is True, then returns with Good
or"Bad" : Otherwise, returns with Bad

34: print("C">input()and"Good"or"Bad")

exit(input()[3:]and"Bad"or"Good") also works for the same byte count.

Jelly, 8 bytes
“Ċ³ṫ³»œṣ

Try it online!
A full program expecting a Python formatted string as an argument
How?
“Ċ³ṫ³»œṣ - Main Link: list of characters, S
“Ċ³ṫ³»   - compression of dictionary words "Good"+"Bad" = ['G','o','o','d','B','a','d']
      œṣ - split on sublists equal to S
         - implicit, smashing print

Looks like OP responded, input isn't restricted to STDIN.

C, 39 38 bytes
main(){puts("Good\0Bad"+getchar()%6);}

Try it online!
Saved one byte thanks to @tsh.

main(){puts("Good\0Bad"+getchar()%6);} 38 bytes

Shouldn't you add #include<stdio.h>?

@polfosolఠ_ఠ If this were anything but code golf, you should, but in C89, you can implicitly declare functions.

Can you use a null byte instead of \0?

brainfuck, 72 bytes
,>+++++>,>,>,>,[<<<<[-<->>---<]<.>>+.>>.>>>]<[<<<[-<+>>+++<]<.>>-..>.>>]

Try it online!
Explanation:
,>+++++>,>,>,>,
Read either:
"G", 5, "o", "o", "d" or
"B", 5, "a", "d", 0
[<<<<[-<->>---<]<.>>+.>>.>>>]
If the last character is not zero:
Substract 5 from the first cell once and from the third cell thrice.
Increment cell 3
Output cells 1, 3, 5.
<[<<<[-<+>>+++<]<.>>-..>.>>]
Otherwise add 5 to the first cell once and to the third cell thrice.
Decrement cell 3
Output cells 1, 3, 3, 4

That's a nice solution. You can shorten it a little bit by not using a newline in the input.
,>+++++>,>,>,[<<<[-<->>---<]<.>>+.>>.>>]<[<<[-<+>>+++<]<.>>-..>.>]

yeah, I realized that there is something to optimise there, but I found it hard to interpret what is necessary to comply with rule 4

R, 42 37 35 32 bytes
-10 thanks to Giuseppe and AkselA!
`if`(scan(,'')>'C','Bad','Good')

Try it online!

@Giuseppe that was quick. Thanks!

No problem. I recognize a lot of the other R golfers' names, so I often click on posts if I see their name as the most recent. :-)

using "C" instead of the first "Bad" as in this answer will save another couple bytes.

Just out of curiosity, would something like \if`(readline()>"C","Bad","Good")` be a valid answer? I'm new to this game and its rules.

@AkselA yes, but I'd also suggest using scan(,"") instead of readline(). Feel free to come to golfR, the R golf chatroom if you have any R-specific questions :-)

@AkselA also see Tips for Golfing in R for some specific tips; there are hidden gems in there if you read them :-)

sed, 21 16  13 bytes
Thanks @Cowsquack for the hints.
/B/cGood
cBad

Try it online!
Try it online!
Try it online!
TIL c will short-circuit the current line's parsing.

c offers a shorter solution

You can still save 3 more bytes using c

Had to play around with it a bit, but I figured it out!

Retina, 10 bytes
:`GoodBad

Try it online!
: swaps the input and the regex, so this computes 'GoodBad'.replace(input, '').

Haskell, 36 34 bytes
interact g
g"Bad"="Good"
g _="Bad"

Try it online!
Edit: -2 bytes thanks to @cole

34 bytes

JavaScript 31 bytes
I like Arnauld's answer, but I would like it to accept user input and be runnable on StackExchange like so:

alert(prompt()[3]?'Bad':'Good')

Shakespeare Programming Language, 582 bytes
(Whitespace added for readability)
G.Ajax,.Puck,.Act I:.Scene I:.[Enter Ajax and Puck]Ajax:
Open mind.Be you nicer the sum ofa big cat the cube ofa big big cat?If solet usScene V.
You is the sum ofthe sum ofyou a big big cat a cat.Speak thy.You is the sum ofyou twice twice twice the sum ofa big big cat a cat.Speak thy.Speak thy.You is the square oftwice the sum ofa big big cat a cat.Let usScene X.
Scene V:.Ajax:
You is the sum ofthe sum ofyou a big big pig a pig.Speak thy.You is the sum ofyou the sum ofa big big big big big cat a pig.Speak thy.You is the sum ofyou the sum ofa big cat a cat.
Scene X:.Ajax:Speak thy.

Try it online!
I get the first letter of the input with Open mind. Then I need to determine what it is. Of all the numbers between B=66 and G=71, my brute forcer says 66 is the shortest to write (the sum ofa big cat the cube ofa big big cat), so I compare the first letter of the input to 66. Scene I continues to print Good, or Scene V prints Bad.

Charcoal, 13 bytes
¿⁻ＬＳ³Ba¦Goo¦d

Try it online!
Explanation:
¿⁻ＬＳ³          If length of input minus 3 is truthy:
      Ba¦         print Ba
         Goo¦       else print Goo
             d        print d

Befunge-93, 20 18 bytes
"BadooGB"~-_#@,,<,

Try it online!
-2 bytes thanks to Jo King

Ruby, 22 bytes
->n{n>?F?"Bad":"Good"}

Try it online!

The question does say "asks the user for input", but the shortest way to do that is replacing the lambda with p gets and so it's the same length. (my original comment said you could save 2 bytes, but I didn't account for printing the result)

If we're actually going to be talking about a full program asking user for input, using the -p flag would give the most efficient answer: $_=$_>?F?:Bad:"Good" is 20 bytes. Try it online!

05AB1E, 10 9 bytes
”‚¿‰±”áIK

-1 byte thanks to @Emigna.
Try it online or verify both test cases.
Explanation:
”‚¿‰±”     # Push dictionary string "Good Bad"
      á    # Only keep letters (to remove the space)
       IK  # Remove the input
           # (output the result implicitly)

See this 05AB1E tip of mine (section How to use the dictionary?), to understand why ”‚¿‰±” is "Good Bad".

I can see many alternate variations on this, but they all end up at the same byte count :(

Actually, you can save a byte with á.

@Emigna Ah of course, brilliant. Now that I see á I can't believe I hadn't thought about it, but at the same time I know I would have never thought about it. ;) Thanks! (And yeah, I had a few 10-byte alternatives as well.)

Don't even need á, ”‚¿Bad”IK is also a 9.

Ruby, 30 28 bytes
puts %w|Good Bad|-gets.split

Not the golf-iest, but I like the abuse of split to remove the trailing newline and convert to an array in one call.
EDIT -2 bytes thanks to Value Ink's suggestion!

This prints "Good" or "Bad" (with quotes); I'm not sure that's allowed.

Abuse the fact that puts prints each element of an array on a separate line. It's 3 bytes more expensive than p, but it evens out since you take out the [0] and then save 2 more bytes by no longer needing parens. Try it online!

@ValueInk thanks! Jordan's issue also gets resolved by this change so it's a win-win.

Java (JDK), 124 bytes
interface G{static void main(String[]a){System.out.print(new java.util.Scanner(System.in).next().length()>3?"Bad":"Good");}}

Try it online!
Most likely, there‘s still some room for improvement, but I‘m entirely new to code golfing.

Welcome! Consider adding an explanation and/or a link to an online interpreter where you can run your code. (See other answers for examples.) Code-only answers tend to be automatically flagged as low-quality.

The length part could just be !="Bad"

109 bytes

GolfScript, 11 bytes
"GoodBad"\/

Try it online!
Explanation
"GoodBad"   # Define the lookup table "GoodBad"
         \  # Swap the input so that it can be used by /
          / # Split the lookup table by occurences of the input
            # Implicit print, smashing

JavaScript, 35 32 31 bytes
-3 bytes thanks to @xigoi
-1 byte thanks to @l4m2

alert(prompt()[3]?'Bad':'Good')

-3 bytes: prompt()<'G'

prompt()[3] enough

C (gcc), 48 bytes
main(){puts(getchar()-66?"Bad":"Good");}

Try It Online!
The program only actually takes one character as input, although getchar reads until a newline is found unlike getch which only lets you input a single character. It checks if there's a difference between that character and the ascii code for 'B' (66), printing "Bad" if there is and "Good" if there isn't.

Taking just one character as input is perfectly valid, and is in fact what most other answers are doing

@mousetail Thanks, I edited my answer to remove the question :)

Stax, 9 8 bytes
çEF♫a║▬h

Run and debug it
Essentially replace("BadGood", input, "").
Multiset xor with "GooBa".  Algorithm copied verbatim from Luis Mendo

Jelly, 9 bytes
“GooBa”œ^

Try it online!
Explanation
Multiset symmetric difference between the input and the string “GooBa”.

@JonathanAllan Thanks. Edited

I don't see any indication that the input has to come through STDIN...

@EriktheOutgolfer Unfortunately the whole way the question is written implies we must have a program which, when run, asks for input (even though no prompt must be displayed). See the OPs own answer too. If you want to get them to change it go for it (although do note that they haven't answered the first, similar although slightly different, question in the comments)

Looks like OP responded, input isn't restricted to STDIN.

@EriktheOutgolfer Thanks! Rolled back

Retina 0.8.2, 20 bytes
oo
o
T`G\oaB`Ro
o
oo

Try it online! Link includes test suite. Explanation:
oo
o

Turn Good into God.
T`G\oaB`Ro

Transpose the letters GoaB with the reverse of that list, thus exchanging G with B and o with a, i.e. exchanging God with Bad.
o
oo

Turn God into Good.

17 bytes, but less creative

PowerShell, 22 20 bytes
'Good','Bad'-ne$args

Try it online!
-2 bytes thanks to mazzy

20 bytes

Java, 30 bytes
s->s.charAt(0)>66?"Bad":"Good"

TIO

How does it take input from the user (e.g. by reading from stdin) and print the result (instead of just returning it)?

@nimi OP hasn't specified whether IO includes arguments and returns. By default, it is allowed

"ask the user for input" sounds like reading the input from stdin (or equivalent) to me. "print" usually means print to stdout (or equivalent). To my understanding the IO defaults are overwritten.

@nimi I can argue a missing argument error is a prompt. As for output, you do have a point.

You can take the inputs as character-arrays, which is allowed by default for strings, to change s.charAt(0) to s[0]: 23 bytes.

Perl 5 -p, 15 bytes
$_=/B/?Good:Bad

Try it online!

Just revisited this. Abusing flags as usual -0144l, you can save the ds! Try it online!

Excel, 24 bytes
=IF(A1>"C","Bad","Good")

Using @MilkyWay90's <C suggestion.

PHP, 26 23 bytes
A ternary is just cheaper:
<?=$argn==Bad?Goo:Ba?>d

Try it online!
Original answer, 26 bytes
<?=[Ba,Goo][$argn==Bad]?>d

Try it online!
Or 21 bytes (but this is basically Arnauld's answer)
<?=$argn[3]?Ba:Goo?>d

Try it online!

Judging by the phrasing of the question, readline() is likely more appropriate than $argn.

Keg, 22 bytes
?^_^_o=[^aB^_|^ooG^]

brainfuck, 52 bytes
,>,,<<,[>-----.<---.+++.<<]>[+++++.+[-<-->]<-..>>.>]

Try it online!
Relies on Bad being one letter shorter than Good, so the last input is empty.
Explanation:
,>,,<<,       Get input into the first three cells
[             If the last letter was not empty (i.e. Good)
 >-----.      Decrement 'G' to 'B' and print
 <---.        Decrement 'd' to 'a' and print
 +++.         Increment back to 'd' and print
>>]           End loop
>[            If it is Bad instead
 +++++.       Increment 'B' to 'G' and print
 +[-<-->]<-.. Manipulate into  'o' and print twice
 >>.          Print 'd'
>]            End loop

Keg, -rt 20 17 15 13 8 7 bytes (SBCS)
-᠀‘5ƳP↫

Transpiles to:
from KegLib import *
from Stackd import Stack
stack = Stack()
printed = False
iterable(stack, 'GoodBad')
string_input(stack)
maths(stack, '-')

if not printed:
    printing = ""
    for item in stack:
        if type(item) in [str, Stack]:
            printing += str(item)
        elif type(item) == Coherse.char:
            printing += item.v

        elif item < 10 or item > 256:
            printing += str(item)
        else:
            printing += chr(item)
    print(printing)

It's a port of the 05AB1E answer. Essentially, it:

Pushes the string "GoodBad"
Takes input as a string
Subtracts the input from the pushed string. This works by replacing the first instance of the input within GoodBad with nothing.
Implicitly prints the resulting string.
The -rt flag tells Keg to read tokens from right to left.

Answer History
?G=[øBad|ø‘5Ƴ

Transpiles to the following:
from KegLib import *
from Stackd import Stack
stack = Stack()
printed = False
Input(stack)
character(stack, 'G')
comparative(stack, '=')
if bool(stack.pop()):
    empty(stack)
    character(stack, 'B')
    character(stack, 'a')
    character(stack, 'd')

else:
    empty(stack)
    iterable(stack, 'Good')

if not printed:
    printing = ""
    for item in stack:
        if type(item) is Stack:
            printing += str(item)

        elif type(item) is str:
            printing += custom_format(item)
        elif type(item) == Coherse.char:
            printing += item.v

        elif item < 10 or item > 256:
            printing += str(item)
        else:
            printing += chr(item)
    print(printing)

Explanation
?G=[øBad|ø‘5Ƴ

?            #Get input from user
 G=          #If the first letter is "G"
   [øBad     #Clear the stack and push "Bad"
        |    #Else,
         ø‘5Ƴ#Clear the stack and push the compressed string "Good"

Wonderful, I could not golf to that length... I have upvoted your answer.

@A__ just as i have up voted yours

My answer is a lot worse than yours. You should not have upvoted my answer...

Is there any up to date keg documentation?

@EdgyNerd not really. It's been a while since I updated the docs. Most information about new things can be found in the chat/here

@EdgyNerd a lot of things have changed recently: strings are now a thing, more data types and so much more

@EdgyNerd, also there is some information here, but note that some of it may be incorrect as a few things have changed since then

Boolfuck, 110 68 bytes
,+;+[;+;;;;+;+;+;<;]>+;;[+;;;+;+;+;;;;+;+;;+;+;;;;+];+;;+;;;+;+;;+;;

Thanks to Jo King for the massively improved solution!
Try it with Online!

68 bytes. I think it can be better though

Wow, how were you able to save so many bytes over my answer?

Boolfuck, 47 bytes
+>,+;>,;,+;>;;;+;+;+[;<;;;,;+;;+;<];;+;+;;+;;+;

Try it online!
Uses the fact that you can basically just take in the input as bits and then invert certain bits to turn it into the opposite letter.
Explanation:
+>,+;>,;,+;>;;;+;+;+    Print the first letter by inverting the first and third bits of the input
                        'B' = 01000010
                        'G' = 11100010
                        This leaves the tape as
                            1 1 1 1' in the case of Bad
                            1 0 0 1' in the case of Good
                        By making the center cells the inverted bits
[;<;;;,;+;;+;<]         Print the center letters by looping over the two pairs of cells
                        0 1' results in 'a' = 10000110
                        1 1' results in 'o' = 11110110 by printing the 1 in the 2-4th places
                        1 1 1 1' loops twice, while 1 0 0 1' only loops once
;;+;+;;+;;+;            Finally print 'd' = 00100110

Zsh, 21 20 bytes
-1 by just defining a variable first instead of using an empty fallback
x=GoodBad
<<<${x/$1}

Try it online!
Try it online!
<<<${${[implicit parameter]:-fallback}/pattern[/implicit empty replacement]}

No coreutils, and nearly as good as the Bash+coreutils answer (which is compatible with Zsh).

Why not x=GoodBad;<<<${x/$1}?

Whitespace, 114 104 103 bytes
(much whitespace)
Try it online!
-5 bytes thanks to Jo King.
-5 bytes by determining if the input is odd or even instead of subtracting "B"
-1 byte thanks to Kevin Cruijssen by using the initial 3 as address for reading characters
sssttl      push "d"
sls         dup (address for "retrieve")
sls         dup (address for "readc")
tlts        readc
ttt         retrieve
ssstsl      push 2
tstt        mod (determine if input is even or odd)
ltssl       jz good
sssl        push "a"
ssttttttl   push "B"
lsll        jmp print
lsssl       lbl good
ssstttsl    push "o"
sls         dup
sstttstsl   push "G"

lssl        lbl print
sssttsssstl 97
tsss        add
tlss        printc
lsll        jmp print

-1 byte by replacing the sssl (push 0) with sls (dupe the 3 that's used to print "d"). Also a minor error in your explanation: the sssttl - push 2 should be either sssttl - push 3 or ssstsl - push 2 (both result in 0 for B, and either 1 or 2 for G, so the program would be correct in both cases). Alternatively for sssttl - push 3, you could dupe the initial 3 a third time and use a swap after retrieving the input, but that unfortunately results in the same byte-count (repushing 3 or duplicating + swapping are both 6 bytes).

Thank you. I didn't have the idea to use the 3 as address for the readc-retrieve command. The push 2 was really intended to be a push 2. I wanted to determine if the first input character was even or odd, so I was just lucky it also worked with sssttl.

PHP, 30 bytes
<?=strtok(BaGoo,readline()).d;

Best suppress notices.

There is already a shorter PHP answer: https://codegolf.stackexchange.com/a/187930/81663

@Night2, reading the question as waiting on a prompt, a readline solution seemed more appropriate as an answer.

@Night2, but granted if they were to swap $argn for readline(), theirs would still be a shorter solution.

C# (Visual C# Interactive Compiler), 30 bytes
Write(Read()>'B'?"Bad":"Good")

Try it online!

Kotlin, 52 bytes
fun main()=print("GoodBad".replace(readLine()!!,""))

Try it online!

What does the !! operator do?

!! asserts that a nullable value is not null, effectively casting it down from T? to T or throwing a runtime error if it's null. replace doesn't accept String? but that's what readLine() returns so I have to assert it's not null (since it never will be per the challenge.)

Javascript 50 bytes

alert((305786-parseInt(prompt(),26)).toString(26))

Please add what language you answer uses and a short description of how it functions

MAWP, 59 bytes
%|~88W7MA{88W7M;99W65WM!;;25W25WW;}<88W2M;99W44WM;25W25WW;>

Try it!

Vyxal r, 7 bytes
`ƛ⁋«Ṫ`-

Try it Online!
This is irony in a nutshell.
Explained
`...`-
`...`  # the string "GoodBad"
     - # ^ - input (removes it)

In the spirit of my Keg answer, here's the compiled code:
global stack, register, printed, output, MAP_START, MAP_OFFSET, _join, _vertical_join, use_encoding, input_level, raw_strings, retain_items, reverse_args, this_function
stack.append("GoodBad")

rhs, lhs = pop(stack, 2); stack.append(subtract(lhs, rhs))

.COM, 31 bytes
org 0x100
mov dx, 0x100
mov eax, 0xA20 + '$$'*0x10000
int 0x21
inc dx
inc dx
xor dword [0x102], 'Good' xor ('Bad'+0x0d000000)
mov al, 0x20
int 0x29     ; Avoid "Badd"
mov ah, 9
int 0x21
ret

My shortest possible solution in Python (43 bytes)
print({'Good':'Bad','Bad':'Good'}[input()])

And MilkyWay90 further golfed version (-2 bytes)
print({'G':'Bad','B':'Good'}[input()[0]])

Normally, we recommend leaving challenges up for a while (I generally give it a week) before self-answering.

@Adám Good suggestion.

print({'G':'Bad','B':'Good'}[input()[0]]) works too for -2 bytes

print(['Bad','Good'][input()<'C']) works for 34 bytes (-9)

@MilkyWay90 You're genius!

You should edit the answer then if you feel as though it is similar enough to your answer to be golfed down to.

@MilkyWay90 May I edit with your first suggestion or second? Second one is completely different solution.

Probably my first one; the second one, as you said, is completely different

You probably should put the shortest solution as the one solution without any alternative solutions

Wolfram Language (Mathematica), 48 44 38 bytes
If[$ScriptInputString=="Bad",Good,Bad]

Try it online!
-4 bytes thanks to  Jonathan Allan: using symbols instead of strings as output
-6 bytes by removing Print@, which is implicit in the command-line version of WolframScript and can be simulated on TIO with the -print argument

I don't think it's only the I/O that's wrong (I don't know Mathematica very well though) - adding a Print exposes a problem with the strings I think: TIO (the ? is, no doubt the prompt for input)

@JonathanAllan I couldn't make it work with TIO either; what I've given runs fine in Mathematica though. Note that there are no strings involved: Good and Bad are symbols here.

Ah symbols, right. Is it a full program, or just a snippet which can only run in a REPL (read–eval–print loop) (which is, I guess what you're running the code in)? I see no output command and I don't imagine Mathematica does any by default at the end of a program. Maybe a Mathematica expert can chime in...?

@JonathanAllan The previous version was a REPL tool for Mathematica. Now I've rewritten it as a command-line tool for wolframscript, using the proper i/o channels. This makes the code a lot longer though.

Nice. Maybe there are golfs to be had... :)

Looks like you could use symbols for the output to save 4.

K (oK), 16 bytes
Solution:
$`Bad`Good"Bad"~

Try it online!
Returns "Good" if input is "Bad" otherwise returns "Bad" for all other inputs.

15 bytes with loose constraints

C# (Visual C# Interactive Compiler), 23 bytes
a=>a[0]>66?"Bad":"Good"

Try it online!

///, 23 bytes
/#Good/Bad//#Bad/Good/#

Try it online!
There is no other way to take input in /// so it is hard-coded:
/#Good/Bad//#Bad/Good/#<INPUT HERE>

Windows batch, 53 48 47 bytes
-1 bytes, thanks to @Neil for noticing the trivialness of the space before else.
set/pa=
if %a%==Bad (echo Good)else (echo Bad)

set/pa= prompt for input and set a to that input
if %a%==Bad (echo Good)else (echo Bad) antonym for Good and Bad. Unfortunately Windows batch requires whitespace...

I think you can drop the space before else but no other spaces as you noticed.

Pyth, 12 bytes
+-"GooBa"z\d

Try it online!
+-"GooBa"z\d   Implicit: z=input()
 -"GooBa"z     Keep letters in "GooBa" which do not appear in z
+         \d   Append "d", implicit print

Runic Enchantments, 21 bytes
"Bad":i≠7*?~"Good"@

Try it online!
Prints Good when the input is Bad and prints Bad for all other inputs.

Sinclair ZX80 BASIC (4K ROM) - 46 tokenized BASIC bytes
 1 INPUT A$
 2 IF A$="GOOD" THEN PRINT "BAD"
 3 IF A$="BAD" THEN PRINT "GOOD"

Sinclair ZX81 BASIC (Also Timex TS 1000/1500 or ZX80 with 8K ROM upgrade) - 45 tokenized BASIC bytes
 1 INPUT A$
 2 PRINT "GOOD" AND A$="BAD";"BAD" AND A$="GOOD"

Python 3, 37 bytes
print(['Bad','Good'][input()=='Bad'])

Try it online!

-3 bytes by replacing input()=='Bad' with input()<'G'

Underload, 26 25 16 bytes
(Bad)(Good)Bad^S

Since Underload has no input instructions, input is hard-coded (The ‘Bad’ on the right).
Really proud of this one: Underload has no way to check strings, so I had to go off of the fact the ‘Bad’ contains an a, which is an instruction that puts brackets around the top thing in the stack.
Edit: Saved 9 bytes over my old one by getting rid of 2 pairs of brackets, only using one S and getting rid of some !s and ^s
Try it with Bad!
Try it with Good!

Racket, 38 bytes
(write(match(read)['Bad'Good][_'Bad]))

Extended BrainFuck:  29 28
,>,,,[>|"Bad">>]<[>|"Good">]

-1 bytes thanks to @JoKing
The compiled bf code can run on an interpreter that expects stream end after the last letter and a interpreter that uses 0 as the EOF value. eg. bf -n or beef. eg
> bf ebf.bf < GoodBad.ebf > GoodBad.bf
> echo Bad | bf -n GoodBad.bf
Good
> echo Good | bf -n GoodBad.bf
Bad

33, 20 bytes
Itj71m"Good"'Bad'ntp

I don't have it on TIO yet, I'll update this when I do.
Explanation:
It                   | Get input
  j71m           n   | If the first character is 'G'
      "Good"       p | - Print "Good"
            'Bad' tp | Else, print "Bad"

Try it online!

Wren, 30 bytes
Fn.new{|x|"GooBa".trim(x)+"d"}

Try it online!
Explanation
Fn.new{|x|                   } // New anonymous function with parameter x
                               // Sample input: "Bad"
          "GooBa"              // Define a string
                 .trim(x)      // Trim out all characters in the input string
                               // "GooBa" - "Bad" = "Goo"
                         +"d"  // Return the string joined with a "d": "Good"

W d, 12 11 9 bytes
Realized that I could use the implicit quote system. Still can't beat Keg with the decompression. (Alternative 9-byter:§D⑺y⒁v⑼z¬; but that's the same bytecount)
☺DΩy±v∞z↓

Explanation
% Sample input: "Bad"
% Implicitly prepend a quote for this string
GooBa"     % Stack: ["Bad","GooBa"]
      S    % Stack: ["GooBa","Bad"]
       t   % "GooBa".trim("Bad"), which is "Goo"
        'd % Stack: ["Goo","d"]
           % Stack: ["Good"]

% Implicit output
```

Pushy, 17 bytes
.F`Goo`x?c`Ba`;H"

Try it online!
Explanation:

                  \ Implicit: input on main stack.
.F                \ Pop last letter, and move to auxiliary stack.
  `Goo`           \ Push 'Goo' to main stack.
       x?     ;   \ If the stacks are equal:
         c`Ba`    \    Replace 'Goo' with 'Ba'
               H  \ Push 'd', as char(d) = 100 = H
                " \ Print stack

naz, 66 bytes
9a7m4a2x1v1x1f1r3x1v2l5s1o2d3m2s1o3a1o0x1x2f5a1o2d3m6a2o9s2s1o0x1f

Explanation (with 0x commands removed)
9a7m4a2x1v                   # Set variable 1 equal to 67 ("C")
1x1f                         # Function 1
    1r3x1v2l                 # Read the first byte of input
                             # Jump to function 2 if it's less than variable 1
            5s1o2d3m2s1o3a1o # Otherwise, output "Bad"

1x2f5a1o2d3m6a2o9s2s1o       # Function 2
                             # Output "Good"
1f                           # Call function 1

W j, 8 bytes
Still doesn't tie with Keg. Help!
♥d←╖←I¡%

Uncompressed:
G'%Av%?S,

Explanation
           % Implcitly start a compressed string
G'         % "good" in the dictionary
  %        % Capitalize
   Av      % "bad" in the dictionary
     %     % Capitalize
      ?    % End compressed string
       S   % Swap so that the input comes to the top
        ,  % Split the string on the input

Flag:j     % Implicit smash on output list
```

FALSE, 23 bytes
^'B=$["Good"]?~["Bad"]?

Try it online!
Explanation
The program gets an input character and checks if it is equal to 'B'. If it is, it prints 'Good', and if it isn't it prints 'Bad'. This makes use of the fact that 'Good' and 'Bad' are easily differentiable based on simply the first character of each word.
^                  {Get input character}
'B=                {See if input char is equal to 'B'}
["Good"]?~["Bad"]? {If top of stack is TRUE, print "Good", else print "Bad"}

Note: Curly brackets denote comments in FALSE. In the past I've used '//' to comment FALSE code in my explanations, but since it isn't syntactically valid  I'm now trying to use FALSE's comment syntax.

APOL, 32 bytes
Just checks if the input starts with "G".
g(["Good" "Bad"] I(=(g(i) "G")))

(e-)TeX, 48 bytes
\read0to~\expanded{\def\##1~{#1}}\#Good Bad \bye

Output is to dvi/pdf file.

Pip, 12 bytes
"GoodBad"RMq

Attempt This Online!
Explanation
           q  ; Read a line of input from stdin
         RM   ; Remove that substring from
"GoodBad"     ; This literal string

QBasic, 37 bytes
INPUT s$
IF"C"<s$THEN?"Bad"ELSE?"Good

Try it at Archive.org
Explanation
Uses string comparison to separate the two cases. Ungolfed:
INPUT s$
IF "C" < s$ THEN PRINT "Bad" ELSE PRINT "Good"

Python 3, 30 Bytes
exit({'Good','Bad'}-{input()})

Uses the same exit trick as the other python 3 solution. It's unclear to me if this solution is necessarily allowed by the problem, but the output is certainly separated from the input, so I think it counts.

Factor, 29 bytes
read1 66 = "Good""Bad"? print

Try it online!

Acc!!, 105 bytes
N
Count i while _/71 {
Write 66
Write 97
0
}
Count i while _ {
Write 71
Write 111
Write 111
0
}
Write 100

Try it online!
Explanation
# Read a character from stdin (user must enter a full line)
N
# Loop while the character code int-divided by 71 is nonzero (i.e. G was entered)
Count i while _ / 71 {
  # Write Ba
  Write 66
  Write 97
  # Set accumulator to 0 to exit the loop
  0
}
# Loop while the accumulator is nonzero (i.e. previous loop did not run)
Count i while _ {
  # Write Goo
  Write 71
  Write 111
  Write 111
  # Set accumulator to 0 to exit the loop
  0
}
# Write d
Write 100

Thunno, \$15\log_{256}(96)\approx\$ 12.35 bytes
"Bad"Dz0=?"Good

Attempt This Online!
"Bad"Dz0=?"Good  # Implicit input
"Bad"D           # Push the string bad and duplicate           (STACK: "Bad", "Bad")
      z0         # Push the input                              (STACK: "Bad", "Bad", input)
        =?"Good  # If they are equal, push the string "Good"   (STACK: "Bad", "Good") IF input == "Bad"
                 # Otherwise, the stack is left as-is          (STACK: "Bad") IF input != "Bad"
                 # Implicit output of top of stack

Attache, 24 bytes
$Good'$Bad^^Stdin[]|Echo

Try it online!
Explanation
$Good'$Bad^^Stdin[]|Echo
$Good'$Bad                   an array of the strings "Good" and "Bad"
          ^^                 remove from this array
            Stdin[]          standard input
                             this leaves us with a singleton array of the swapped element
                   |Echo     pipe the Echo function to each member of this array
                             (in this case, only prints the one element)

Alternatives
25 bytes: $Good'$Bad⩓Stdin[]|Echo
26 bytes: [$Good,$Bad]^^Stdin[]|Echo
29 bytes: Echo@If[Stdin[]@3,$Bad,$Good]
29 bytes: Echo@[$Bad,$Good][Stdin[]<$G]
37 bytes: [4875396,32943]^^STN@Stdin[]|Echo@NTS
44 bytes: Good:=$Bad;Bad:=$Good;Print@EvalHere@Stdin[]

F# (.NET Core), 50 35 bytes
Down to 35 thanks to @Expired Data
 fun a->if a>"B"then"Bad"else"Good"

Try it online!
Original:
F# (.NET Core), 50 bytes
printf(if stdin.ReadLine()>"B"then"Bad"else"Good")

Try it online!

35 bytes

Python 2, 32 bytes
print('Good','Bad')['C'<input()]

Try it online!
Using exit requires extra brackets around  the whole expression so in this case print is 1 byte shorter.

Python 3, 33 bytes
exit(['Bad','Good'][input()<'G'])

Try it online!

Prints to stderr, to save one byte over print().

Japt -P, 11 bytes
"GoodBad"qU

Try it
Explanation:
"GoodBad"qU     U = Input             "Good"        "Bad"
"GoodBad"       String literal        "GoodBad"     "GoodBad"
         qU     Split at U            ["","Bad"]    ["Good",""]
-P              Join into a string    "Bad"         "Good"

Alternative
"GoodBad"rU

r replaces U with ""
Try it

Dart, 77 bytes
import'dart:io';main()=>print('BadGood'.replaceAll(stdin.readLineSync(),''));

Try it online!

Pepe, 104 bytes
rEEeREeEeeeEEErrEEreeEeeeEEEreeEEeEEEEreeEEeEEEEreeEEeeEeeREerREEreeEeeeeEereeEEeeeeEreeEEeeEeeREeReEree

Try it online!
With comments
# Prepare stacks
rEEe        # r ← Input
REeEeeeEEE  # R ← 'G'

# Create label i (outputs "Good")
rrEE { reeEeeeEEE reeEEeEEEE reeEEeEEEE reeEEeeEee } REe

# Create label 'G' (outputs "Bad")
rREE { reeEeeeeEe reeEEeeeeE reeEEeeEee } REe

# Compare values
ReE  # If the first letter of input is 'G', go to label 'G'
ree  # Otherwise, go to label i

Zozotez: 22
(?(=(r)'Bad)'Good'Bad)

Java (OpenJDK 8), 51 42 bytes
g->{if(g=="Bad")return"Good";return"Bad";}

Try it online!
Checks if input is Bad.
-9 to @JoKing

I mean, just comparing g to "Bad" saves 4 bytes. You can also remove the else  for 5 more, or even use a ternary operator for 24 bytes

@JoKing I actually tried to do a ternary g.length()>3?, but it was throwing an error for invalid operator. Thanks for help either way.

PHP, 31 bytes
readline()=="Bad"?"Good":"Bad";

Try it online!
Another way, 41 bytes
["Bad"=>"Good","Good"=>"Bad"][readline()];

Try it online!

Shorter: ['bad'=>'good'][readline()]??'bad';

ScPL, 61 bytes
ChooseFromMenu''[Good Bad]
Case
Text'Bad'
Case
Text'Good'
End

Editor Link
The first argument to ChooseFromMenu is the title, which doesn't matter so we put an empty string. The second argument is the list of choices.
Cases do not require a label, they go based on order.
Seperators between things are only required when they are not seperated some other way, for example a b needs a space because ab is one argument, but a'b' does not because the ' starts another argument.

GNU Smalltalk, 34B
Please forgive me for submitting a code snippet if Smalltalk does have input. I am a complete novice to Smalltalk.
i<'C'ifTrue:['Good']ifFalse:['Bad']

You replace the name i with the intended input.

TI-BASIC, 38 bytes
Input Str1:"GoodBad
sub(Ans,abs(inString(Ans,Str1)-5)+1,4

Prompts the user to input the string, then prints the other string as specified in the challenge.
Explanation:
Input Str1                               ;get the input
"GoodBad "                               ;leave "GoodBad " in Ans. closing quote
                                         ;  is added for clarity (isn't in program)
            inString(Ans,Str1)           ;get the 1-indexed position of the input
                                         ;  in "GoodBad "
        abs(                  -5)+1      ;subtract 5, get the absolute value,
                                         ;  then add 1
sub(Ans, ...                       ,4    ;get the substring of "GoodBad " starting
                                         ;  at the position just calculated with
                                         ;  a length of 4.  leave the result in Ans
                                         ;implicit print of Ans

Thunno 2, 9 bytes
’⁽ȯBad’$o

Attempt This Online!
Explanation
’⁽ȯBad’$o  # Implicit input
’⁽ȯBad’    # Compressed string "GoodBad"
       $o  # Remove the input
           # Implicit output


text:
Make a slow monotonic injection
In 256 bytes or fewer write a function, \$f\$, from the positive integers to the positive integers that is:

Monotonic: larger inputs always map to larger outputs. (\$a < b \implies f(a) < f(b)\$)
Non-linear: does not have asymptotic order notation \$O(n)\$. (\$\displaystyle\forall c: \exists n:c\cdot n < f(n)\$)

Your answers will be scored by the asymptotic Big-O order notation of the function they implement (run time is irrelevant) with smaller being better.  In the case of a tie the size of the code is the tie breaker.
You may implement a function or a complete program.  Since we are concerned with asymptotic complexity your program should accept input of arbitrary size.

So, just to understand the challenge, this program would have a byte length of 4 but an O-notation (and thereby score) of: $O(n^c)$ where c = 3

Perhaps a metric what combines O(n) of the function and code length would be better? Currently it may be too easy to outscore any answer that doesn't use all 256 bytes

How are language value bit-size limitations handled? Eg. this program works, but if the ... is repaced with YYY, it breaks down due to the limitations on floating point numbers. Mathematically the second function should be 1,000,000,000 times closer to linear than the first, and every additional Y makes it closer still, but due to computational limits, the intermediate values exceed the available bit-space and precision is lost.

Just nitpicking: 1) Would the term supra-linear perhaps be better suited to the mathematical description you gave? (for example, a logarithmic function is non-linear but doesn't match the alternate definition) 2) Doesn't (strict) monotonicity (as you chose to define it using $<$) imply injectivity?

@Mr.Xcoder You will find that there is no monotonic positive integer function can be less than linear.  You are right about the injectivity though.

@Draco18s I don't know a whole lot about the specific language there, but answers should be scored on how they perform in practice when it comes to floating points.

@LuisMendo Score length is just a tie breaker I really don't intend for it to come into play very much.  It likely will be easy to outscore an answer that doesn't use all 256 bytes but I think that that is ok.

@LuisMendo Yes the function's order notation.  I will try to make this extra explicit in the question.

@SriotchilismO'Zaic The important bit is that the interpreter is written in C# and does not use BigInteger or BigRational, but native data types. So a command 1Y results in a number literal 1000 (1 is just a 1, Y is a shortcut for ToS * 1000). Add enough Ys and the number will eventually overflow. This is due to the limitations imposed by hardware (no infinite memory) but which would work without those constraints. Similar thing happens on very large inputs.

Unless I am mistaken, one could take any answer to the duplicate and make a function g(x) = x + f(x), where f(x) is the function defined in that answer, which would be a trivial answer to this question.

@pppery Actually, g(x) = x * f(x).

@jimmy23013 Why does g(x) = x + f(x) not work? It seems that your example function would grow slightly faster than mine (but this field of math really isn't my specialty)

@pppery It is supposed to be non-linear, not just more than x. f(x) in a winning answer is most likely less than x, so g(x) less than 2x which is linear.

I guess that shows my naivety at math.

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

sort: votes


text:
Total time to deteriorate all shielded cells
Problem:  We have a two dimensional matrix of positive integer cells. On each turn any non-zero cell with a neighbor (top/bottom/left/right) of zero decreases by 1. We want count to the number of non-zero cells present and add them up across all turns.
Is there a faster solution than to use a priority queue?
Is there a name for this problem or a similar problem? I don’t know what to search for.
Example
Here is an input where the result is 7:
00000
00100
01210
00100
00000

Initially there are 5 non-zero cells.
00000
00000
00200
00000
00000

After the first turn, there is 1 non-zero cell.
00000
00000
00100
00000
00000

After the second turn, there is still 1 non-zero cell.
00000
00000
00000
00000
00000

After the third turn, there are 0 non-zero cells.
If we total these up:
\$5 + 1 + 1 = 7\$
Our result is \$7\$

Welcome to CGCC! "Is there a faster solution than to use a priority queue?", "Is there a name for this problem or a similar problem?" - this is not the right stack for these questions as we host competitive programming problems. This might fit here as a challenge, although I'm not 100% sure, but if you're after answers to those questions you might not find them here. As far as I can tell though it seems to be a cellular automaton related to an Abelian sandpile.

Also wouldn't the example answer be 3 since the four 1s all decrease to 0 at the same time-step?

The problem is totaling the time each cell takes to reach zero. Each of the ones were 1, so 4 x 1.

Welcome to the site!  Like Johathan Allen I am not sure on what the desired task is, or where the number 7 comes from in your example.  If you could explain the task without using examples first and then add one or two examples.  Then we could move forward to seeing if there is an on topic challenge that can be made from this.  In the meanwhile you should checkout the help center.  Ideally you should also move this to the sandbox where it can get the help it needs to be on topic.

7 is 5 + 1 + 1.

The number 7 doesn't seem to match up with the description at the top of the puzzle.  The description say number of turns given which is 3 but, based on the example, it seems your 7 comes from counting the number of non-zero cells every turn and adding them up.

I meant the sum of the time for each cell to reach zero. Please, let me know how to word it better and I’ll edit it.

This can make a good challenge, but you need a winning criterion. [tag:code-golf] could work, or once you find out the fastest algorithm by asking on CS.SE or Stack Overflow, [tag:code-golf] [tag:restricted-complexity] restricting answers to use an algorithm of that time complexity.

Ok so I have gone ahead and made the challenge description clear as per our discussion, feel free to make changes if you think I have gone against your intentions.  If lirtosiast's issue of winning criterion is adressed I think this will be ready to be opened and I expect a speedy reopening.  Also if you want a user to see a comment it is best if you "ping" them by starting your message with @ and then their name.  The only reason I have seen your comments is that I have been periodically checking this question.

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
Find all a, b, c, d, e, such that a + b + c + d + e = 1000 with no more than 3 loops
The rule is:

a, b, c, d, e is an integer from 0 to 1000, no relation between a, b, c, d, e so a can equal to b or c, ...
can not use more than 3 loops (it can be 3 nested loops or 3 normal loops, or 2 nested loops + 1 normal loop, ...)
you need to find all the answers for (a, b, c, d, e) that is:

a + b + c + d + e = 1000

Your answer can be any format: line by line, array, object, ... but it must be clear so anyone can see it.
Shortest bytes will be win for each language!

For example here is when I used 5 loops to solve this puzzle and it violates the rules:
https://repl.it/repls/BestKnobbyDonateware

Using no more than 3 loops is a non-observable requirement.

stop assuming features of languages. How is a loop count?

@Arnauld I am not sure about that, I think any language can do that.
tsh: I updated my question.

Clearly, this can be done with no loops: Just print the hard-coded numbers.

@Adám: It is brilliant idea, you rock!

Mathematica:  IntegerPartitions[1000, {5}]

APL (Dyalog Unicode), 23 16 bytesSBCS
Full program. No loops. Prints a list of quintuplets with two spaces between them. Each quintuplet has the variables separated by single spaces. Requires 0-indexing (⎕IO←0) which is default on many systems.
⍸1E3=⊃∘.+/5⍴⊂⍳1001

Since the above code requires more memory than available on TIO, here's exactly the same, but with a + b + c + d + e between 0 and 10 and a sum of 10:
⍸1E1=⊃∘.+/5⍴⊂⍳11.0

Try it online!
⍳1001 the ɩntegers 0…1000
⊂ enclose to treat as a unit
5⍴ reshape that to length 5
∘.+/ reduction by outer-sum (like outer product, but with plus)
this creates a 5D array with all dimensions being 1000 elements long
⊃ disclose (the reduction had to enclose the result to reduce the rank from 1  to 0)
1E3 5D Boolean mask where equal to 1000
⍸ list of ɩndices where true

the output has a lot of number how can read it?

@chaugiang I've rewritten it. It now prints a b c d e with single spaces in between and quintuplets separated by two spaces.

awesome, it look so much better now!

@Adám Out of curiosity, is there any reason for the trailing .0 in the TIO-10 version?

@KevinCruijssen Just to keep the code length identical to the full version.

@Adám, hi mate, thank you for interested in my question, I am a novice javascript developer, I want to learn some codegolf language, would I started with APL is good idea, I heard it need a special keyboard right?

@chaugiang Cool! Come on over in  The APL Orchard, and I'll be happy to help you get started.

05AB1E, 8 bytes
₄Ý5ãʒO₄Q

No loops.. (Well, maybe 1 if you count the filter as a loop I guess.)
Outputs as a list of lists of integers.
Try it online with 10 instead of 1000.
Explanation:
₄Ý        # Push a list in the range [0,1000]
  5ã      # Create quintuples by repeating the cartesian product 5 times
    ʒ     # Filter this list by:
     O    #  Where the sum
      ₄Q  #  Is equal to 1000
          # (output the result implicitly after the filter)

VDM-SL, 57 bytes
{[a,b,c,d,e]|a,b,c,d,e in set{0,...,1000}&a+b+c+d+e=1000}

Set comprehension - 0 loops

Hi do you know any online editor support it so I can test?

@chaugiang don't think there is one, you can use overture though which is based off eclipse and should support all platforms if you're really interested. It's worth pointing out that it probably will take several hours to terminate.

@chaugiang here's a pastebin for output for 10 instead of 1000


text:
Integer Lists of Noah
Introduction:
I think we've all heard of it, but here a very brief summary: Noah gathered two of every species of animal on the planet, male and female, to save in his Ark during a great flood. The actual quote from the Bible is:

Genesis 7:2-3
You must take with you seven of every kind of clean animal, the male and its mate, two of every kind of unclean animal, the male and its mate, and also seven of every kind of bird in the sky, male and female, to preserve their offspring on the face of the earth.
source

But for the sake of this challenge we will ignore the clean/unclean part and the part where he took seven of each animal. This challenge is only about this part:

two of every kind of unclean animal, the male and its mate

Challenge:
Input:
You are given a list of positive integers (in random order).
Output:
Two distinct values indicating whether it's a 'List of Noah' or not. This doesn't necessary have to be a truthy/falsey value, so could also be 0/1 in Java/C#, or 'A'/'B' in any language, to give some examples.
When is a list a 'List of Noah'? When there are exactly two of every integer in the list.
Challenge rules:

I/O is flexible. Input can be a list/array/stream of integers/floats/strings, or read one by one from STDIN. Output can be any two distinct values, returned from a function or output to STDOUT / a file.
The integers in the input-list are in random order, and are guaranteed to be positive within the range \$1\leq n\leq100000\$.
The input-list is guaranteed to be non-empty.
Having an integer a multiple of two times present above 2 (i.e. 4, 6, 8, etc.) will be falsey. I.e. [6,4,4,6,4,7,4,7] is falsey, although you could still create equal pairs like this: [[4,4],[4,4],[6,6],[7,7]].

General rules:

This is code-golf, so shortest answer in bytes wins.
Don't let code-golf languages discourage you from posting answers with non-codegolfing languages. Try to come up with an as short as possible answer for 'any' programming language.
Standard rules apply for your answer with default I/O rules, so you are allowed to use STDIN/STDOUT, functions/method with the proper parameters and return-type, full programs. Your call.
Default Loopholes are forbidden.
If possible, please add a link with a test for your code (i.e. TIO).
Also, adding an explanation for your answer is highly recommended.

Test cases:
Truthy:
[7,13,9,2,10,2,4,10,7,13,4,9]
[1,2,3,1,2,3]
[10,100,1000,1,100,10,1000,1]
[123,123]
[8,22,57189,492,22,57188,8,492,57188,57189,1,1]

Falsey:
[6,4,4,6,4,7,4,7]
[2,2,2,2,2,2]
[5,1,4,5,1,1,4]
[77,31,5,31,80,77,5,8,8]
[1,2,3,2,1]
[44,4,4]
[500,30,1]
[1,2,1,1]
[2,4,6,4,4,4]
[2,23,34,4]
[2,23,3,3,34,4]

And in Quran also; Surah Al-Mumenoon, Verse 27:
So We inspired him (with this message): "Construct the Ark within Our sight and under Our guidance: then when comes Our Command, and the fountains of the earth gush forth, take thou on board pairs of every species, male and female, and thy family- except those of them against whom the Word has already gone forth: And address Me not in favour of the wrong-doers; for they shall be drowned (in the Flood).
(Yusuf Ali)

Python 3, 31 bytes
lambda l:{*map(l.count,l)}=={2}

Try it online!

Python 2, 33 bytes
lambda l:set(map(l.count,l))=={2}

Try it online!

Cool, didn't know the splat operator worked inside set literals, if I'm interpreting this correctly.

Python 3.8 (pre-release), 62 bytes (non-competing)
lambda x:{*[y.count(C)for C	in	(y:=x)]}!={*[2.]}##!2bcdfilmrtu

Try it online!
Just for fun, a solution that is itself a "List of Noah".

While fun, this breaks the rules by not being a serious contender.

It would be great if it were a common rule of this challenge to make code list-of-noahish. Pretty nice twist. I think you can add some extra comment in the title like [list of Noah truthy] to protect yourself from fun fighters and seriosity defenders.

@DaniilTutubalin Good idea.

@DaniilTutubalin There is very strong consensus to warn non-serious contenders, and then delete if the author has not corrected the answer given reasonable time to do so. Note that this answer actually falls under the label deliberately invalid, and wouldn't even require waiting, but we're being unusually nice about this one because it is fun.

@Adám For code golf, e.g., this is limited to answers that do not even attempt to golf the code. Answers that are simply poorly golfed are not invalid.
This answer is definitely well golfed and also introduces additional restriction of being list-of-Noah-truthy, which makes it even stronger contender than other solutions. So this rule does not apply here.

@DaniilTutubalin No, removing comments is an obvious way to shorten code, so it isn't well-golfed. And one cannot just make up [tag:restricted-source] requirements on a pure [tag:code-golf] challenge and claim superiority based on that. If the author of this answer wants to do so, they may ask the challenge author to (or for permission to) post such a challenge.

@negativeseven Marking an answer as non-competing does not exempt it from being invalid.

@Adám this applies to rule 2 only.

@Adám ok, answer is poorly golfed (there's a way to make it shorter), but the attempt to golf it has been done. So Rule 3 does not apply here.

@DaniilTutubalin The author himself has qualified that rule to be universal: "The only exception to this rule is using a programming language (or a feature thereof) that was implemented after the challenge was posted." (However, using post-dated languages was later allowed, so there are no more exceptions, afaict.)

Proposal: Adding difficulty to the challenge is allowed

I think the best way to satisfy everybody: put 2 solutions in one answer, one is competing and follows specs, another is with extra restriction followed.

@DaniilTutubalin But +15/-11 is definitely reliable consensus.

@Adám IMO, having a self-imposed restricted-source requirement is more akin to using a different language. There is a serious attempt to golf here, but he's not golfing Python 3.8 per se, but rather a subset of it governed by the restricted source. I see nothing wrong with this answer.

Serious contenders do not contain superfluous code https://codegolf.meta.stackexchange.com/a/10836/34718

I find the consensus in the link mbomb007 pointed two above clear and have therefore flagged this for deletion.

05AB1E, 4 bytes
¢<PΘ

Try it online!
or as a Test Suite
Explanation
¢      # count all occurrences of each element in the input list
 <     # decrement each
  P    # product
   Θ   # is equal to 1

Ah, I had prepared ¢2QP, but using Θ is also a nice alternative. :)

Thought I had a 3 with {ιË, but of course that fails when integers occur 4 times.

Brachylog, 4 bytes
ọtᵛ2

Try it online!
Explanation
ọ           Get the list of occurences of elements in the input: [[x,2], [y,2], …]
  ᵛ         Verify that for each of those pairs…
 t          …the tail (i.e. the number of occurences)
   2        …is 2

R, 20 bytes
-6 bytes thanks to digEmAll by changing the input method
any(table(scan())-2)

Try it online!
Outputs FALSE if it is a list of Noah, and TRUE otherwise. Works for any input type, not only integers.
Computes the count of each value in the list, and checks whether any of the counts are different from 2.

You could take input from stdin saving 6 bytes : Try it online!

@digEmAll Thanks; I misread the challenge rules and thought this was not allowed.

C# (Visual C# Interactive Compiler), 39, 32 bytes
l=>l.All(x=>l.Count(y=>y==x)==2)

Thanks to @Expired_Data
Try it online!

32 bytes

30 bytes

My previous comment passes all listed test cases, but fails on cases like 2, 2, 2, 2, 3, 3, 4; disregard

APL (Dyalog Extended), 5 bytesSBCS
2¨≡⍧⍨

Try it online!
Is it true that…
 2¨ two for each element
 ≡ is identical to
 ⍧⍨ the count-in selfie (count of own elements in self)
?

Haskell, 33 bytes
f x=and[sum[1|b<-x,b==a]==2|a<-x]

Try it online!
For each element of the input we ensure it appears twice in the input list.
sum[1|b<-x,b==a] is just a golfier version of length(filter(==a)x).

Perl 6, 18 bytes
{so.Bag{*}.all==2}

Try it online!

.Bag converts the input list to a Bag--a set with multiplicity.
{*} extracts all of the multiplicities.
.all creates an and-junction of the multiplicities.
== 2 results in another and-junction of Booleans, each true if the multiplicity is 2.
so collapses the junction to a single Boolean.

JavaScript (ES6), 37 bytes
Returns false for Noah or true for non-Noah.
a=>a.some(v=>a.map(x=>t-=v==x,t=2)|t)

Try it online!
Commented
a =>               // a[] = input
  a.some(v =>      // for each value v in a[]:
    a.map(x =>     //   for each value x in a[]:
      t -= v == x, //     decrement t if v is equal to x
                   //     (i.e. if v appears exactly twice, t is decremented twice)
      t = 2        //     start with t = 2
    )              //   end of map()
    | t            //   yield t, which is supposed to be equal to 0
  )                // end of some()

J, 10 bytes
[:*/2=#/.~

Try it online!

also 10 bytes: [:*/2=1#.= I really want to remove that cap but can’t figure out how.

@cole when I tried this, I got your solution. If you really wanted to remove the cap you could do 2*/@:=1#.=, also 10 bytes

@cole Nice alternative!

@ConorO'Brien Yes, @: comes handy here too.

@GalenIvanov gotta love monadic =, so strangely useful in niche golfing scenarios

APL (Dyalog Unicode), 8 bytesSBCS
Anonymous tacit prefix function. Returns 0/1.
∧/2=⊢∘≢⌸

Try it online!
…⌸ for each value as left argument and indices of occurrences of that value as right argument, call:
 ≢ tally the right argument (the occurrences)
 ∘ then
 ⊢ return that, ignoring the left argument
 2= Boolean list indicating which tallies are 2
 ∧/ AND-reduction (i.e. are they all true?)

MS SQL Server 2017, 152 150 146 bytes
CREATE FUNCTION f(@ NVARCHAR(MAX))RETURNS
TABLE RETURN SELECT IIF(2=ALL(SELECT
COUNT(*)FROM STRING_SPLIT(@,',')GROUP BY
PARSE(value AS INT)),1,0)r

The readable version:
CREATE FUNCTION f(@ NVARCHAR(MAX)) RETURNS TABLE RETURN
  SELECT IIF(2 = ALL(SELECT COUNT(*)
                     FROM STRING_SPLIT(@, ',')
                     GROUP BY PARSE(value AS INT)), 1, 0) AS r

Try it on SQL Fiddle!
-2 bytes thanks to Kevin Cruijssen

Since you don't use the alias, can't the c be removed after the COUNT(*)?

@KevinCruijssen, you are right, thank you.

Haskell, 61 45 bytes
import Data.List
all((2==).length).group.sort

Try it online!
Thanks to @KevinCruijssen for 12 bytes, and @nimi for another 4.
First Haskell answer, but it was surprisingly easy to do. Can probably be golfed a lot. Case in point...

I don't know Haskell, but I'm pretty sure all(True==).map(2==) can be all(2==). :)

... and move length to all: all((2==).length).group.sort. No need to give the function a name, i.e. drop the f=.

Indeed, I overlooked the all(2==) when I was testing in GHCi. Thanks Kevin and Nimi, I'll update the answer.

... oh and for future use: all(True==) is and.

TI-Basic, 47 Bytes
Input(L1
SortA(L1
not(remainder(dim(L1,2)) and prod(not(△List(L1))=seq(remainder(I,2),I,1,-1+dim(L1

I am a big of fan of TI-Basic. It's not a great language for really any purpose, but I enjoy programming (and golfing) in it.
How does this code work?
First, it sorts the list.
Second, it uses the △List function to generate another list, which is the difference between elements of the sorted list. (For example, △List({1,3,7,8}) would yield {2,4,1}).  Applies not to this list, which converts every non-zero element of the list to zero and every zero to one.
Then, the program checks that the resultant list fits the pattern {1, 0, 1, 0, ...}, which will only be true if the original list is a Noah list.
There is also an additional check that the length of the list is even, to catch some edge cases.
Here are some screenshots of test cases:

Julia, 30 characters 26 bytes
!a=all(x->2==sum(a.==x),a)

Thank you, H.PWiz for this trick!
Try it online!

You can have !a=all(x->2==sum(a.==x),a) for 26 bytes. NB. that I recommend counting in bytes on this site

Thank you very much! I didn't know you could (ab)use ! for anonymous functions

Jelly, 4 bytes
Qœ^Ƒ

Try it online!
Q       Is the list of unique elements
   Ƒ    unchanged by
 œ^     symmetric multiset difference with the whole input?

In broader terms, "if you remove each unique element once, do you have one of each left?" This is guaranteed to stay in the right order because œ^ is implemented as equivalent to œ-œ|œ-@, Qœ- is just empty, and œ- specifically removes elements last-first while Q is in the order of first appearances.

Octave / MATLAB, 22 21 bytes
@(x)any(sum(x==x')-2)

Anonymous function that inputs a numeric vector, and outputs 0 if the vector satisfies the condition or 1 otherwise.
Try it online! Or verify all test cases.
Explanation
@(x)                   % define anonymous function with input x
            x          % x
               x'      % x transposed and conjugated
             ==        % equality comparison, element-wise with broadcast. Gives a
                       % square matrix
        sum(     )     % sum of each column
                  -2   % subtract 2, element-wise
    any(            )  % true if and only if any value is not zero

VDM-SL, 64 bytes
f(a)==forall y in set inds a&card{x|x in set inds a&a(x)=a(y)}=2

Explanation
VDM works predominantly like second order logic statements.
forall y in set inds a                //Bind y to each of the indices of a

{x|x in set inds a&a(x)=a(y)}         //build a set of the indices of a who have the same
                                      //value as the value at y

card {...} = 2                        //and check the cardinality of that set is 2

Since you can't TIO VDM here's output from a debug session

I know there probably isn't any online compiler for it, but could you perhaps add some screenshots of (some of) the test cases as verification? :)

@KevinCruijssen saved some bytes fixing the bug, which probably made the code itself easier to understand. I'll add an explanation too :)

PowerShell, 66 37 26 bytes
-11 bytes thanks to mazzy
!(($args|group|% c*t)-ne2)

Try it online!
Groups up $l and grabs all the counts of matching values. It then filters out all counts of 2 from this list. If the list is empty, it's a Noah number; otherwise, it'll be populated still with non-2 counts. Not-ing the list will yield True if it's empty and False if it's populated

Fails if the values balance each other out.. i.e [1,2,1,1] so the count is 4, the count of unique is 2 and hence will resolve as noah despite not being noah.

@ExpiredData Heck

I tried this approach in another language before realising it just won't work...

@ExpiredData Okay, now it should work on account of doing something completely different.

¯\(ツ)/¯ 26

@mazzy Thanks. Forgot all about group being a thing that exists

Elixir, 52 bytes
fn v->Enum.all?v,fn x->2==Enum.count v,&x==&1end end

Try it online!
Complete Elixir noob here :-D.

PHP, 60 bytes
function($a){return!array_diff(array_count_values($a),[2]);}

Try it online!
PHP has great built-ins for this, though at 20 chars, array_count_values() is not a very golfy one.

PHP always has great built-ins, with long names, sigh!

Mathematica, 25 24 bytes
MatchQ[{{_,2}..}]@*Tally

Try it online!
The Tally function returns a list of the form {{element, count}, ...}, which is then matched against a pattern that checks whether all count are 2.

Attache, 16 bytes
${All&x!{_~x=2}}

Try it online!
Explanation
${All&x!{_~x=2}}
${             }    lambda with input x
  All&x!{     }     over each element _ of x:
         _~x            check that the number of occurrences of _ in x
            =2          is 2

Alternatives
17 bytes: {All&_!`=&2@`~&_}
18 bytes: {All[`=&2@`~&_,_]}
23 bytes: Same@2&`'@Sum@Table[`=]
25 bytes: Same«2'Sum@Table[`=,_]»
25 bytes: Same<~2'Sum@Table[`=,_]~>
25 bytes: {Same[2'Sum@Table[`=,_]]}
35 bytes: {Commonest@_==Unique@_and _[0]~_=2}

K (oK), 9 bytes
Solution:
&/2=#:'.=

Try it online!
Explanation:
&/2=#:'.= / the solution
        = / group
       .  / value
    #:'   / count (length of) each
  2=      / equal to 2?
&/        / take minimum

Julia 1.0, 32 bytes
l->sum(isone,l./l')/length(l)==2

Try it online!
Divides each element of the input array l by the transpose l' giving a matrix. Summing over this matrix while applying isone to each element gives twice the length of l if each element appears exactly twice.

Wolfram Language (Mathematica), 17 bytes
2==##&@@Counts@#&

Try it online!
Counts returns an association of <| (value)->(# occurences), ... |>. Then 2==##& checks if those occurence-counts are all equal to 2.

2==##&@@ is brilliant!

Nekomata + -e, 4 bytes
oĉŤđ

Attempt This Online!
oĉŤđ
o       Sort
 ĉ      Split into runs of equal elements
  Ť     Transpose; fails if not rectangular
   đ    Check if length is 2

Nekomata + -e, 4 bytes
oĭu=

Attempt This Online!
oĭu=
o       Sort
 ĭ      Uninterleave
  u     Uniquify
   =    Check equality

Nekomata + -e, 4 bytes
Ţ≡2=

Attempt This Online!
Ţ≡2=
Ţ       Tally; produces a list of unique elements and a list of their counts
 ≡      Check if all counts are equal, and return that value
  2=    Check if equal to 2

Nice answer! For a moment I was confused why you had a đ - Check if length is 2 builtin, but I saw it's actually an unpair builtin, which as side effect fails if the length isn't 2. :)

Elm 0.19, 66 bytes
n a=List.all(\x->List.foldl(\y c->if x==y then c+1 else c)0 a==2)a

Verify all test cases here.
For every item, iterate over the list and count how many items it is equal to. Return True if the count is exactly 2 for each item, False otherwise.

Pyth, 7 bytes
!n#2/LQ

Try it online!
!n#2/LQQ   Implicit: Q=eval(input())
           Trailing Q inferred
     L Q   For each element of Q...
    / Q    ... count its occurrences in Q
  #        Filter keep those elements...
 n 2       ... which are not equal to 2
!          NOT - maps [] to True, others to False
           Implicit print

Another 7-byte solution is !smtt/Q

@RK Unfortunately.that one fails for input [1,2,2,2,3,4] :(

Jelly, 5 bytes
ĠẈ=2Ạ

Try it online!
A monadic link that takes a list of integers and returns 1 if a Noah list and 0 if not.

MATL, 6 bytes
8#uqqa

Try it online!
0 for truthy, 1 for falsy. Ports Robin Ryder's answer.
MATL, 6 bytes
&=s2=A

Try it online!
1 for truthy, 0 for falsy. Ports Luis Mendo's answer.

Kotlin, 96 77 69 51 bytes
fun f(t:List<Int>)=t.count{t.count{i->it==i}!=2}==0

Try it online!

Ruby, 29 bytes
->a{a.all?{|e|a.count(e)==2}}

Try it online!

Excel, 45 bytes
=SUM(IF(FREQUENCY(A:A,A:A)=2,1))=COUNT(A:A)/2

Assumes data in column A, with this entered in any cell other than one in column A.
Returns TRUE if there are pairs and FALSE if they are not matching pairs
        FREQUENCY(A:A,A:A)                     Counts how many of each value there is
     IF(                  =2,1)                If this is 2, add value of 1 to array otherwise 0
=SUM(                          )               Sum the count in that array that have a exactly 2
                                 COUNT(A:A)/2  Count how many total values in column
                                =              If this is equal, return TRUE else FALSE

Tried removing the /2 and adding .5 for the summing, but this did not work.
Tried counting the frequencies that are <>2 and this did not return the right amount.

Powershell (5.1), 20 48* Bytes:
I setup my variables like this (which may not be correct):
 $a = (7,13,9,2,10,2,4,10,7,13,4,9)

I then add that variable to:
$a |group|%{$m=@{}}{$m[$_.Name]=($_.Count)-eq2}{$m}

This outputs the "Name" and "True" or "False"
(could also use the animals names & it would work)

group - Groups the items
% - Abbreviation for For-Each
$m=@{} - Assigns the new variable
$_.Count-eq2 - Item count that equals 2
$y - List each item with True or False (if it equals 2)

Results are similar to this:

*Note: This answer has been edited as I bungled things the first multiple times...

I think that screenshot is from a different challenge? :S Could you perhaps post a screenshot with some of the test cases for this challenge as verification?

Standard rules requires that the code should be "programs or functions". For Powershell, this means that the code can be saved as a file with the .ps1 extension and executed as a script. Your code is a snippet, not "programs or functions".

Sorry, I bungled this one. I reused my variables so it appeared my code was working great. I may have misunderstood the variables as well. I am updating my answer again now.

I edited my post and it should work now. I think I can make it a bit smaller if I set it up differently and use the original $a variable & remove the need for the $m. I just don't have time to work it out right now...

A few things: Your current code is 51 bytes, here's some examples on how to make your code take proper arguments, and lastly: your code stops one step short of finishing the problem. You have all the bools you need, still need to reduce it into one true/false return. Good first attempt though!

Bash, 26 bytes
Exit code is nonzero iff the list is of Noah.
sort|uniq -c|grep -v ' 2 '

Try it online!

Factor, 53 bytes
: f ( s -- ? ) dup counts [ last ] map [ 2 = ] all? ;

Unfortunately dosn't work in TIO. Here's a screenshot of the Factor Listener (REPL):

Python 3, 37 bytes
lambda l:all(l.count(i)==2for i in l)

Try it online!

Jelly, 5 bytes
ċⱮ=2P

Try it online!
Not shorter than, but different than the existing jelly answer.

///, 358 299 bytes
/|/\/\///`/'\\|&/%`\%`\%T;`\%R;N`\%T;`\%|:/\\\\|;/`\`\|_/%%|%/`/|%<-::>:::|QT/%R'N%Q'T_<-;>%<-;;>;;_<`->%_L`S%L'S_-` *%-`{*[_-`{*%{-_!`{%{!_^`{*%^{-_[`*%*[_-`*%*-_!`*%*!_-`[%[-_!`[%[!_{`[%!_^`!%^-!_-`$%$_-`!!`$%$_-`!$&0_!`!!$&0_^`$&1_Q`T%Q'T%R'N|RN/QT|<-:>/<-::>::|<\->/|!*/!-|-*/--|LS/^!DATA GOES HERE$|Q\T/QT/RN

Try it online!
Try it online! (legible-ish version)
I don't know if this is the first Code Golf answer which uses an actual computational loop in slashes, but I'm very proud of it regardless. The loop construction I use is due to Ørjan Johansen, and is elaborated on on the wiki (although not in very high detail, and he uses | instead of '). There is a whole lot of escaping involved.
Input is in the form of a string which replaces DATA GOES HERE in the source code. The string should be a -delimited list of unary numbers with * representing one. Output is 1 if the list is a list of Noah, 0 if it is not.
Explanation

The program revolves around the manipulation of the input string, which is prefixed by ^! and suffixed by $. First, the following two substitutions are made: /!*/!-/ and /-*/--/, which turn the first number of the input into dashes. It will be the number line for recording the whole list.
The rest of the program is inside a loop (not presented in the same order as in the program). First, it organizes the data

/- */-\{*[/ /[*/*[/    turn the next number into a "rocket"
                       eg `^!--- **` => `^!---{**[`
/-{*/{-/               the front of the rocket moves forward by "using up fuel"
/!{/{!/                moving forward through a `!` does not cost any fuel
/-*/*-/ /!*/*!/ /-[/[-/ /![/[!/
                       the rest of the rocket follows the head
/^{*/^{-/              the rocket extends the number line if it runs out of room
/{[/!/                 once the rocket runs out of fuel, it becomes a `!`

Since a rocket travels a number of -s equal to the number it came from, the result is a backwards number line where every member of the original list is marked with !s, eg ^!*** ** *** *****$ => ^!--!!-!--$
When the last number turns into a rocket, the $ begins inspecting the number line:

/^!/^-!/                 needed for some of the following to work
/-$/$/ /-!!$/$/          the inspector finds things satisfactory so far
/-!$/N\O/ /!!!$/N\O/     the inspector has rejected this input
/^$/Y\S/                 the inspector has accepted this input

The loop works by replacing a "variable" RN with a copy of the relevant code. The simplest way to stop the loop and output the result is to conditionally replace RN with the result so that the loop can't continue. We do this by replacing YS and NO with a replacement that replaces RN with the relevant value: /YS/\/\/T\\\/R\\N\/T\\\/1/ /NO/\/\/T\\\/R\\N\/T\\\/0/. (It is //f/r instead of /f/r/ because the YS and NO values already exist inside a replacement, so it becomes works like, eg, /LS/YS/ => /LS///RN/1/

Notes
Variables are two letters because you have to be able to escape them by putting a \ in the middle (/V\R/val/ is equivalent to /VR/val/), otherwise they'll replace themselves in the copy that's used for looping.
At the beginning of the program are several "golfing substitutions" which serve no purpose other than to make the program shorter and even less legible.
59 bytes saved by using direct replacement instead of YS and NO, and doing 2 more golfing substitutions (& for the replacement-replacement which is nearly the same for accepting and rejecting, and ` for '\)

Vyxal, 5 bytes
vO2J≈

Try it Online!
Makes a list of how many times the integer exists in the list, adds 2 to the list and checks if everything is equal. A sneaky way to check if all the items are equal, and that they are all 2.

Try it Online! for 4 bytes, or Try it Online! for 3 bytes using Vyncode

Factor, 32 bytes
[ histogram [ 2 = ] assoc-all? ]

Try it online!

K (ngn/k), 14 bytes
{*(2=#'.=x)^1}

Try it online!
This one is a little bit lengthier than it needs to be though. Return 0N (i.e. null) for true and 0 for false.
Explanations:
{*(2=#'.=x)^1}  Main function. Takes x as input
  (      x)     x
        =       Group. Returns a dictionary with the keys being the values
                that appear in the array, and the values being the position
                of the corresponding key.
       .        Get just the value
     #'         Get the length for each of them
   2=           See if it's equal to 2
            ^1  Eliminate 1s in the result (i.e. remove truthy values)
 *              Get the first element

Thunno 2, 4 bytes
c⁻pḅ

Attempt This Online!
Port of Emigna's 05AB1E answer.
Explanation
c⁻pḅ  # Implicit input
c     # Counts of each element
 ⁻    # Decrement each
  p   # Product of this list
   ḅ  # Equals one?
      # Implicit output

Charcoal, 7 bytes
⬤θ⁼²№θι

Try it online! Link is to verbose version of code. Outputs - for a List of Noah. Explanation:
 θ      Input array
⬤       Do all elements satisfy the condition
    №   Count of
      ι Current element
     θ  In input array
  ⁼     Equals
   ²    Literal 2
        Implicitly output

Whoa, that's one very charcoal circle.

Retina 0.8.2, 32 bytes
O`\d+
(\d+)(,\1)*\b
$#2
^1(,1)*$

Try it online! Link includes test cases. Explantion:
O`\d+

Sort the integers. (This is a string sort but it doesn't matter assuming no leading zeros.)
(\d+)(,\1)*\b
$#2

Count the number of duplicates of each integer.
^1(,1)*$

Each integer should have one other duplicate.

Japt, 6 bytes
Outputs false for true and true for false.
ü mÊdÍ

Try it or run all test cases
ü mÊdÍ     :Implicit input of integer array
ü          :Group by value
  m        :Map
   Ê       :  Length
    d      :Any truthy (not 0)?
     Í     :  When subtracted from 2

Wolfram Language (Mathematica), 38 bytes
Gather@#~Cases~{_,_}~Total~2==Total@#&

Try it online!

Stax, 5 bytes
é♪Ccv

Run and debug it
Algorithm:

Sort array.
Get run-lengths.
Remove all 2s from run-lengths.
Result is empty?

Red, 52 bytes
func[b][(extract sort b 2)= unique extract next b 2]

Try it online!

Python 3, 41 bytes
lambda x:set([x.count(i)for i in x])=={2}

Try it online!

C, 84 83 bytes
c['   '],r,*p,*s,*e;f(){for(p=s;p<e;)c[*p++]++;while(s<e)r=c[*s++]-2?1:r;return r;}

Try it online!
f() returns 1 if the list is not a list of Noah, and 0 otherwise.
The variable s should point to the beginning of the array, and e should point to the end. Note that after f() is called, c must be reset to 0s before it can be called again. Also, this might not work on all computers, because I'm pretty sure multi-byte characters are implementation-defined, and it won't work if INT_MAX < 100000.
If I/O is very flexible, and outputting to a variable is enough, the return r; is unnecessary, and it can be reduced to 74 bytes.
De-golfed:
int counts[100001], return_value;

int f(int *start, int *end) {
        int *ptr;
        for (ptr = start; ptr < end; ptr++)
                counts[*ptr]++;
        for (ptr = start; ptr < end; ptr++) {
                if (counts[*ptr] != 2) {
                        return_value = 1;
                }
        }
        return return_value;
}

Thanks to @ceilingcat for -1 byte!

Functions should preferrably be reusable without massaging external values.

APL(NARS), 9 chars, 18 bytes
{⍵≡⍦,⍨∪⍵}

test:
  f←{⍵≡⍦,⍨∪⍵}
  f 7,13,9,2,10,2,4,10,7,13,4,9
1
  f 77,31,5,31,80,77,5,8,8
0
  f 2,4,6,4,4,4
0

Dart, 66 bytes
f(n)=>n.map((m)=>n.where((o)=>o==m).length==2).reduce((p,e)=>p&e);

Try it online!

Vim, 45 bytes
:sor|%norm J
:g/^\v(.*) \1$/d
:g/./norm ggcG0

Try it online!
This will output nothing for a valid Noah list, and a 0 for an invalid Noah list.

This unfortunately does not work for testcases like 7 7 7 7, but anyways, here's a solution at 33 bytes :sor<cr>qq*djkj@qquG@qqar.ggcG0<esc>qu@a

https://tio.run/##fVHbctowEH1mf6EvO5RJ2o5AyDKxnTppXpo89gMymcGVhe2EWL5SmNJvJytjUjKlGWvPXrV7vPoZ1elORc21CsPvP253l7WpoCy/xI9Pjzdl2d4RRNUkSdTd9EPZ3kQ7qoL1OkYFv9JsqbHSUYzZV4wNDLKr4eh3xjnj8GcIg4@YNk1RX3KuTKwTs1xM6iZST3qt0ihP9ESZZx5x4XvB7AIGNLoJw3A4yobbNs9KHKttUukCxys8RwfPr3msVzxvl0sY3N/jvNYxcsFjujT6NscrnBebJjW5g9wUDV/x5yjLJ8UGFY5bHC8w/FRUWd4s0M74PMeHh7MzrVKDG11vt52VG4hNrnceE5IFzGFiSuBa1YVcFoCgiGQdAsXFtBOC3uw9EA5VORJ85jhs5gk/YG7gHByf@Z27t/dp6gAXNMNlFj0rQBcOH8yowmUWSYPnMSnII/CJnkcmNe3pEXNwbScXZsRGdoRslLTTD7BJaiuZ/Gux3vPAY50ckDT9/@HAkWFtCST2SOj2JE@t7m1OyP0e5Ts1r/dfE6ffhF7lf9ngOH8q@y@pdykd05Zvql4A

31 https://tio.run/##fVHbctowEH1mf6EvO5RJ2o5AyDKxnTopL20e@wGZzODKwnZCLF8pTOm305UxKZnSjLVnr9o9Xv2I6nSvouZWheHX79/217WpoCw/xY9Pj/OybO/mZVRNkkTdTd@188meamCziVHBzzRbaax0FGP2GWMDg@xmOPqVcc44/B7C4D2mTVPU15wrE@vErJaTuonUk96oNMoTPVHmmUdc@F4wu4IBDW7CMByOsuGuzbMSx2qXVLrA8Rov0cHLWx7rNc/b1QoG9/e4qHWMXPCYLo2@LPAGF8W2SU3uIDdFw9f8OcrySbFFheMWx0sMPxRVljdLtDM@LvDh4eJCq9TgVte7XWflBmKT673HhGQBc5iYErhWdSGXBSAoIlmHQHEx7YSgN3sPhENVjgSfOQ6becIPmBs4R8dnfuce7EOaOsAVzXCZRc8K0IXjBzOqcJlF0uB5TAryCHyi55FJTXt6xBxc28mFGbGRHSEbJe30A2yS2kom/1qs9zzwWCdHJE3/fzxwYlhbAok9Ero9yXOre50T8rBH@UbNy/2XxPk3oVf5XzY4zZ/L/kvqTUqntOWrqj8

Brainfuck: 69
->+[>+<-[[-]+>->>[-]]+>[->++[-<<<+]->>]<,]>>>[>>[--[[-]>>-<[-]<]]>]>.

The bf interpreter/compiler needs to support 0 as EOF. It also need at least 300003 cells for be be used with number upto 100000. beef seems to match this.
The numbers are expected to come in as unary (whatever) terminated by ascii 1. It will output chr 0 on a valid set and chr 99 on an invalid set. If your terminal has UTF-8 you'll get some complaints or a replacement chars (the ?) as an indication.
The code uses bf memory as the first cell as an -1 flag that it seeks to after every number. Each number triggers it to jump 3 cells, since I have a 3 cell item and the whole BF memory is considered an array:
flag (-1) [ visited | flag | count ]*

Thus if you supply 3 it will set count on the third index to 1 and every visited flags to 1 upto that.
I've tested like this:
#!/usr/bin/fish
set -l tests '[7,13,9,2,10,2,4,10,7,13,4,9]
[1,2,3,1,2,3]
[10,100,1000,1,100,10,1000,1]
[123,123]
[8,22,57189,492,22,57188,8,492,57188,57189,1,1]
[6,4,4,6,4,7,4,7]
[2,2,2,2,2,2]
[5,1,4,5,1,1,4]
[77,31,5,31,80,77,5,8,8]
[1,2,3,2,1]
[44,4,4]
[500,30,1]
[1,2,1,1]
[2,4,6,4,4,4]
[2,23,34,4]
[2,23,3,3,34,4]
'

for in in (echo $tests)
  echo -n $in :
  echo $in | perl -pe 's/(\d+)/"1" x $1/ge;s/[^\]\d,]//g;s/(?:]|,)/\x01/g;' | beef  moses.bf
  echo ''
end

And got the following output:
[7,13,9,2,10,2,4,10,7,13,4,9] :
[1,2,3,1,2,3] :
[10,100,1000,1,100,10,1000,1] :
[123,123] :
[8,22,57189,492,22,57188,8,492,57188,57189,1,1] :
[6,4,4,6,4,7,4,7] :[Invalid UTF-8] \xff
[2,2,2,2,2,2] :[Invalid UTF-8] \xff
[5,1,4,5,1,1,4] :[Invalid UTF-8] \xff
[77,31,5,31,80,77,5,8,8] :[Invalid UTF-8] \xff
[1,2,3,2,1] :[Invalid UTF-8] \xff
[44,4,4] :[Invalid UTF-8] \xff

jq, 30 characters
group_by(.)|map(length==2)|all

Sample run:
bash-5.0$ jq 'group_by(.)|map(length==2)|all' <<< '[7,13,9,2,10,2,4,10,7,13,4,9]'
true

Try it online!
Try all test cases online!

PHP, 58 bytes
for(;$n=$argv[++$i];$a[$n]++);echo min($a)==2&&max($a)==2;

Each number in the list is passed as an argument.
Outputs 1 for truthy and nothing for falsey.
Try it online!
Tests

Kotlin, 46 45 bytes
fun f(l:IntArray)=l.all{l.count{i->it==i}==2}

Try it online!

Welcome to the site!

Swift 5.1, 63 bytes
let x={(a:[Int])in a.allSatisfy{v in a.filter{v==$0}.count==2}}
When the count(where:) function will be available, it'll become:
let x={(a:[Int])in a.allSatisfy{v in a.count{v==$0}==2}}
Try it online!

Welcome to the site!

Four years and seven minor releases later, and count(where:) is still in purgatory because the type-checker couldn't handle it. Regardless, I think you can drop the let x= and the explicit type, so just {a in a.allSatisfy{v in a.filter{v==$0}.count==2}} would be a valid spelling of this answer.

Arturo, 24 bytes
$=>[[]=--values tally&2]

Try it!
$=>[        ; a function where input is assigned to &
    tally&  ; create a dictionary of counts of elements in input
    values  ; get just the counts
    --   2  ; remove all the twos
    []=     ; is it the empty list?
]           ; end function

Desmos, 40 bytes
f(L)=0^{[L[L=i].length-2fori=L]^2.total}

Try It On Desmos!
Try It On Desmos! - Prettified

Vyxal 3, 4 bytes
SUu₌

Try it Online!
Sort, uninterleave, uniquify, check if equal

Perl 5 -pl, 31 bytes
$k{$_}++}{$_=!grep$_-2,values%k

Try it online!

Uiua, 8 bytes
/×=2⊕⧻⊛.

Test pad

Awk, 44 bytes
{++k[$0]}END{for(i in k)a=a||k[i]-2;print a}

Try it online!
0 means it is a list of Noah, 1 means that it is not a list of Noah.

AWK, 36 32 bytes
++_[$0]-2{i++}END{print NR/i==2}

Try it online!

-4 bytes, print value of NR/i==2 assessment instead of using ternary operator.

Will print 1 for List of Noah and 0 for not.