受限制的迷你挑战警察的线程


33

强盗的线

作为警察的任务是选择三件事:

  • 一种编程语言

  • OEIS序列

  • 字节集

然后,您将以该语言秘密编写一个程序,该程序仅使用集合中的字节来计算第n个术语序列。您将揭示三段信息,以便强盗可以尝试找出该程序。

答案将根据字节集中的字节数进行评分,得分越高越好。破解的答案的自动评分为0。如果您在一周后未破解答案,则可以显示预期的程序并将答案标记为“安全”。

答案必须能够计算序列b文件中的每个术语,但不需要在之后计算任何术语。

警察和强盗的序列可以为1或0索引。

这是一个Python脚本,用于检查您的代码是否匹配给定的字节集。


1
分数越低越好?或更高?因此,从本质上讲,我们已经试图找到一种受限制的字符集,从而使其他人很难在已经制定出解决方案之后以所选语言编写程序?
BradC

1
我们需要使用集合中的所有字节吗?我想是的,但是可能应该在挑战中指定。
毛茸茸的

1
@Shaggy通常不,您可以包括其他人来获得红色鲱鱼,但强盗可以使用所有东西
Stephen

1
强盗可以使用同一字节两次或更多次吗?
Xcoder先生17年

2
@Azulflame b文件是与每个序列相关联的文件,可以通过将Aa 替换为a b并附加a 来进行访问.txt。例如,oeis.org / b4.txt将访问该序列的b文件。
小麦巫师

Answers:


11

HaskellA209229,(破裂

11个字符(包括换行符):

s<=[ ]
how!

输出True / False作为2的幂的指标函数:

1 => True
2 => True
3 => False
4 => True
5 => False
6 => False
7 => False
8 => True
9 => False
...

输入是正整数。


0代表假吗?
H.PWiz

@ H.PWiz我的代码不适用于0,您的破解可以完成您想要的任何事情。
xnor

破解!非常聪明
〜– Lynn

@Lynn很好!
xnor


5

哈斯克尔,A000045破裂

我下定了决心,我想ts

因此,我们改用这30个字节(包括换行符):

abcdeFgh|jklmnopqrtTuvwxyz
=()

请注意,一般挑战说明要求

答案必须能够计算序列b文件中的每个术语。

在这种情况下,b文件的编号增加到第2000个,这超出了使用可以计算的范围Int


破解
林恩



4

Haskell,A000045破裂

每个人都喜欢斐波那契数字,我喜欢Haskell ...

我已为你精心挑选30个字节:除小写字母fi并且t,你得到的大写字母FT和管道符号|代替,和三个符号=(),和换行符。他们又来了:

abcdeFgh|jklmnopqrsTuvwxyz
=()



4

Haskell,A009056(已破解

另一个简单的字母,现在又有了足够的字母,使其看起来像普通的Haskell,也许您会发现与我完全不同的解决方案,使我感到惊奇。

顺序是 数字> = 3,字符集由以下30个字节组成:

{[abcdefghijklmnopqr uvwxyz]}.

破解有一些不错的技术。我只是在想这个:

head . flip drop [ floor pi .. ]


1
破解
nimi


3

一元A002275,1字节

字节集:

0

我至少必须尝试一下:3

(我认为使用该语言的每个命令都可以看到它不会特别困难)


1
为什么不包括所有字节以最大化您的分数?当包含所有字节没有区别时,您的得分可能最低。
小麦巫师

我以为我们的分数要低(对不起,我是新来的)。
sonar235


@muddyfish是否可以将输入作为字符进行脑力劳动?
sonar235

@ sonar235通常,我们确实允许将输入内容作为操做的角色。尽管由于此处的值超过255,所以我认为使用它们的答案无效。
小麦巫师



3

六角形A057077字节

周期序列 1, 1, -1, -1。作为列表:

a(0) = 1
a(1) = 1
a(2) = -1
a(3) = -1
a(4) = 1
a(5) = 1
a(6) = -1
   ...

字符集(已编辑),其中包括换行符和空格字符:

!%&(),0123456789;?@ ABCDEFGHIJKLMOPQRSTUVWXYZ ^ abcdefghijklmnopqrstuvwxyz []#。 

在线尝试!


出于任何原因,您修改了字符集?

1
@Poke显然,字节数越高越好,因此我只添加了一堆无用的命令。
阿德南

3

Haskell,A000045破裂

它已经破解了,我不会启动一个新版本,但是如果您想玩更多游戏,那就可以了:如果没有y,可能会很有效率。


很抱歉给您指引错误的方向 g。让我们不做同样的事情!

这是剩余的29个字节(包括换行符):

abcdeFh|jklmnopqrtTuvwxyz
=()

同样,请记住,这Int不足以计算所需的第2000个斐波纳契数,因为它在b文件中。



3

哈斯克尔,A000045破裂

有点(如所宣布的)不是新版本,但完全不同。(对?)

我仍然希望我能使您重新发现我的美好发现。

这一次,你被要求实现使用面积为17,其中(据我所知)只包含的字符集Fibonacci序列中的一个 2字符不必要的:

eilnt=(,).[ ]_:0!

请注意,这里没有换行符(但是为了显示可读性,请随意显示一个带有换行符的版本),并且请记住,您必须能够计算第2000个斐波纳契数。



3

Cubix,A000027(SAFE)17点

!&')-/0;@Oiru.NSQ

我的解决方案:

!O!;i)!/u&!!r-)0'u;;!@

