Skip to main content
Commonmark migration
Source Link

Prolog, 73, 71, 67 bytes

q(X):-X='0',write(1);write(0).
p(X):-atom_chars(X,L),maplist(q,L).

#Prolog, 73, 71, 67 bytes# q(X):-X='0',write(1);write(0). p(X):-atom_chars(X,L),maplist(q,L). NotNot an optimal language for this challenge.
Having input in string-form makes for an expensive conversion to list.
Could probably be improved on though.

Testing:
Try it out here

#Prolog, 73, 71, 67 bytes# q(X):-X='0',write(1);write(0). p(X):-atom_chars(X,L),maplist(q,L). Not an optimal language for this challenge.
Having input in string-form makes for an expensive conversion to list.
Could probably be improved on though.

Testing:
Try it out here

Prolog, 73, 71, 67 bytes

q(X):-X='0',write(1);write(0).
p(X):-atom_chars(X,L),maplist(q,L).

Not an optimal language for this challenge.
Having input in string-form makes for an expensive conversion to list.
Could probably be improved on though.

Testing:
Try it out here

unified 2 clauses with OR to save 4 bytes
Source Link
Emigna
  • 53k
  • 5
  • 43
  • 162

#Prolog, 73, 7171, 67 bytes# q(48X):-X='0',write(1). q(49):-write;write(0). p(X):-atom_codesatom_chars(X,L),maplist(q,L). Not an optimal language for this challenge.
Having input in string-form makes for an expensive conversion to list.
Could probably be improved on though.

Testing:
Try it out here

#Prolog, 73, 71 bytes# q(48):-write(1). q(49):-write(0). p(X):-atom_codes(X,L),maplist(q,L). Not an optimal language for this challenge.
Having input in string-form makes for an expensive conversion to list.
Could probably be improved on though.

Testing:
Try it out here

#Prolog, 73, 71, 67 bytes# q(X):-X='0',write(1);write(0). p(X):-atom_chars(X,L),maplist(q,L). Not an optimal language for this challenge.
Having input in string-form makes for an expensive conversion to list.
Could probably be improved on though.

Testing:
Try it out here

saved 1 bytes
Source Link
Emigna
  • 53k
  • 5
  • 43
  • 162

#Prolog, 7373, 71 bytes# q('1'48):-write(01). q('0'49):-write(10). p(X):-atom_charsatom_codes(X,L),maplist(q,L). Not an optimal language for this challenge.
Having input in string-form makes for an expensive conversion to list.
Could probably be improved on though.

Testing:
Try it out here

#Prolog, 73 bytes# q('1'):-write(0). q('0'):-write(1). p(X):-atom_chars(X,L),maplist(q,L). Not an optimal language for this challenge.
Having input in string-form makes for an expensive conversion to list.
Could probably be improved on though.

Testing:
Try it out here

#Prolog, 73, 71 bytes# q(48):-write(1). q(49):-write(0). p(X):-atom_codes(X,L),maplist(q,L). Not an optimal language for this challenge.
Having input in string-form makes for an expensive conversion to list.
Could probably be improved on though.

Testing:
Try it out here

Source Link
Emigna
  • 53k
  • 5
  • 43
  • 162
Loading