Home

1a1b

1a1b (often written as 1A1B) is a score notation used in bulls-and-cows style guessing games to communicate feedback about a guessed code. In this system, the letter A denotes a digit that is correct and in the correct position, while B denotes a correct digit that is in the code but in the wrong position. The string 1A1B therefore means one digit is in the right place and one other digit is present but misplaced.

The notation is commonly used in games where players try to deduce a secret sequence of digits

Example: with a secret 1234 and a guess 1325, the feedback is 1A2B. The first digit '1'

Origins and usage: the A/B feedback convention derives from the Bulls and Cows puzzle and has become

See also: Bulls and Cows, Mastermind, number-guessing puzzles.

(often
four
digits).
After
each
guess,
the
judge
responds
with
a
string
such
as
xAyB,
where
x
is
the
number
of
bulls
(A)
and
y
is
the
number
of
cows
(B).
Correct
counting
is
important
when
digits
repeat,
and
standard
implementations
ensure
that
each
digit
is
counted
at
most
once
between
bulls
and
cows.
is
in
the
correct
position
(A).
The
digits
'3'
and
'2'
are
present
in
the
secret
but
in
different
positions
(two
Bs).
The
digit
'5'
is
not
in
the
secret.
common
in
programming
challenges,
educational
materials,
and
online
puzzle
communities.
It
is
also
used
in
variants
of
Mastermind
that
employ
digits
rather
than
colored
pegs.
The
lowercase
variant
1a1b
is
simply
a
stylistic
or
typographical
variation
of
the
same
scoring
concept.