공유 (캐릭터)는 배려입니다!


40

개요

다음 작업을 고려하십시오.

양의 정수 n> 0이 주어지면 정수 제곱근을 출력하십시오. 숫자 n 의 정수 제곱근 은 x 의 가장 큰 값이며 여기서 x 2 ≤ n 이며 보통 공식으로 표현됩니다 floor(sqrt(n)).

예 : 25 -> 5, 24 -> 4, 40 -> 6, 1 -> 1.

이 작업은 그 자체로 충분히 쉽습니다. 그러나이 과제에서는 25 자만 사용하여 가능한 한 많은 언어 로이 문제를 해결해야 합니다.

먼저, 25 바이트 의 세트 (중복 없음) 를 선택해야 합니다. 다음과 같이 보일 수 있습니다 (앞 공간을 참고하십시오).

 ()*-.05:=>Mabdhilmnqrst|

그러면이 세트의 문자 만 사용하여 가능한 한 많은 텍스트 기반 (죄송하지만 Piet) 언어로 문제에 대한 솔루션을 구성해야 합니다. 필요한만큼 문자를 사용할 수 있지만 세트 외부의 문자를 사용해서는 안됩니다.

솔루션은 전체 프로그램 또는 기능 일 수 있지만 스 니펫은 아닙니다. 예를 들어,이 문자 집합을 사용하면 다음을 수행 할 수 있습니다.

M -> (int) Math.sqrt(M)    // Java (lambda expression)
M => Math.sqrt(M)|0        // Javascript (unnamed function)
lambda M: int(M**.5)       // Python (lambda function)

3 개 언어를 사용 했으므로이 점수는 3 점입니다 .

답변에 사용중인 바이트 세트도 포함하십시오.

규칙

  • 이것은 도전입니다-점수는 제출에 포함 된 언어의 수입니다. 가장 높은 점수가 이깁니다. 표준 허점이 적용됩니다.
  • 이 과제에서 '언어'는 분명히 다른 프로그래밍 언어로 간주됩니다. 동일한 언어 (Python 2, Python 3 등)의 여러 버전이 금지됩니다.
  • 프로그램은 언어의 표준 정수 범위 내의 입력에 대해서만 작동하면됩니다.
  • 소스 코드가 정확히 동일한 프로그램 (폴리 글 로트)은 허용되지 않습니다.
  • 보다 구체적으로 말하면 문자가 아닌 바이트 세트 이므로 05AB1E £와 Jelly ɱ를 동일한 문자로 사용할 수 있습니다 (코드 포인트가 동일하기 때문).

다른 모든 솔루션을 이길 수 있다고 생각하지 마십시오. 흥미로운 답변이 있으면 게시하십시오!


2
코드가 원시 ppm이면 솔루션이 Piet에있을 수 있습니까? (예 : P3 10 10 255 ...)
밀 마법사

우리는 또 다른 픽셀 기반 언어가 필요합니다. 그래서 오래된
피펫을

2
B에서만 작동하는 다른 솔루션을 제공하는 경우 A와 B의 폴리 글 로트를 언어 A로 계산할 수 있습니까?
밀 마법사

"명백하게 다른"것을 명확히 할 수 있습니까? 예를 들어, Numberwang ( 뇌 대신 숫자 사용)이 []<>.,+-Brainfuck과 분명히 다른가요? 2D Brainfuck 파생물 인 SNUSP어떻 습니까? 두 가지 모두 결과 코드는 Brainfuck에서 작동하지 않습니다.
JungHwan Min

@WheatWizard 당신은 정확히 같은 두 개의 프로그램을 가질 수는 없지만 하나를 다르게 수정하면 허용됩니다. 그리고 네, 정말로 필요한 경우, Raw ppm을 Piet의 "텍스트"로 사용할 수 있습니다 : P
FlipTack

답변:


37

20 개 언어

 ()-#*.05;=>^Vefikloqrst지금까지 (24 자) 사용 :

let f l=floor(l**0.5);;       OCaml
let f l=floor(l**0.5)         F#
f(l)=floor(l^.5)              Julia
f(o)=floor(o^.5)              PARI/GP
s^+>5 0>5 0*.5l               Pyth
(* **.5).floor                Perl 6
floor.(**0.5)                 Haskell
flr.(tt ^.5)                  Wonder
l=>l**.5^0                    JavaScript
l->l**.5^0                    Cheddar
.5^5*5f                       Pyke
(isqrt)                       Maple
ri.5#i                        CJam
isqrt                         Common Lisp
0.5^k                         MATL
*.5^0                         Jelly
*.^0                          M
t0^                           05AB1E
q f                           Japt
r#                            Pushy
V-                            gs2

