«random» 태그된 질문

난수 및 / 또는 출력과 관련된 작업.

25
공장 노동자들
도전 공장 노동자들은 대개 매우 열심히 일하고 있습니다. 그러나 그들의 작업은 이제 일반적으로 기계로 대체되고 있습니다. 숫자를 입력으로받는 프로그램을 작성해야합니다. 10 명의 공장을 10 번 인쇄합니다. 매번 각 근로자는 1/input'해고'되고 기계로 교체 될 수 있습니다. 입력 STDIN 또는 함수 호출에서 오는 정수입니다. 산출 공장의 경우 10 건, 보통은 더 많은 …

28
역 계수 계산
작업: 를 출력 값 x, 여기서 a mod x = b주어진 두 값 a,b. 인수 a그리고 b항상 양의 정수가 될 것입니다 항상 해결책이있는 것은 아닙니다 x 여러 솔루션이 존재하면 그 중 하나 이상을 출력하십시오. 솔루션이없는 경우 솔루션이 존재하지 않음을 표시하거나 표시하지 않습니다. 내장이 허용됩니다 (다른 수학적 접근 방식만큼 재미 있지 …
18 code-golf  math  number-theory  code-golf  number  integer  code-golf  string  code-golf  music  code-golf  arithmetic  array-manipulation  decision-problem  code-golf  math  rational-numbers  code-golf  code-golf  graphical-output  hardware  code-golf  math  number  code-golf  string  parsing  natural-language  code-golf  tips  brain-flak  code-golf  graph-theory  code-golf  number  polynomials  king-of-the-hill  code-golf  ascii-art  kolmogorov-complexity  animation  king-of-the-hill  code-golf  tips  code-golf  ascii-art  code-golf  string  array-manipulation  data-structures  code-golf  math  number  code-golf  string  base-conversion  binary  code-golf  decision-problem  graph-theory  code-golf  math  polynomials  code-golf  kolmogorov-complexity  physics  code-golf  sequence  number-theory  code-golf  math  integer-partitions  code-golf  array-manipulation  random  permutations  code-golf  string  decision-problem 

5
아스키 아 아트 비교 차 경로 생성
2 개 정수 필드의 크기를 나타내는 입력을 감안 x하고 y, 출력 필드 통해 경로. 의 출력 예 5, 4: # # # ### ### # 전체 필드는 5 x 4이며 필드를 가로 지르는 해시 마크로 이루어진 경로가 있습니다. 경로는 항상 왼쪽 상단에서 시작하여 오른쪽 하단으로 이동해야합니다. 프로그램이 실행될 때마다 전체 …

8
직장에서 지뢰 찾기
누구나 Windows XP와 함께 제공되는 오래된 지뢰 찾기 게임을 알고 있습니다. 숫자 (인쇄가 몇 개나 있는지를 나타냄) 또는 광산을 포함하는 9x9 셀로 구성된 간단한 그리드입니다. PRNG를 직접 구현하면 브라우니 포인트가있는 정수 시드 (기계 / 언어의 최대 정수에 관계없이)가 주어진 10 개의 폭탄으로 무작위 9x9 그리드를 생성하는 것이 과제입니다. 출력 예 …

4
압축 요일
요일 목록을 입력하면 목록의 가장 짧은 정렬 된 표현을 출력합니다. 입력 형식은 하나 또는 두 문자 문자열 더 구성된 문자열 Su(일) Mo(월), Tu(등), We, Th, Fr, 및 Sa. 입력이 반드시 정렬 된 순서로 제공 될 필요는 없습니다. 입력을 출력 형식으로 변환하려면 일요일부터 시작하여 요일별로 입력을 정렬하십시오 (예 : ThMoSaSuFrTuWe-> SuMoTuWeThFrSa). …

11
크랩 스 게임 시뮬레이션
크랩은 카지노에서 자주 플레이되는 상당히 간단한 주사위 게임입니다. 당신이 도박꾼이 아니더라도 (나는 아닙니다), 여전히 재미있는 게임입니다. 규칙은 다음과 같습니다. 크랩 스 게임을 시작할 때 소위 라운드 아웃이 있습니다. 플레이어는 두 개의 d6 (6면 주사위)을 굴리고 두 개의 주사위 굴림이 추가됩니다. 결과가 7 또는 11이면 사람이 자동으로 이깁니다 ( 자연이라고합니다 ). …
18 code-golf  game  random 

4
내 D & D 캐릭터의 능력 점수를 구르십시오
던전과 드래곤에서 캐릭터의 가장 중요한 속성 중 일부는 능력 점수입니다. 6 가지 능력에 대해 6 가지 능력 점수가 있습니다. 능력은 힘, 손재주, 헌법, 지능, 지혜 및 카리스마입니다. 캐릭터의 점수를 결정할 때 다음 절차를 사용합니다. 4d6 롤, 순서에 상관없이 가장 낮은 값을 떨어 뜨립니다. 이것이 의미하는 것은 4 면체 주사위 4 …
18 code-golf  game  random 

5
깨진 임의 함수 수정
친구는 컴퓨터에 추가 카드가있어 1에서 5까지의 임의의 숫자를 생성합니다. 불행히도, 그들은 어떻게 든 그것에 콜라를 쏟았고 이제는 1에서 4까지의 모든 숫자에 대해 2를 생성합니다. 운 좋게도 무작위성은 유지되지만 2는 80 %의 확률을 가지며 5는 20 %의 확률을 가지지 않습니다. 1, 3 또는 4가 생성됩니다. 이 임의의 소스를 사용하여 ( BrokenRand()또는 …

15
나는 소스를 곱하고, 아마 (아마) 출력을 곱한다!
직무 작업은 일관성은 있지만 임의의 양의 정수 x엑스x (엄격히 0보다 큰) 를 출력하는 프로그램을 작성하는 것입니다. 다음은 캐치입니다. 소스가 번 반복 될 때 (코드가 에 추가 / 연결됨 ) 프로그램은 확률로 를 출력 할 확률과 변경하지 않고 을 출력 합니다.N엔NN−1엔−1N-11N1엔\dfrac{1}{N}N⋅x엔⋅엑스N\cdot xN−1N엔−1엔\dfrac{N-1}{N}x엑스x 예 초기 소스가 XYZinteger 이라고 가정합니다 3. 그때: 들면 …

5
이 숫자는 무작위입니까?
내가 물었다 random.org를 0과 2 사이 128 임의의 정수에 대한 32 - 난수 생성기 먼저 첫 64 개 자리 숫자를 줄 열심 이었기 때문에 1, 그들은 분명히있어 더 무작위 다른 64보다. 다음 64 개의 정수 중 하나가 입력되면 정확한 결과를 반환하는 전체 프로그램 또는 함수를 작성하십시오. [1386551069, 1721125688, 871749537, 3410748801, …

3
'떨어질 때까지'
Dungeons & Dragons 5th edition (및 대부분의 다른 에디션)에는 Deck of Many Things 라는 마법 아이템이 있습니다 . 카드는 모두 매우 강한 긍정적 또는 부정적 영향을 미치기 때문에 엄청나게 강력한 아이템입니다. 데크를 사용하기 위해 캐릭터는 숫자를 선언 한 다음 그 효과를 순서대로 적용하여 그 수의 카드를 그립니다. 캐릭터가 선언 한 …
17 code-golf  random  game 

2
잃어버린 RNG 만들기
Lost 는 ip의 시작 위치와 방향이 완전히 임의 인 2D 프로그래밍 언어입니다. 이것은 결정론적인 로스트 프로그램을 만들기가 매우 어렵습니다. 그러나 오늘날 우리는 결정 론적 프로그램을 작성하지 않고 RNG를 작성하고 있습니다. 입력을받지 않고 한 자릿수 (0,1,2,3,4,5,6,7,8 또는 9)를 출력하고 모든 자릿수가 출력 될 확률이 같은 Lost 프로그램을 작성하십시오. Lost의 시작 위치와 …
17 code-golf  random  lost 

30
사라지는 요소
문자열 S과 인덱스 목록이 제공 되면의 결과를 새 값으로 사용하면서의 각 인덱스에서 요소를 제거하여 X수정 S하십시오 .SS 예를 들어 given S = 'codegolf'및 X = [1, 4, 4, 0, 2], 0 1 2 3 4 5 6 7 | c o d e g o l f | Remove 1 …
17 code-golf  string  array-manipulation  code-golf  string  ascii-art  code-golf  number  sequence  pi  code-golf  number  array-manipulation  code-golf  string  ascii-art  code-golf  math  number  game  code-golf  math  sequence  polynomials  recursion  code-golf  math  number  sequence  number-theory  code-golf  permutations  balanced-string  code-golf  string  ascii-art  integer  code-golf  decision-problem  hexagonal-grid  code-golf  ascii-art  kolmogorov-complexity  code-golf  number  code-golf  matrix  binary-matrix  code-golf  math  statistics  code-golf  string  polyglot  code-golf  random  lost  code-golf  date  path-finding  code-golf  string  code-golf  math  number  arithmetic  number-theory  code-golf  tetris  binary-matrix  code-golf  array-manipulation  sorting  code-golf  number  code-golf  array-manipulation  rubiks-cube  cubically  code-golf  grid  optimization  code-golf  math  function  code-golf  string  quine  code-golf  ascii-art  grid  code-golf  decision-problem  grid  simulation  code-golf  math  sequence  code-golf  path-finding  code-golf  ascii-art  grid  simulation  code-golf  number  whitespace  code-golf  sequence  code-golf  sequence  code-golf  sequence  integer  code-golf  math  game  code-golf  internet  stack-exchange-api  code-golf  sequence  code-golf  internet  stack-exchange-api  code-golf  math  factoring  code-challenge  sequence  polyglot  rosetta-stone  code-golf  string  browser  code-golf  date  code-golf  base-conversion  code-challenge  cops-and-robbers  hello-world  code-golf  cops-and-robbers  hello-world 

13
역 순열 인덱스
소개 n 개의 요소 를 가진리스트의 사전 식 순열은 0에서 n 까지 번호가 매겨 질 수 있습니다 ! -1. 예를 들어, 3! = 6 순열 (1,2,3)것 (1,2,3), (1,3,2), (2,1,3), (2,3,1), (3,1,2), (3,2,1). 순열이 목록에 적용되면 해당 요소는 순열의 숫자와 동일한 순서로 정렬됩니다. 예를 들어 순열 (2,3,1)을 l = (a,b,c)yields에 적용합니다 …
17 code-golf  combinatorics  permutations  code-golf  image-processing  brainfuck  encode  steganography  code-golf  ascii-art  code-golf  ascii-art  kolmogorov-complexity  code-golf  ascii-art  fibonacci  code-golf  string  code-golf  sorting  popularity-contest  statistics  code-golf  ascii-art  kolmogorov-complexity  code-golf  code-golf  ascii-art  tic-tac-toe  code-golf  string  code-challenge  classification  test-battery  binary-matrix  code-golf  math  arithmetic  code-golf  ascii-art  random  code-golf  string  code-golf  number  binary  bitwise  code-golf  number  arithmetic  code-golf  math  ascii-art  code-golf  string  ascii-art  code-golf  string  ascii-art  code-golf  string  code-golf  counting  code-golf  number  binary  bitwise  decision-problem  code-golf  array-manipulation  code-golf  tips  brain-flak  code-challenge  quine  source-layout  code-generation  code-golf  linear-algebra  matrix  abstract-algebra  binary-matrix  code-golf  string  palindrome  code-golf  puzzle-solver  sudoku  code-golf  ascii-art  code-golf  graphical-output  internet  code-golf  ascii-art  kolmogorov-complexity  code-golf  math  code-golf  clock 

12
샤미르의 비밀 나눔
주어진 n(플레이어 수), t(임계 값) 및 s(비밀) n은 Shamir의 비밀 공유 알고리즘에 의해 생성 된 비밀을 출력합니다 . 알고리즘 이 도전의 목적을 위해, 계산은 GF (251) (크기의 유한 필드 251, 그렇지 않으면 정수 mod 251 로 알려진 ) 에서 수행 될 것이다 . 일반적으로 필드의 크기가보다 큰 소수를 갖도록 선택 …
17 code-golf  number-theory  random  cryptography  polynomials  code-golf  number  code-golf  math  number  sequence  code-golf  quine  code-generation  code-golf  arithmetic  set-theory  code-golf  sequence  code-golf  code-golf  string  math  fastest-code  optimization  code-golf  code-golf  internet  stack-exchange-api  code-golf  array-manipulation  code-golf  string  internet  string  code-challenge  internet  test-battery  code-golf  math  pi  code-golf  arithmetic  primes  code-golf  array-manipulation  code-golf  string  code-golf  string  palindrome  code-golf  sequence  number-theory  fastest-algorithm  code-golf  math  number  base-conversion  code-golf  number-theory  sorting  subsequence  search  code-golf  permutations  code-challenge  popularity-contest  code-generation 

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