There was a topic back on UTI to find all modes of a list in the shortest code-- read it if you want.
You are given a list of at most 50 real numbers through either Ans or Input, which will have a unique mode. In 21 bytes of z80 TI-BASIC (don't count the program header), output the mode.
By comparison, Weregoose had this in 2007:
—Ans→X:seq(sum(Ans=Ans(X)),X,1,dim(Ans:Ans=max(Ans:LX(max(Ansseq(X,X,1,dim(Ans—(40 bytes)
(Paste to see it; we don't have spoilers)
which can be optimized to
—Ans→X:seq(sum(Ans=Ans(X)),X,1,dim(Ans:Ans=max(Ans:LX(max(AnscumSum(1 or Ans—(36 bytes)
DarkerLine's 24-byte snippet later on in the thread fails for numbers of sufficient magnitude, so it's invalid for this challenge.
You are given a list of at most 50 real numbers through either Ans or Input, which will have a unique mode. In 21 bytes of z80 TI-BASIC (don't count the program header), output the mode.
By comparison, Weregoose had this in 2007:
—Ans→X:seq(sum(Ans=Ans(X)),X,1,dim(Ans:Ans=max(Ans:LX(max(Ansseq(X,X,1,dim(Ans—(40 bytes)
(Paste to see it; we don't have spoilers)
which can be optimized to
—Ans→X:seq(sum(Ans=Ans(X)),X,1,dim(Ans:Ans=max(Ans:LX(max(AnscumSum(1 or Ans—(36 bytes)
DarkerLine's 24-byte snippet later on in the thread fails for numbers of sufficient magnitude, so it's invalid for this challenge.