flr.(tt ^.5)Wonder (추가 된 문자 없음)를 추가해보십시오 .
Mama Fun Roll

추가 {}[] 하려면 Brain-Flak을 추가하십시오. 프로그램은 다음과 같습니다
밀 마법사

추가 한 경우 Stacked 에서 ~수행 할 수 있습니다 . TOS에서 입력을 받아 스택에 출력을 남깁니다. sqrt~~
Conor O'Brien

줄리아는이isqrt
rahnema1

isqrt줄리아에서는 폴리 글 로트가 허용되지 않으므로 계산에 포함되지 않습니다.
JungHwan Min

8

10 개 언어

CP-1252 에서 19 자 문자 세트 :

,-/12@QUVX^fkmt¬÷␊␍

어디 나타내는 줄 바꿈을 하고는 나타냅니다 캐리지 리턴 .

( 문자 확인 용 스크립트 )


젤리, 2 바이트

ƽ

온라인으로 사용해보십시오!

05AB1E, 2 바이트

t1X-^

온라인으로 사용해보십시오!

GS2, 2 바이트

V-

온라인으로 사용해보십시오!

줄프, 3 바이트

mfU

여기 사용해보십시오! (Firefox에서 가장 잘 작동합니다)

apt, 2 바이트

¬f

여기 사용해보십시오!

MATL, 3 바이트

X^k

온라인으로 사용해보십시오!

파이크, 3 바이트

,1f

여기 사용해보십시오!

Pyth, 6 바이트

/@Q2t2

여기 사용해보십시오!

오아시스, 6 바이트

1␊2/m1÷

온라인으로 사용해보십시오!

2 바이트, 9 바이트

t1X-XX--^

온라인으로 사용해보십시오!


cUJolf에서도 작동합니다.
Conor O'Brien

@ ConorO'Brien 짧지 만 c문자 목록에 추가 하는 것을 의미합니다 . 그는 이미 m(Oasis 하위 답변에서) 및 f(Japt 및 Pyke 하위 답변에서)를 모두 사용하고 있습니다.
Kevin Cruijssen

@KevinCruijssen ik, 그것은 단지 후손을위한 것입니다
Conor O'Brien

6

5 개 언어

더 많은 언어를 곧 추가 할 예정입니다.

문자 세트 (22 바이트) :

s^Q.5=>*|0√Lrdmlab :/1

피스

s^Q.5

자바 스크립트

Q=>Q**.5|0

사실은

√L

CJam

rdmQ

파이썬

lambda Q:Q**.5//1

2
당신은 대체 할 수 있습니다 |에 의해 ^캐릭터 세트에 바이트를 저장하는 자바 스크립트 대답한다.
Lynn

6

5 개 언어

[].,+<>{}()0134879

18 자

알파벳 문자를 사용하지 않으려 고합니다 ...

Brainfuck , Brainfuck ++ , Brainfuck-ng , Braintrust , ...

,[[>++++++[<++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++]>[+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++<]>[+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++<+>]<<<[+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>>+<<]],]>>>>>>>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++[<<<<<[+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+>+<<]>[+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++<+>]<<+[+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++<<+>>>>+<<]>>[+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++<<+>>]<<<<[>>[<+>>>+<<+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++]<[>+<+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++]<+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++]>>>>>>>>+<<<<[>>>+<<[+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+>[+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++]<<]>>[+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+<]<[+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++<+>]<+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++<+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++]>[+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++]>>>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++]<<<<<<+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++<++++++++++>[+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++<+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++[<+<<]<[+[+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+<]<+<<]>>>>>]<<<[<++++++[+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>++++++++<]>.[+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++]]++++++[+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>++++++++<]>.

(= (sqrt (225) +1) ^ 2) 오버플로 224때문에 오버로 작동하지 않습니다 256.

하나의 적은 문자를 사용하기 위해 모든을 -s 로 교체했습니다 +. (예 : --> 255 +초)

오리지널 프로그램

,[[>++++++[<-------->-]>[->++++++++++<]>[-<+>]<<<[->>+<<]],]>>>>>>>-[<<<<<[->+>+<<]>[-<+>]<<+[-<<+>>>>+<<]>>[-<<+>>]<<<<[>>[<+>>>+<<-]<[>+<-]<-]>>>>>>>>+<<<<[>>>+<<[->+>[-]<<]>>[->+<]<[-<+>]<-<-]>[-]>>>-]<<<<<<-<++++++++++>[-<-[<+<<]<[+[->+<]<+<<]>>>>>]<<<[<++++++[->++++++++<]>.[-]]++++++[->++++++++<]>.