在线观看 在这里

我原本没有 .NSQ但是我认为可以安全地添加它们。

说明:

此序列只是“正整数”。但是,Cubix具有三个输入命令,,i它们读入一个char(-1如果输入为空,则推送),,A将其余输入作为char读入(将a推-1送至堆栈的下端),以及I,读入该字符。输入中的下一个数字(0如果没有匹配项,则进行推送)。因此,自然而然,我只提供了i以数字表示的ascii值。哦,哦。另外,它-1是输入结束的常用标记,?因此,我摆脱了?,迫使我使用!(如果TOS不为零,则跳过下一条指令)进行控制。最后,我认为我需要&将数字连接起来以进行打印O (它以数字的形式输出堆栈的顶部),但是我现在意识到这也不是必需的!

挑战的另一部分原本是没有.无操作字符,但是!如果您小心一点,可以使用成对的代替字符:

    ! O
    ! ;
i ) ! / u & ! !
r - ) 0 ' u ; ;
    ! @
    . .

i) :读取输入,递增。

!/ :如果堆栈顶部为零(输入结束),则向左转

左::;O.@弹出堆栈顶部,输出为数字,暂停。

除此以外:

u'0:将char代码推入0栈顶

)-r:增加,减少和旋转

;; :两次弹出堆栈顶部

u& :连接数字

!!:净零效应,现在我们i)又来了。


Cubix有一些noop字符吧?您为什么不添加那些来增加您的分数?还是没有小睡的挑战的一部分。
小麦巫师

@WheatWizard我决定宽容并添加,.但是没有它也可以完成。
朱塞佩

3

种子A005408(奇数)-安全

这是更具挑战性的一个。您可以使用任何在Seed中有效的字符:

[0-9 ]

除非您拥有一台计算机的怪兽,否则您不应该在一周内强行使用它。祝好运!容易破解。

暗示