브레인 플락

({}(())[()])(()){{}((({})({}((({}())))[{}{({})({}[()])}{}]))[({}[{}])])([({}(())[()])]){(({}()({}[(({}[(())]()){(([({}{})]{}))}{})]{}))[({}[{}])])}{}{}}{}{}({}[()])

@WheatWizard의 코드. 허락 해 주셔서 감사합니다!

뇌 유체

({}())(())(())({}){{}({})({}<(({})<({({})({}[()])}{})>())>)([{}]<({})>({}))({}<‌​({}<([({})]){()<({}())>}{}(<()>){({}[()])([{}]())}{}>)>)({}<({})>)({})({})}{}({}[‌​()()]){}

@WheatWizard의 다른 코드.

넘버 왕

8440999999419999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999909999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999997049999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999990999999999917049999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999991907111499999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999900911778700000009999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999994111114999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999090911704999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999190711949999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999991190000911700499999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999911900711114004190009119999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999997140919999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999997199999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999970000000091111400091149999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999990904999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999711700499999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999909171499999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999919071999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999199999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999970499999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999970009999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999997111111999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999199999999990499999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999919999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999994191171494999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999091719117000007111419999994999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999099999999170349999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999997799999949999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999990999999991703

숟가락

00101100010000100010111111001000110000000000000000000000000100000011010001000000101111111111011001101000100000011101000110110110110010000001001010110110011001100101100011010010010010010010010000001000110110110110110010000001010101011011001101000100000011101000110110111001000000110111010010010010101101100110100100010000001101110100100011011011011011001000100100010001110100100101011011000001101100100010101100000110110000011010010010010010010010010101101101101100100010010010101101100100000010101000100000001101101100110100100010000001010110011011001000000111010001101100001100000110100010000000110100100100000011011011011011011011000011111111111101000100000011000001000111011011001101100100100100000010101100110111011011001101001001001001000110110110110010001111111100100000010111111110110011010001010001000000011001111111100100000010111111110110011010001010

메타 합의에 따라 현재 통역사가없는 경우에도이 코드는 문제가되지 않습니다.


4

5 개 언어

()*/12 dlinpqrstu지금까지 및 개행 (18 자) 사용 .

공통 리스프

isqrt

내장 기능.

Q 기본

input q
print int(sqr(q))

파이썬 3

print(int(int(input())**(1/2)))

소수점없이 부동 소수점 나누기에 사용되는 Python 3.

q**/2//1

단항 역전 연산자를 과시하기 위해 불필요하게 골퍼 /. stdin에서 입력을받습니다. 온라인으로 사용해보십시오!

작은 입술

(d sqrt (q((n nsqr input) (i (l input nsqr) (s n 1) (sqrt (s n (s 1 2)) (s 2 (s (s (s 1 n) n) nsqr)) input)))))
(q((input)(sqrt 1 1 input)))

sqrt현재 추측 n, n제곱 및 input숫자 의 인수를 갖는 도우미 함수입니다 . 경우 input보다 적은 nsqr, 우리는 너무 멀리 갔어요 그래서 반환 n마이너스 1; 그렇지 않으면 반복하여 1을 n더하고에 추가 n + n + 1하십시오 nsqr. (수학는 tinylisp 만 감산 내장 때문에 약간 복잡하다.) 제 2 행은 단일 걸리는 우리 실제 함수를 정의 input하고 결과를 반환 sqrtn1부터 시작한다.


추가 {}[] 하려면 Brain-Flak을 추가하십시오. 프로그램은 다음과 같습니다
밀 마법사

3

6 개 언어

사용 retun flosq(agm1)\,i및 확장 코드 포인트 B1BC지금까지 22 바이트.

게임 메이커 언어

return floor(sqrt(argument1))

파이크

,1f

줄리아

isqrt

단풍

(isqrt)

붙어

i\

TI 기본 (16 진수 덤프)

B1 BC 72

0x72는 rASCII로되어 있습니다.


당사 사이트를 사용함과 동시에 당사의 쿠키 정책개인정보 보호정책을 읽고 이해하였음을 인정하는 것으로 간주합니다.
Licensed under cc by-sa 3.0 with attribution required.