这是我的解决方案使用的Befunge-98程序:9&2*1-.@(在9可以被删除,但我的解决方案恰好有

8 47142938850356537668025719950342285215695875470457212766920093958965599014291682211474803930206233718243166021324700185443274842742744297183042397910454208210130742260519105651032450664856693714718759816232968955289663444878636053035645231246428917992493766505872029989544065894418166685284738859999912471659057565000392419689361271972485444731284404987238803115210428572945108908191097214978382112218242627719651728712577306652405452922782307249485947045215982784790396555726144526602778473387279897334709142853151393812930171163300904436548870603006549005515709074682843356844201220668045057407146751793470423217099467145255174198241606814578351260769359571053755888106818197239116973006365593563235361647743411341624822052103816968153274122434280200888824954875622811325064255818154979564925710534165572852442761249176778416688044630942040966271963723430245979221181930857841829694362184653939393940015797332978459794253176110314873994228261888801228999293570329618551223457182420746927212801550646743152754821640064626761542582557138452651970009253770914346130172884305622027370793496993281847017017643506435562229916984107083951938286577012273222191422054315198157936674247934699496471202544270325061352014830137178245082445717253260177560449757186762445707057028987371278573629077370632470496186218574320801798046510846708620502139560277546345198686675095078255875594169064796673074708822106659920187882062247609587560174781170641367430722951002242213604709887062481149928551745163110045572994991844223216663621203042075294195007458339984527333125093390189721042315604498435269143549420166732177200370228527273606218617171975362431824163269672003982537382982066136613799403024924018145511099557720492305303748099327810811511080314262364010281851651151072957475365629128068033597559560186625877942054704386175359499573139930378099420149452745731809033737756051947913924265484582800618244473333957173960222243311738522875022546610298627492222587971756897328087719407454153248557203886421828643453889090192355970705084245312184441674098515659253482621260617211786550204852895652236768886852209506535523414991099331857674826373947830587028494510697603296607361093480842935154672353288419699354739650168309017848485131553416956405911683526896232046773861961911767319373432460217755874481607587604361758089936007730253450733375831228127106295259261723611771334468553746160739548375950046831923765023329346333968732796413192682936767133122325481273354810124729664400173367781325488656859581438769940474229394692089519981810909719628263357284973442177568041416363386891516725592952892168077523560584005586276794967492051823290615767599202657060820223928678900774601616908031321346819422162123048834532926372862962159255934240435694566497798544870186550219886342379298214007368081326725550763589917206162393892085506551547475259270513853987294911388226039365971184089828739349642347312302559286882065147953715607221387657413593069535573044067517274676745306396611760657091792151803798859781616126637075577936361782593546481811651450365118155866449850474140044293772144065341051900055416408240857348697564252386403719942197789892382627153382011984996644288495699209129097948405810551134169739499539470610790009272281731894550593600643079188663110695127017324336488487580799309995227054576681630676222848231145106058050452439356753552872060820230589152143268436210090733908507724084889788244157692417246691477400856716677564609725979550100138132944851304473466485128295568194188600539248624248078558656162635444219199062786468487219220160009464328883337821175254405764395407405891483810757405446047244460754827113527540703326714751461178900155717130399854358953609995319006890674085682111514072508440632941090209366005504352890092326935445829213294943731517698438648298921337375443947066950275955144209037675013663600062205168551851984361951824731229113379464426979717688372371011461890139087487634586087688796134318950140718824105959727161482389914414206768064990410615468858520426399188835467970981786227122743162945627167772066100574532803061925537235491026486409948728571706557098859331941260622260924660292578136091523126589085799981416326395824628987154802653126685882440760385315869346960183809644486238810912663304360284449610976505715001267334297285036791711464142665122000857666018757370925847113798258537503747803972255591351740843663253694303946089997282812556281486820325652814785261116697261899511762129550421005941055852897451832731304151488058522478260009347144486599715629242208891126238083949281490804191584238425634093683587199278186505945727829025071885767559828670803412582690901456978557379916793144695491189633486065077294485660840922713748873840986104486221528464294334436081663106336911265802650605150347413103936140565054608396116572669757269475369570465915381045895991937087068526458273755454602799814909213983801968791431574508976448235055061998715636460946550584682626461010298101802277643570201189324102499951196290880892383380284543173390448406975616650185808619832614403133944687275834716343817926764699295672501869876060896683204343897481630037607159476461359111190545646447421653872016775582115425356868533678655969328210255235050133718364831289991244684695035034122861927276046255405376531096051541299607470934463981741370397268760811035606321455156217990078359217247117349544774085111287345436916077577032709684005131011429476229617901273007027774182864475737502587896225475248267937497254066190335088823904767397814233350286976811901982274477445433872253983823904938249655089770642137858608313524715533520654523880832056453080193644871440738737277389718589793074725139142291918837706550037934799585495183374639955887618135803388399608755212147742199481865453122900714456703147150994585431640652462593333773031385396586933380738103697887063571042512186708015948688088011290197524699274772775288900864690592106393483764109837848793374117655194139018455509931621247697015323332300969105814058088442693320033876473960017819576425062784644138417943454576404265382986995583045527928832

您是如何产生的?
Christopher

@ 2EZ4RTZ痛苦,并以Python的源代码为参考。它可能可以打很多球。
TehPers



2

cQuentsA000027破解


 !"#%&'()*+,-./0123456789:;?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~

那就对了!您将获得所有ASCII码!等等...没有$ ...什么$ cQuents又是什么?哦,是的,内置索引。好吧,祝你好运:/

预期解决方案:

#|A:A

在线尝试!



@Adnan是的,我想我应该没有像我那样打开它:PI无法想到任何其他方法来完成它,干得好。添加了预期的解决方案。
斯蒂芬,




2

R, A000290, (cracked)

Byte set:

()%cfinotu

no c, but everything else for function? That's horrifying. I know how to do this except for reading in input...
Giuseppe

@Giuseppe woops, the a shouldve been a c. sorry.
JAD

1
This is what I get for doing this shit manually...
JAD

No worries; this is tough enough!
Giuseppe



2

cQuents, A000217, Cracked

Byteset:

$:=1;
\-

Note that this uses a feature that I haven't pushed the documentation for yet, so I'll push that tonight, if you wait until then. (Or you can slop through my source code... have fun). Documentation pushed. Would be a byte less if a recent bugfix was on TIO.

Intended solution:

=1-1:--\1$ ;$

Try It Online!



2

JavaScript (ES6), 13 10 bytes, A000045, Cracked

This should be easy.

This is the Fibonacci sequence: F(n) = F(n-1) + F(n-2) with F(0) = 0 and F(1) = 1.

Byte set:

$()-:<=>?[]_~

Edit:

It can be even done with the following 10 bytes:

$()-:=>?_~


1
This isn't [code-golf]: "Answers will be scored by the number of bytes in the byte set with score being good." More bytes are better.
LarsW

@LarsW on the other hand, more bytes also makes it easier to crack :)
JAD




2

R, A105311, (cracked)

'%(),:=acdeginpstx

Let's try this without the l or o.

Since this has been cracked, the intended solution:

cat(diag(diag((a=scan()))%x%diag((a==a):a)),sep=''). diag is an interesting function, that can be used in three different ways. When presented with a single integer (diag(n)), it creates a NxN matrix with 1 on the diagonal. When presented with a vector (diag(1:n)), it creates an NxN matrix with the vector on the diagonal. When presented with a matrix (diag(diag(n))), it returns the diagonal as a vector. %x% computed the Kronecker product of two matrices, where each element in matrix 1 is multiplied with each element in matrix 2 separately. Doing this with a length n identity matrix and a 1:n diagonal matrix, creates a length n^2 diagonal matrix with 1:n repeated n times. diag extracts that again, and cat prints.


1
this'll be even more fun :)
Giuseppe

does this include a newline?
Giuseppe

@Giuseppe No newlines
JAD

1
@Giuseppe and I just double double checked, this byteset is correct
JAD

[cracked! ](codegolf.stackexchange.com/a/136457/67312) -- I (incorrectly) used %o% before I realized that %x% existed. I guess I could have done 'i'=='i' for 1 but either way works, so.
Giuseppe
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.