编写Hang子手解算器


28

您需要编写一个Hangman解算器。根据英语单词列表[1]进行测试,解决最多单词数量的求解器获胜,而总不正确猜想的数量成为决胜局。单词列表中的所有单词将以随机顺序进行测试。

[1]:从此处获取此单词列表,然后删除数字,然后删除长度为1或带有非字母字符的单词,然后选择最常见的4096个唯一单词作为此单词列表。

细节:

您的程序将与游戏程序进行交互,该程序将通过stdin为您提供下划线和正确猜出的字母。您的程序将给出您的猜测的标准,并且必须从输入中推断先前的猜测是对还是错。错误6次后,您的程序将丢失。每个游戏结束后(输赢之后),您的程序必须为下一个游戏做好准备。

您的代码长度必须严格小于2048个字节,并且程序不得使用任何外部资源(包括但不限于访问本地存储或Internet上的单词表)。

示例:(输入之前>仅在此处进行澄清-输入中实际上不存在该输入)

>_______         // 7 underscores
a                // Now you wait for input again
>_a___a_
e
>_a___a_         // Implies that your guess is wrong
>_____           // new round, this will be given ONLY IF you already have 6 losses

假设您有6次错误,您将收到一个最终输入,表示您的猜测是错误的,并且您的程序必须准备好开始新的回合(即再次输入)。

如果赢了

>_angman
h
>hangman
>_____           // new round

在知道您已经赢了之后(因为输入没有下划线),您必须准备好接受下一轮。

程序在收到输入时必须终止END

如果您的程序不是确定性的(取决于随机性,伪随机性,系统时间,环境温度,我的情绪等),则必须在提交的内容中明确说明,并且您的分数将被取10次(由我获得,除非另有指示)和平均。

注意:如果您使用python之类的语言,请在每个print语句后显式刷新标准输出。

游戏程序如下(记入nneonneo):

import sys, random, subprocess

proc = subprocess.Popen(sys.argv[1:], stdin=subprocess.PIPE, stdout=subprocess.PIPE)
def p(x):
    proc.stdin.write(x+'\n')
    proc.stdin.flush()

wordlist=[]
f=open('wordlist.txt', 'r')
for i in f:
    wordlist.append(i[:-1] if i[-1]=='\n' else i)
# wordlist=[i[:-1] for i in f]
random.shuffle(wordlist)

score=0
totalerr=0

for s in wordlist:
    s2=[]
    for i in s:
        s2.append('_')
    err=0
    p(''.join(s2))
    while err<6 and '_' in s2:
        c=proc.stdout.readline().strip()
        nomatch=True
        for i in range(0, len(s)):
            if s[i]==c:
                s2[i]=c
                nomatch=False
        if nomatch:
            err+=1
            totalerr+=1
        p(''.join(s2))
    if err<6:
        score+=1
p('END')
sys.stderr.write('score is '+str(score)+', totalerr is '+str(totalerr)+'\n')

用法: python ./game.py [yoursolverprogram]

例: python ./game.py ruby ./solver.rb

这应该像旧的计分程序一样工作,但是不依赖于命名管道,因此它可以在其他平台上工作。如果您对旧版本感兴趣,请参考修订历史。


您将拥有哪些运行时环境?我可以使用node.js吗?
aebabis 2014年

如果提交失败的单词没有猜到任何字母,并且下一个单词的长度相同,那么将无法仅从输入中确定已经经过了六个猜测。因此,提交必须将猜测数存储为状态。
laindir 2014年

1
“如果您的程序不确定(取决于随机性,伪随机性,系统时间,环境温度,我的情绪等),则必须在提交的内容中明确说明,您的分数将获得10倍(由我获得,除非另有指示) )并取平均值。” 您自己的测试程序不是确定性的,因此,我认为像这样对所有提交的内容进行下去只是公平的吗?
Martin Ender 2014年

1
@ace如果我的提交内容记得已使用过哪些单词,则不会。;)我想这属于“您的程序取决于伪随机性”类别……尽管它是测试程序中的伪随机性。:D
Martin Ender

2
@ace:我可以建议使用subprocess而不是外部fifo来驱动游戏吗?这样,代码将可用于其他操作系统(例如,Windows上的Cygwin)。这里的game.py修改,以使用subprocess来启动名为在命令行程序:gist.github.com/nneonneo/d173f8888e1ea0c6fe37。使用它python game.py <program> [args],例如python game.py python hangman.py
nneonneo 2014年

Answers:


1

Python 2,得分= 2111

用运行python -u。(对于使用给定控制器进行的测试python ./game.py python -u ./solver.py。)这是2044个代码字节+ 1表示-u= 2045字节。

I=raw_input
a=I()
while'^'<a:
 c=g=''
 while len(set(g)-set(a))<6and'_'in a:
	m=1879
	while c in g:c='eunotitihencatpangnaottoesthesdoeitmbolocepnngcbelympvhanlrarnnccinatceaesdabceatelittlvuumineiltlatrnrttnomnnlnaildplttryliaxgtssclhemngfrssioninssenryinoeovortpcntapeetedlrruitardooiitacteutrsotdsoanedytsacnstshesmoeloluaiaceaceuhlortnegveprreanslrraneioeitslincssdsisuosycmieiebrinncrueoinytnabatepcciamenitnisecgaannehiphanotntnorvrvpcaddcdiittdnnieirsytescdeaaorfrerroleomdaeripmaandrgndipaimesctrsliavnopstmhiagamnimnlaaieceotlarscnbvnssvtaslplpisoiicinynriilirelaiohllvlndohenossvildgerltgterisahcreridsctnedainmteooeelnppeiemitceciyndetgfltrtsnatlrasrnsreiueletunsttainrctreydcpmiieecpedarulcaosoiulinrtpinoopptcpuarnioredabtilsnleoonslmltircninloaludrltrviocsatcgratduioeietnseaidltmmryalaaaorbctaglnlatatiosnloettuongaetlndesicircelunoeaofaciunhcdnnteeadtaadteairceneangugipadcrhaetftoloilisesaeaishtcinemcoleiibloyuoeiupovgtrccttsuttialnnnncatbamtrrndtperieonsavseoalncrrvvmctdmornstsunilnrscariranagloeoeciteptiplctpmadtnertslioractotlairneutorccaocletedoaammiiaurcadgdsmtmooaefmhedetvoelmoaemoaacoeieneislsaccllsunacnnspaomtdpnioocposrocniciicounnatosuvrsrodreacloapcansrsnrohlnotpiiptdneauaaatorofaatsnigiioegloreraiipaitnsssrststetomtoneifencntopxmstsruiosgopanriapiapelteeeelraaeeeipavauptneaalinnrlgipgoteienenrnfdmorouslpcaprmaeusnnnclltpcasrsitiuaictigsarsdenteetrtelnrecurupmautosotrssnisrdsnnulisrgomnpeatyotioipetalyanluatsoteoytirsmssyeatpryrtfclfnttniscloeuiaerasniracntfglaylurotngoaesuetillrrldnranosteldmpooonticteaprdcdmoecaafnftaivsmtrtlrpigcrnodueusmyepeotpnotltalgtltlvyhspphrtaliemyrtehrrdeiesoiiteptsptintnypmoinspsgiocacurarpruiardmnmrpgtpnoimtlsonpacrsnenpcinantayvryumpncyaelnrtrsisrdmnspgmarlttttptitsmeipuaervntgcunnncrtrnnitbltarssmaircptrenrerrerpceoiedchecefbrttutbumnbsnoeitaenutetreccosttofcdtgslgeaoacmicuiotelornahmticcsrdswaoignancoelrrsarnrnrrptiyadetilcricnasnoasenpstasiopdtnossrccllsoelirtfarrioemaeosioaeorcaesfnfsthklcsrdhlwakl'[int(a.replace('_','1'),36)%m];m-=6
	print c;g+=c;a=I()
 a=I()

结果

score is 2111, totalerr is 20751

怎么运行的

该程序将当前状态下的所有_s 替换为1s,将结果视为以36为底的整数,并将其取模1879,从而为我们提供了一个粗略的哈希函数。它通过将此哈希值索引到长字母字符串中来选择要猜测的字母。如果之前已经猜过该字母,则将模数降低6(因此始终保持相对质数为36),并选择一个不同的字母,重复进行直到找到尚未猜测的字母。

我将这种策略设计为具有许多可调整的变量(长字符串的各个字母),其中大多数将独立地影响最终分数。这使其非常适合爬坡样式优化-我使用了多样化后期验收搜索

Python 2,得分= 2854

通过大量使用不可打印字节和内置压缩,我们可以获取更多信息。

使用解码xxd -r,然后使用运行python -u。(对于使用给定控制器进行测试python ./game.py python -u ./solver.py。)这是2047个代码字节+1(表示-u= 2048字节)。

00000000: efbb bf49 3d72 6177 5f69 6e70 7574 0a61  ...I=raw_input.a
00000010: 3d49 2829 0a77 6869 6c65 275e 273c 613a  =I().while'^'<a:
00000020: 0a20 633d 673d 2727 0a20 7768 696c 6520  . c=g=''. while 
00000030: 6c65 6e28 7365 7428 6729 2d73 6574 2861  len(set(g)-set(a
00000040: 2929 3c36 616e 6427 5f27 696e 2061 3a0a  ))<6and'_'in a:.
00000050: 096d 3d33 3433 310a 0977 6869 6c65 2063  .m=3431..while c
00000060: 2069 6e20 673a 633d 2727 2778 da05 c101   in g:c='''x....
00000070: 62a8 3808 04d0 b322 1923 bf04 b230 b1f5  b.8....".#...0..
00000080: f6fb 1e42 6c73 475a e2e1 277d 3d19 d0c1  ...BlsGZ..'}=...
00000090: 5f9e d177 4f21 50d6 67ab 49b2 9ce1 09cb  _..wO!P.g.I.....
000000a0: b4ca 793e ab4a 49a6 c567 e530 b9bf 41a9  ..y>.JI..g.0..A.
000000b0: 61b1 4dcc 77a1 7a3a c5a8 cb6a 3008 5958  a.M.w.z:...j0.YX
000000c0: fc15 ff50 d515 e0b3 326f 44d7 aecf 32fb  ...P....2oD...2.
000000d0: 4050 03b0 3302 5e1c f038 1ea2 bf04 19f6  @P..3.^..8......
000000e0: a847 1a8a 2571 47a3 0c68 a6c6 4b5c 72ed  .G..%qG..h..K\r.
000000f0: e463 a51a 509b aae2 bd85 dc96 5ca7 dbb0  .c..P.......\...
00000100: a5af bddc 6b77 f9ef 020c 86c1 8bba 2734  ....kw........'4
00000110: 4cb6 20bb e2b6 68af ba5d 5d4a 44ce 73a7  L. ...h..]]JD.s.
00000120: 5c72 4ad8 1d3a 0eed ea63 9629 9c56 518f  \rJ..:...c.).VQ.
00000130: e51b 32fa 2f4f da18 3592 de3c 335d edae  ..2./O..5..<3]..
00000140: 1f1f cd86 bedb cb3b 44c5 cf91 8047 d8b4  .......;D....G..
00000150: 33c2 aeff eea6 3184 5332 09bb a051 1191  3.....1.S2...Q..
00000160: 18dc f1dc a3a5 4220 36d7 c95c 7bb4 fc2d  ......B 6..\{..-
00000170: a518 9d56 937d bb35 b962 2e6d bdb6 dc07  ...V.}.5.b.m....
00000180: 5b10 ca25 275b 2523 d57c 1363 5ad7 f9ca  [..%'[%#.|.cZ...
00000190: 249e 8ea2 83c6 6af4 3de3 1fea 15ba ec1d  $.....j.=.......
000001a0: e70c 96b8 38d8 b225 62a4 63d0 fa2e 5c72  ....8..%b.c...\r
000001b0: 6057 ecf8 3db2 9f7d 185c 72ee 8e5a e519  `W..=..}.\r..Z..
000001c0: 02db bfbb c25a c738 d2b6 b454 8d56 5ab6  .....Z.8...T.VZ.
000001d0: 11ae 27cc e476 81e8 2321 9135 c833 3a4b  ..'..v..#!.5.3:K
000001e0: 8a89 919e 26e8 3623 e44d aaec 59db 6f6e  ....&.6#.M..Y.on
000001f0: 79da 3941 29e8 d274 7eb6 0aac 3249 8b1b  y.9A)..t~...2I..
00000200: b25d 1ff1 c496 f75c d125 e2aa f3b4 21a0  .].....\.%....!.
00000210: 7a55 d31d 4939 8433 ea97 f927 f9f3 0954  zU..I9.3...'...T
00000220: a861 2baa 7568 e1ce d489 f59d 1365 a69e  .a+.uh.......e..
00000230: fc22 bef1 a0cc 7dfc a320 7ad5 fa39 3f5d  ."....}.. z..9?]
00000240: 16b0 58b0 253c c54b f4d8 5729 cfb6 2371  ..X.%<.K..W)..#q
00000250: c328 c5ab 1315 fcc2 27ad 8462 b5d5 d6f8  .(......'..b....
00000260: 76aa fb12 c775 1733 24df 98f9 dd86 cbbe  v....u.3$.......
00000270: 0c6e eb38 695f 705b 062d e231 3812 bdc4  .n.8i_p[.-.18...
00000280: 4664 ae0e 30a9 2cfb 3cf2 84dc 806e eb86  Fd..0.,.<....n..
00000290: 7988 d147 1bc9 f7b3 ad1f 1914 2d97 99c2  y..G........-...
000002a0: d096 711b 4f24 74d3 ebd9 8d11 7a4a 6518  ..q.O$t.....zJe.
000002b0: e25a 9c0c 79b2 661c 8188 6a88 7315 ed7e  .Z..y.f...j.s..~
000002c0: b7ce 6d18 b06a 34d0 0a89 de1c 0509 65b4  ..m..j4.......e.
000002d0: ae5d 303d d2f2 7e98 cf07 ebb6 a4c0 e311  .]0=..~.........
000002e0: 13c4 1133 9b69 ecb6 9da7 75c8 1806 c136  ...3.i....u....6
000002f0: 2531 acbe aaa1 9353 fa13 ff28 fa62 999b  %1.....S...(.b..
00000300: b59f f13d 47ca a7f5 e706 06f1 9374 78b1  ...=G........tx.
00000310: 649a ea19 a156 efe0 084a b06b 31c0 d86d  d....V...J.k1..m
00000320: c913 a3d4 dbb0 6248 851f 688f 11fb cd91  ......bH..h.....
00000330: f339 9fb9 c9fe 0ecc acfc 6eeb 1544 6469  .9........n..Ddi
00000340: 223c 5d5e 14bd caaf f3ca fc4c 6cc4 b2a2  "<]^.......Ll...
00000350: ade5 5656 df3f 7046 c9ab cd63 3c5a caf3  ..VV.?pF...c<Z..
00000360: eec4 23ce aeb0 5aa8 7273 c1a7 d5b3 627a  ..#...Z.rs....bz
00000370: 4b5b ec3b 7f87 48cb 5740 51d8 79aa f4cd  K[.;..H.W@Q.y...
00000380: 5315 f53b ed89 2d7f 5736 d4f4 12e1 f1a0  S..;..-.W6......
00000390: 7d5b f45b 8323 4bd8 37fb 173e ed3e e85d  }[.[.#K.7..>.>.]
000003a0: 7f82 e83d de15 2925 cbb4 702f 04c4 b8f0  ...=..)%..p/....
000003b0: 4998 b5f4 7ad3 b8f3 9ad3 5008 1722 c7ee  I...z.....P.."..
000003c0: ca10 40f2 3fb1 8f2b 2262 f70e 8358 c2ac  ..@.?..+"b...X..
000003d0: 0b78 4ca2 163b 2f74 3c02 df67 a4eb f9f9  .xL..;/t<..g....
000003e0: 799c b5c4 14b6 d672 54d5 37c3 6a7d 1675  y......rT.7.j}.u
000003f0: f219 bd6e ee58 eda8 3af1 6989 c8c9 f1a8  ...n.X..:.i.....
00000400: eeeb dcfa bed7 eef5 4ea7 50ff bde8 92f8  ........N.P.....
00000410: 6648 2980 ebf9 7645 84d9 0ef5 1192 c672  fH)...vE.......r
00000420: 254f e460 8da5 79d6 0fbc 2138 1edf b1ad  %O.`..y...!8....
00000430: 355a 98ab 548b db38 43ef 12db ef01 b93c  5Z..T..8C......<
00000440: 933a cbf1 44e6 2b85 f22c f6db e922 e1e3  .:..D.+..,..."..
00000450: 113e 803f 562c 83df 898c 3dca 86fc c809  .>.?V,....=.....
00000460: c09d 8585 87b0 4a78 8908 fc4f e0f3 4731  ......Jx...O..G1
00000470: 671f c4de 53f3 a85f 8954 fed5 ee2c 99c4  g...S.._.T...,..
00000480: f091 6feb 5307 4f70 7df4 2620 d7d9 dca4  ..o.S.Op}.& ....
00000490: 4644 a948 4016 44bc 80df 7d6f c686 6499  FD.H@.D...}o..d.
000004a0: a4bc 75d0 2506 bf1d 2747 6b54 95be cfb1  ..u.%...'GkT....
000004b0: 7b4b d70a 89b0 ac68 e2c4 1394 ba20 4d01  {K.....h..... M.
000004c0: 204c 64f3 721f 2a53 862d 89f5 59df b273   Ld.r.*S.-..Y..s
000004d0: 7c32 470f 7055 ef6e 2167 d4dd f546 9c0e  |2G.pU.n!g...F..
000004e0: 9eda bf3a 78ce d946 28b5 2c8d f79f 7c31  ...:x..F(.,...|1
000004f0: f940 d75d 8940 aca2 f6af f538 1eaf 6ef7  .@.].@.....8..n.
00000500: c81d 56c5 955c 0506 7474 fa7d 4627 b6fe  ..V..\..tt.}F'..
00000510: 4aa9 9abd 825d 166f 852c 8a4b b87e 727f  J....].o.,.K.~r.
00000520: 43c6 d657 eeb5 46cb 449b ce1b cc11 a25c  C..W..F.D......\
00000530: 72b1 8ccd 7feb ac50 8c21 a75c 30cb a3a7  r......P.!.\0...
00000540: ebc3 326c 0a9e 8b3a 513e 560b 2c31 cb61  ..2l...:Q>V.,1.a
00000550: c6bc 6748 90e1 6e3c ae15 8e37 9264 f73f  ..gH..n<...7.d.?
00000560: 696b 3c62 47a8 f091 82a7 0f4e 2f7d 1343  ik<bG......N/}.C
00000570: d202 b436 3e36 7825 7fc7 8b0b 2543 cdff  ...6>6x%....%C..
00000580: 2a33 08af e34a 652e d547 d87d 0c4f b6d8  *3...Je..G.}.O..
00000590: 5105 ad4b 47e9 31ad 2bec 98f0 d6aa 487d  Q..KG.1.+.....H}
000005a0: d26b 33fa 651c 67b7 f189 7c01 cf87 24ee  .k3.e.g...|...$.
000005b0: f2d5 3634 49f3 6aad 898c 914f e6fe 202d  ..64I.j....O.. -
000005c0: 8f18 2e3b a1dc fe8c 624c 3d66 27ca 54da  ...;....bL=f'.T.
000005d0: 1183 c790 96fa f357 bee8 6171 d69e 451d  .......W..aq..E.
000005e0: 5aad 5bd5 681a 0cc1 b6ce c3d4 82d9 d7a6  Z.[.h...........
000005f0: e269 4bac bbff c406 7388 85d6 6dda f2c4  .iK.....s...m...
00000600: 0f75 e17c dd1d acfd 6086 904c c59c 935b  .u.|....`..L...[
00000610: 0a8f cef8 c935 51ad d44a d9b2 aa0b e01c  .....5Q..J......
00000620: 3ff9 bb87 3190 b4cc 2fed 4bd1 58a1 f06b  ?...1.../.K.X..k
00000630: ee44 1a6c 435d ae3a e7ef a501 a30e 6def  .D.lC].:......m.
00000640: 21ea 3b89 32e1 631b 53f8 c14a f636 51f9  !.;.2.c.S..J.6Q.
00000650: d662 ef32 b386 ed27 6b87 5b5e 8f5b 9776  .b.2...'k.[^.[.v
00000660: dfe0 e83d 1f29 fbf2 dc5b b843 60bf cbc8  ...=.)...[.C`...
00000670: aa9a 9ad2 f94e 2ea9 96b0 296c 937e 65a3  .....N....)l.~e.
00000680: eafd a4d0 85b5 9f4a c671 7ece 5811 c7b7  .......J.q~.X...
00000690: d3c6 75e0 70b3 224d c9aa d8f1 fb6e f4ea  ..u.p."M.....n..
000006a0: 1d7a cef7 5fc7 5a98 7fd5 28b5 753f 7c43  .z.._.Z...(.u?|C
000006b0: da79 9d90 1a51 33ae ca7a d5ea a990 fed3  .y...Q3..z......
000006c0: 5ff5 2975 7b99 8333 44c2 a7fa 17a3 875d  _.)u{..3D......]
000006d0: 70ef 2361 6d5a 1cc8 13a7 d482 30c6 2b84  p.#amZ......0.+.
000006e0: 4d4a a765 c81b 2e16 3e62 08d8 ce5a 2beb  MJ.e....>b...Z+.
000006f0: a823 42ef 633f 7858 cdaa 755c 3097 f029  .#B.c?xX..u\0..)
00000700: 2afa 06d8 47c0 2714 f3fa 1554 d8a5 1a8b  *...G.'....T....
00000710: 77ac b319 ac47 9b5e 5ba7 a5ae 7dc7 c86f  w....G.^[...}..o
00000720: e73b 2a62 7a3e 7b29 6583 b227 0417 bb6e  .;*bz>{)e..'...n
00000730: 98ef 9097 6f9b c655 8f20 32ce a60e 6556  ....o..U. 2...eV
00000740: ce62 c8c9 afab c30e 6908 5675 19c6 5019  .b......i.Vu..P.
00000750: 62dd 131b 9c2d 3968 3f42 5b96 e7c9 1e23  b....-9h?B[....#
00000760: f1b0 0280 9ce9 f9cc 92ec 7eb5 a7c6 9619  ..........~.....
00000770: 5aab b832 b7cf 865c 72f1 9454 e33a 9975  Z..2...\r..T.:.u
00000780: 5b8a d8e8 5f46 0a22 2397 7d77 f70a 33b7  [..._F."#.}w..3.
00000790: 5183 5d5e 7267 54c5 a204 1e2f 470a dad2  Q.]^rgT..../G...
000007a0: a554 e493 7f06 7ff9 5fdd dfff 8428 a74f  .T......_....(.O
000007b0: 2727 272e 6465 636f 6465 2827 7a69 7027  '''.decode('zip'
000007c0: 295b 696e 7428 612e 7265 706c 6163 6528  )[int(a.replace(
000007d0: 275f 272c 2731 2729 2c33 3629 256d 5d3b  '_','1'),36)%m];
000007e0: 6d2d 3d36 0a09 7072 696e 7420 633b 672b  m-=6..print c;g+
000007f0: 3d63 3b61 3d49 2829 0a20 613d 4928 29    =c;a=I(). a=I()

结果

score is 2854, totalerr is 19482

9

Python:2006个字节,得分= 1501

1885字节,分数= 1337

1961字节,得分= 1207

这是我的意见书:

import sys
b='eJwdVQuW4ygMvJdyGgwYtAGJQQKHOf2Wp9/rJqGxVaqP+HxUMlGx5F86/XoqsUuonzAz5cf5vqjJ6OlQudxOJR3ibJ8cwuSmsTX12daVht8ubj15miaEH/GrESXrQrXbl1K0m2hs6dRjMkp1PuS2/9JoVslkLmp2L6J6f5kij4s0nkSPni/5GZtixSuKcKd7lYvsfi7yNYxseKXqV6fURkc//KXe+P6Hc071xuZteixiSRtzMnavwNfqcydqSzb+9hMTlW/UQSNe5uRx1EVp1OhA7gXb0v+i0rKN1rYsGlWBufozlFbzP+i2KXCpNKNjfTwkytcBnv+OgoV6blJ/8NDjF6iqUd2ojqcbrScmIaurHJxs6yHjck96brZJwncsIOHhzwyemZurKFrkmpIX9yXSNGsKdF+F+rF2fam0+KAMj3YdoXFJR+nY7AL4y1jaopNuBhk6sl03pSd7x2IxoyeLO6dGedjp9V0inusji0EAyR4pBttN6dt+UR/SYBHCVwuxPZSvqNYpZhPIWXM3Segs30IFXKZKSzqDkcdORud59xVJ8o4WsJQelUqXnIAjV/2whDybo1mDmhYCeAjZV4552gSWOa5aSG3WZ0SaqZVe4Y+o7R+Ps5knum0pDGNxrKA3De3Lwo/si420aemw2g/tdq5sKN1HyltpLNeY/qPUYwsLatc/pwRq5eSwK4l5LhHEnSIZhhG9xsFqeqDMRctmTnVQRoamwUtloiLNrgV+a0uzHBKAyUYl61yD+m++GkgeW1eiuMDEoCR6504z32V9JHD25tPVHFyXOGOc+A2vABogIw9vfxWBatuHwaWggEELdS+8De8z7ZHhir70cLoQpYYDOgfMw+ASbrhnbrwQ27x4TNt/3qHBEPSmwzlagqlH5J4Bk2FBqEvc9fXORUnnnceiMAc2kALwNdOB4W87eAw2uAwsIncpu+IYutsJwsJ/JfusCZNipqyL8uwjNHuDN3MJQBSg/Sr1ppByfD9RWaAt/QhLGDDv2C1PxSvBbfyEFqNO5ZwZpE2yqd2PjEwueV1aJoBdGxNjSl8klx3nuWAAxgCxKePt0bykLrCcQWspM61K3qcNuJYa53VMBWKNJCsrYkzZGfZf49fotx3ZYURvyYQ+GR6iOVCfT6fB4hkehfOws/k3PjFo82ZgaE60TxccO4DqKEKDVXSsuknSmuzZwB8C+h7YBS3oaRPSyGvurfnNvM2bMustIxXMYsM/WdvAvLn8hIx5CMCJQxEM2P2yLuyWYHvZziC+T8IWooeMVWDnvoF6wcETdOUVYBFcFdCop/CJ07RpwyjNy1kslHYwdfNxGYGtX4lWduETDAFIeLJntoAk/sjHlLI5tIwp6mcLF5gxJOR2eugsO5/fey0EhMb72J+mrwyB3rkw2eT0cCPuAOUc5cw/b7mQi8942Eaig4nkYUE9xi3D+FTVRxd80XLL9MXhgISod0JBHxjPPCNirRsh/0TgWdrB/6u01zHbvUnBDc4yhknZxCXgrgSWdv8h1oQR3q8hjdbbE5zK6e4U9nhNkHxCwjCdN26sS9+BIMPe7+EDExPGccPLQYvC8+SY1ioz3AxVUWfdJi3RNjjEMyiWq31CjITE1cQPTO5En39bkFEzri7c2f8Dkow6qw=='.decode('base64').decode('zlib').split(';')
R=raw_input
def G(c):print c;sys.stdout.flush()
def P(w):
 if'END'==w:exit()
 d=b[len(w)].split(':');l=len(d[0]);p=f=0
 while p<l:
  G(d[0][p]);x=R();r=w==x;w=x;f+=r;p+=p+1+r
  if'_'not in x:return
 for c in d[p-l+1]+'zq':
  G(c);x=R();r=w==x;w=x;f+=r
  if'_'not in x or f>5:break
while 1:P(R())

分数输出:

score is 1501, totalerr is 21608

该程序是完全确定性的。巨型斑点(是zlib压缩数据的基数为64的编码块)是决策树的列表(每个字长一棵树)。每个决策树对一个深度在2到5之间的完整二叉树进行编码。每个内部节点都是单个字符,并且根据该字符在the子手单词中是否存在来进行决策。

二叉树的每个叶节点包含特定于树搜索的该分支的优化频率表。该表经过专门优化,以支持某些单词的完成,同时完全忽略其他单词(由于有限的“失败”预算而无法到达)。该表并未进行优化以最大程度地减少错误,因此尽管(相对)不错的评分,该程序的totalr计数仍然很高。

未显示的优化器使用不确定性非线性优化器,该优化器利用随机梯度下降策略来生成频率表。


5
1337是一个不错的成绩。保持在那里!= p
justhalf 2014年

如果您想打高尔夫球,range(4)可以用代替,[1]*4前提是您实际上不需要使用的值i
2014年

@ace:谢谢。我忘了你可以那样做。(无论如何,我只是重写了该循环以获取最新的分数改进,所以整个过程现在都消失了……)
nneonneo 2014年

@justhalf:我也喜欢那个分数,但是我想继续提高这个分数。有这么多地方可以覆盖...
nneonneo 2014年

1
顺便说一句,您可以使用decode('zip')而不是decode('zlib')
2014年

5

红宝石

用户PragTob和我本人的联合提交。

MAX_TURNS = 6

frequencies = {?t=>[3,48,145,214,252,266,249,223,191,142,63,44,16,1,0,1],?h=>[2,14,81,125,85,91,60,42,30,14,11,6,1,1],?e=>[5,49,260,316,456,408,328,279,202,125,50,32,12,0,0,1],?a=>[4,60,211,259,249,266,253,192,152,111,51,42,15,1,0,1],?n=>[4,30,120,136,214,252,238,214,189,128,59,45,16,0,0,1],?d=>[1,25,100,104,131,123,131,81,63,36,14,15,7,1],?f=>[2,13,51,58,64,67,41,40,28,18,11,9,3,1],?o=>[9,44,150,165,195,220,214,168,155,104,46,37,14,1,0,1],?r=>[1,25,140,246,312,310,263,206,150,95,45,32,11,1],?y=>[3,29,41,58,86,94,83,63,52,31,21,12,2],?u=>[2,23,67,117,126,154,107,97,85,48,27,16,2,0,0,1],?b=>[2,22,53,60,72,59,41,30,36,16,7,6,1],?i=>[3,38,143,179,223,299,270,241,205,134,64,44,16,1,0,1],?s=>[3,23,129,176,195,208,177,136,117,71,44,23,13,1],?c=>[0,12,68,122,146,194,180,163,130,85,49,25,7,0,0,1],?l=>[0,18,153,172,190,196,164,131,125,67,35,20,5,0,0,1],?g=>[1,19,42,75,82,104,78,60,39,30,12,10,0,1],?w=>[1,21,56,56,40,41,18,16,6,2,1,0,0,1],?m=>[2,10,77,68,119,94,104,76,68,45,15,17,8,0,0,1],?p=>[1,24,82,84,94,129,105,88,99,56,24,11,7],?k=>[1,6,65,37,28,24,6,10,3,4],?j=>[0,5,5,6,7,6,5,6,2,0,1,1],?x=>[0,6,4,7,15,22,13,16,9,9,2,2],?v=>[0,3,21,39,47,58,63,42,40,23,10,9,2],?z=>[0,0,3,3,3,5,2,3,0,0,1],?q=>[0,0,1,9,5,13,8,3,5,4,3,2]}

while !(input=gets.chomp)['END']
  current_turns = MAX_TURNS
  won = false
  chars = frequencies.keys.sort_by {|c|
    -(frequencies[c][input.length-2] || 0)
  }
  i=0
  while (current_turns > 0) && !won
    c=chars[i]
    i += 1
    puts c
    $stdout.flush
    old_input     = input
    input         = gets.chomp

    if input == old_input
      current_turns -= 1
    # else
    #   frequencies[c][input.length-2] -= 1
    end
    won = !input[?_]
  end
end

结果:

score is 625, totalerr is 23196

它有1672个字符,尚未打高尔夫球,因此我们有足够的空间来改进算法。

首先,我们存储按单词长度分组的字符频率(从单词列表中计算得出)的哈希值。

然后,在每一轮中,我们只需按照当前长度的频率对所有字符进行排序,然后尝试从最常见的字符到最不常见的字符。使用这种方法,显然每个单词即使只有一个中等的共同特征也会失败。


我相信这接近最佳解决方案。
justhalf 2014年

@justhalf太多了,以获得最佳解决方案...;)
Martin Ender

@ m.buettner +1 <填充文本>
user80551

score is 625, totalerr is 23196您的更新算法是否仍是最新的?我想类似的一个,我只拿到了最大300
justhalf

1
@nneonneo如果您指的是justhalf的初始评论……那是该答案的早期(无效)版本,得分约为3950。–
Martin Ender

5

更新 使用类似于@nneonneo的方法,我到达了这段代码,恰好2047个字符

得分:

得分987,总计21964

码:

import sys,re
R=raw_input
F=';;;topenayr;elsatrodin;eatslroncih;eastrinclodu;etnocsiralupd;enostciarldpmu;eitnoasrclupmdy;einocstarlpumdyg;itacslnorepumdgyv;intaoslecrupymdgfh;nitaoerclsmudpygfvh;itneaorscmpdlfuvybh;ratdgfihosw;;ceimontalu'.split(';')
G=[''.join('.'*int(c)if i%2 else c for i,c in enumerate(re.split(r'(\d+)',w)))if w else''for w in 'eJwdlA2S4yoMhK+0CpPJ28ppQPxuQFBITMq3f52JXY5TdpC69TXP50ziQ6RWKxV3stBw+XEtIXXvx4u+g5I5e1x0V+fGN236S/b0aU+7UjMNFoyOvVc8hSInersrxBWr0BUqNSchUXT835YlWCyUTtW9Q6PL1UfhRtmVR3gm72dvu/Vts3c+sqPFoSaWbUWqqi9dylLXe65MWM12/CEdkcLX6LVXU7HBuQXSqDyMKTOjgX40Dty966CXY66Q2H/r7b3b7qat2zF8NLbWZ1QpTLvXWN+1NancuPdoE8sXNi1DqrtssxY+7RzRdxUWa5FLDVPzJJnWpTZW4xN4Uay1BFvUIxNKtz2le7/N47Bt3XedKjyttQgl/dhlcfvNZaNkFN8OnsrULiPQGqeeOsZRPZVl+sXsT61413rvqr751pbIBR/CSyWWs+JLrl66li+lM1j2JVDQowzxlUeo451DGDXOnDlD5Dw+7jcrnC855BmvCr8jGpzsa1P/E0VeWqKGwWGtEKVNiodj/4mTRXtgUDQChs4k7UWZ/py7ldsbv5WZ44ugjdj735MDzpFDffPgtQruJdO6vT7rVwYMQa+dCc7xCgVyJ57+65bH6yxj43/D7cxl3vaPAS/YEGfzo/Ess2iINV5To1/5VbMqrXMsV7ZYZJU1KPAZH4rrUNA/pK8MjlCcYAipoCYryaesw1wbD6SFb2+n7YfOZ6xexOb0RZv34Kprn743BtGwYsnZXbadfX3Yw8jAFGtbYGxxc1p08LF4bbbDdYdsvA7wyPUVm3GD70u9t9I9q8oAMUPbaVdV/oXKNwNUIkCCTDyAnd46e21yAyJQFFRn35+G5i97rXeZwuW+tcPYa0VesXNAXzguNviOKGEyEbYjkT56VehF14eRgNYHSjePNnl3L3CAJsMDhNhP072ng0sRvk0Gq0LeMHqRvRUj3/xQNwt3cyBiaEH0we28VZ4LMIse/O34T32sybiAlf1sCXHEzgUNU3wiqOt74zXdqc/pOpXC1UIffoyNUCAjiyfjFb8fehue6hbaPKjXgI4RwIVgBAmXeiC5J5ihGFZKnGAFxLF/WmpxJ6HPtuXTdM1D8m3iWfKPSQFKQPEdmSL/+WA7vItr9JuMKGWsi/7kTrzGLXDoPzvy/jjxq4gMi0E+87xnz7SS+p08EXbM7h32M5QOxRNk3py6TdrHd0kftelzravf4MDBcrCGWvJu4toejG9Ok75SffANw9hp3/6Osegr6L1hfx4YRXoCVUrkXbwFecx74on+P/VTUoewuekqaRrP5/N/1MpqAw=='.decode('base64').decode('zlib').split(';')]
while 1:
 w=R();i=0
 if'END'==w:break
 f=0;l=len(w);g=set()
 if G[l]:
  while i<len(G[l]):
   c=G[l][i];print c;sys.stdout.flush();g.add(c);x=R();i=2*i+2-(w==x);f+=w==x;w=x
   if'_'not in x or f>5:i=0;break
 if i>=len(G[l]):
  for c in F[l]:
   if c in g:continue
   print c;sys.stdout.flush();x=R();f+=w==x;w=x
   if'_'not in x or f>5:break


旧条目

结果:

得分是656,总计22962

这不是平均值,因为该算法是确定性的,即,对于任何混排的单词列表,它总是给出相同的分数。

这是我在Python 2.7中的条目;打高尔夫球(717个字符)

import sys
class S():
 def __init__(s):
  s.l=6
  s.g=set()
  s.p=''
F=[0,0,'onastifeybhmudgkprw','topenayridsubwglfhcmkxjv','elsatrodinphmcukwbfgyvjxzq','eatslroncihudpgmfbywvkqxjz','eastrinclodumphygbfvwkxjqz','etnocsiralupdmgyhfbvwkxqjz','enostciarldpmuygvhfbwxqkjz','eitnoasrclupmdyghfvbwxkjqz','einocstarlpumdygvbhfxwqkj','itacslnorepumdgyvfbhxkqw','intaoslecrupymdgfhvbqxjwz','nitaoerclsmudpygfvhbqxj','itneaorscmpdlfuvybh','ratdgfihosw',0,'ceimontalu']
s=S()
while 1:
 c=raw_input()
 if c=='END':sys.exit()
 if '_' not in c:s=S();continue
 if c==s.p:s.l-=1
 if s.l==0:s=S();continue
 s.p=c
 for x in F[len(s.p)]:
  if x not in s.g:
   s.g.add(x)
   print x
   try:
    sys.stdout.flush()
   finally:
    break

这使用了与@ m.buettner类似的思想,即存储字母的有序列表,然后进行猜测。但是,这并不直接使用频率数据,它只是尝试几乎所有可能的字母排列并模拟游戏,最后采用给出最佳分数的排列。

此版本使用前9个字母进行了优化,因此对于2个字母和3个字母的单词,在已经忽略了来自先前输入信息的算法类别中,排列已经是最佳选择。我目前仍在运行前10个字母的代码,优化4个字母的单词(并为较长的单词找到更好的解决方案)。


输入无效

对于我的基准测试,下面是使用完整决策树11092个字符的代码。

得分:

得分是2813,总计是17539

码:

import sys,re
R=raw_input
F=';;;topenayri;elsatrodin;eatslroncih;eastrinclodu;etnocsiralupd;enostciarldpmu;eitnoasrclupmdy;einocstarlpumdyg;itacslnorepumdgyv;intaoslecrupymdgfh;nitaoerclsmudpygfvh;itneaorscmpdlfuvybh;ratdgfihosw;;ceimontalu'.split(';')
G=[''.join('.'*int(c)if i%2 else c for i,c in enumerate(re.split(r'(\d+)',w)))if w else''for w in 'eJw1momWqyyzhm8pgENc/9UoNGILSoto3Fd/nsq3zt49pBNlKKreAfzf//afbZycWkJQs6l+U8n4/smbKubuV9VNRZ3m7B/VFmNSpw41qPN/48+xn8/PcpbpnE5Vzzu7Oitnf9RtnsllFzb1TEEtZpt+lDP2fWx5o7FpjiqYe1rUY0I/20V5M/eT6r0956LmPKvJ+N+oNhP72Qd+f/pf1cZpYmihT6r1pg3RqWS9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U8uPwMzys/SW3/ZnV81PgGXxIcfPoQd4RjVTaRd5Sgs/+9MOoj+KHr4Phkbt985j8KZUPIYGo00cuGjWFW7J3Pc9jgfDCDAmT/1QBqg7eOfoT0LCLaF331q9sGu9RB63Jfvo8pCIjvOPiz85uWgvW5petswfSZdTmkCmzMjy2k896v5AG11fOSO7GRfuVP/9QoqxzAJ/Txk62UJ5Gu5gaqYbJKn8t0HZBGmLQcCiD0ygUqpsTejs+9Ik4ZtBy3FtQ7X1KrZSf32UXX/YED7spT7sqX7Abaenrd/bHysnFVIaJDF5oI0kePlJHUKgF4g+0L8O2XwMrTzmCqFl9xN/jqaRh2ddK1kJ0Pv4Y99DewyNPKN0RPyIgMp/G2z9IKfWiuV+/ve///0fiWqMOQ=='.decode('base64').decode('zlib').split(';')]
while 1:
 w=R();i=0
 if'END'==w:break
 f=0;l=len(w);g=set()
 if G[l]:
  while i<len(G[l]):
   c=G[l][i];print c;sys.stdout.flush();g.add(c);x=R();i=2*i+2-(w==x);f+=w==x;w=x
   if'_'not in x or f>5:i=0;break
 if i>=len(G[l]):
  for c in F[l]:
   if c in g:continue
   print c;sys.stdout.flush();x=R();f+=w==x;w=x
   if'_'not in x or f>5:break

2
我将您的代码压缩到527个字节,而功能没有更改:gist.github.com/nneonneo/c9f3ef399f0c588634d7
nneonneo 2014年

5

Perl,1461个字节,得分= 1412,总计= 21050

$|++;
while(!eof) {
  $l = $pg = '';
  %d = "[eaitrnoslcdupmhygfbvwkxjqz]<[scpardetmfbilwhognuvjkyqz]a[tlrncsidbpgmyuvkfwxzhoj]b[leoairusytjvmb]c[oetahiulrkcysq]d[eiaourlyvdgsmfwjnhqt]e[rnaslcdtmxevpfgqiwyobhkzju]f[ieoauflrty]g[erhiaunolygsmtdb]h[eaoituyrnldmbcw]i[notsclvdagrmefbpzxkuq]j[uoea]k[einaslywftogd]l[eyialoutdfvskcmpbwnr]m[eaipombuysnftl]n[tgedcsaionvufkylmhjqwxp]o[nrumlstwpocvdgfbaikyexjh]p[reoaliptuhsymdbfw]q[u]r[eaiotymdsruncgvklpbfwh]s[teisuhpoacmlykwfqndbr]t[iearhoyultcmwnsfbpg]u[rnstliceampbgdfyok]v[eiaoyu]w[aiehonrlsdtkfy]x[pctiaehuy]y[esomatpcwbildgrn]z[eoaiy]"
    =~ /(.?)\[(.*?)\]/g;
  %r = ">[etynrldgshmkpcwfoabxui]a[retclmnphisfvwbudgoxykjz]b[aiumoerylbhgspt]c[ienaouscrxtlyh]d[neairoludhsywgpk]e[rtldsvcmnphgefibkuwyzjox]f[eifnoalrustdmkwp]g[niaeroudgykt]h[tcsgwpenrxado]i[trsldnacmfhvpugwbekoxyz]j[nbdeao]k[carnosilewu]l[aeliobpuctfsrdgnwhkym]m[oeiarumstdynlghbp]n[oieaurngwkhtmsldy]o[icrplthmsfnobdwvgejyuzak]p[msaoepuixrlynt]q[eisncd]r[eaotpuigcrbdfhwlys]s[iesaunorbydclptmkgw]t[ansicreuolthpfxbygkwmd]u[ostcqlrfdbpagnmjhixev]v[ieoanrdlb]w[oaesrtydnlkph]x[eiaon]y[ltradcnsheomfbgpkuvzxw]z[iae]"
    =~ /(.?)\[(.*?)\]/g;
  while (<>) {
    chomp; last if !/_/ or /^END$/;
    $l++ unless /$pg/;
    last if $l>5;
    s/$pg//g for values %d, values %r;
    $_ = "<$_>";
    my %s;
    while (/([^_]?)_/g) {
      $x = $d{$1} || $d{''};
      $s = 180;
      for (split //, $x ){ $s{$_} += $s; $s -= 100 / length $x }
    }
    while (/_([^_])/g) {
      $x = $r{$1} || $d{''};
      $s = 180;
      for (split //, $x ) { $s{$_} += $s; $s -= 100 / length $x }
    }
    ($pg) = sort { $s{$b} <=> $s{$a} } a..z;
    print $pg, $/
  }
}

(请注意,删除了大量可选的空白后,它是1461字节。打印时,它重了一百左右,但仍低于2000。)

我尝试了一堆更多的“微妙”方法,但是最终击败了他们。这两个数据字符串只是最有可能紧随每个字符的字符的排序列表,以及最有可能紧随每个字符的字符的排序列表(单词列表中根本没有出现的二字图根本没有表示出来)。<>用于表示单词的开头和结尾。作为示例,"w[aiehonrlsdtkfy]"意味着“ wa”比“ wi”更普遍,比“ wi”更普遍,等等%d。正向映射包括存储为的全局排名$d{''}。它用于连续有两个未知数的地方,或单词表中的所有二字都用尽的地方(因此我们必须处理非单词表中的单词)。

对于单词中的每个未知位置,它会查看前一个字符,并为每个可能的后一个字符提供一个分数,排在首位的分数从180开始,到列表末尾减小到80;然后对以下字符执行相同的操作。将所有角色的所有得分相加,然后选择得分最高的得分。

猜出一个字母后,会将其直接从排名表中删除,因此无法再次猜测(直到我们开始一个新单词并重新初始化表)。

更新:通过修复一个错误(我们没有从反向表中删除字母)并更改积分在列表中的下降方式获得了很多积分。


1
很好地使用图。这样利用位置信息的方式我的解决方案就不会...如果我尝试结合使用这些方法,就不会介意吗?
nneonneo 2014年

@nneonneo玩得开心:)
霍布斯

3

Python:2046字节,得分= 1365

得分是1365,总数是21343

import sys
from math import factorial as f
z=lambda r,x:f(r+x)/f(r)/f(x)
d='eJxtVouWwygI/dYEV03rg5Fg63z9Apo+ZtczZ5JU5HG5gP+0cyvHlhjORrI6lQpnZoq0Z8o46GO5\noJ/YE8XwpBw6UXGEcLPdM2MacpBzO8kVcr1TSttJxx5/Rg/u7h5EDJlI/jgBiRkCO1sDuWUETVci\nxkxM+junUWBQF+OeSgxUxg+B+ExnbB2hgJxp8cR5fA/dT6U7q7+Ovhf8/ahIEWrGQyR3+3X8ORKY\nnvI48vw88jClT4IDh+fh4mMQ2Nn8cWyfxpkmspj73EXYD9sfxzkwP6GKYP7ya3lQ5ZgsD30lIM6n\nZKZPkYqQzyV9bkeGgbGKeMyfUcxj96UUHOoP/IwrngrDIHtswBqFQ+YTDpftHeshJKkggNNWXd7U\nU5yw4me818L5KDjD/Lv8jyC6XldyulpFzvswm4T6faiQy0K6JmTKRyEYgZ7hrWm+VjezxuH1tcPK\nBLA8sNq7f/mHXkV4NDfeFG/0Fgp3PZErqM4s+WEXKb+ZhBQ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EH2TqSdcq0yHWuxSpiakW5J6UJB2OJro3\nvULus01HDncbYPWRYORC/wJ6k9G1\n'.decode('base64').decode('zip')
D=len(d)
R=raw_input
def G(c):print c;sys.stdout.flush()
def P(w):
 if'END'==w:exit()
 i,l,X=0,'e',6
 r=x=''
 while 1:
  if l not in r+x:
   G(l);w=R()
   if l in w:r+=l
   else:x+=l;X-=1
  if not(X and'_'in w):return
  if l in w:j=1
  else:j=z(12-len(r),X)
  i=(i+j)%D;l=d[i]
while 1:P(R())

许多代码都是从nneonneo的python提交中借用(没有它,我不会在2048字节的限制下得到它)。本来我以为这应该多获得200分,但是我发现数据字符串创建工具中有一个错误。现在已经确定,我的得分是更合理的1365。

与创建基于长度的二叉树不同,我创建了一个二叉树来保存频率信息。这棵树不是统一的深度,因为没有任何点可以存储比六个不正确的猜测还要深的频率信息(但是对于“相当”和“不舒服”,正确的猜测在理论上可以是十二个深度)。通过阶乘代码(实际上是使用组合功能)来导航这种笨拙的树。为了使数据字符串更具可压缩性,我用's'填充了所有未使用的索引。

我使用一个脚本来计算要存储为d的好的字符串,如果有人可以从脚本的其余部分中找出更多的字符,那么这里有一些替换应该可以得到更好的成绩。第一行是上面程序中编码的字符串。

score | length of encoded string | actual string
1365  | 1646                     | ertanialuctrssssvsnoctmushsbmsmpyssssssssssssdgyssspvlshgxsmgvssndspcjssssstmplyushumrtsdnsdvvsllatsibhqyvgdkdwssucmssmssulcsmusscsssssogsdssssssspsssstlsupmsusgsdsulyncysvyssfsnhgsnyqscalusthrvpcncpssrhtpsssspsbgvfsssssobuysssdssssssssssssssscsssssssssssscsssopshcompidssbsssssysssssssssssssssgusxsssimssssssimydssssxscipyfuydhwyscbssssmsssssssssssbssdsssusssssvspmvmssssspcbissssbyitypmxcossdmcssssssssssssyssssssosvssssfcvsssssdghsssssdsmpvysssssopcmtysssssstaimcyphocvshmsysssssssssshssssskssssssocdphsssuxhssssssiocyfsssswacubsssdpuutcidmsssdppoitanoclussaodmacssspdssssspmssssssssssssssssssspssssssnpbissssssssssssssssssssfqssgssssssfdssssssvbssspumbydmsssspbsssigsssdmgysrsdvminscygsxgssssssssssgsssssodbsssssugssssodbssbcssmsssscumsspomssssfssssssssppfssbcuyrdympysssssssrsssssfsssssgkmsssmocugssmcosudhsmdssssssssspsgopssssspssfblsbvssssssynsouqssfgusssvnisssjfpysfssssmdfssssrslujsuucpombssssnsicussssopssscssmossbsdsssssssssssspssssmdsfssssssssssssfsgdhwdssssdlyssksssssysgsssssogsusssssmfssusslsuufcpyssssvyssssscyodsssmsspusssssdpssssusslubuysuumppwsssgssgidsssssdoussssssssssssspdssssozsssssdssdrscmcdomsssgospdiwudspmidsygfcsulcuysssfssssusssssshucssssschgfcsssschbmsssskuosinpmchvmpgmssssssrmucpslfpcrsssssssssssvoyssscssssscopslsspgcdflssssssrucmfgssslcpruysclysssblsgsssssscilugsdslsssvssssssupvlysssssssssssssosssscssssslgsssssdcvysssspndcssssmcsssssssssssssssssssslsssssrugssssssucnmsssscncigdpslmgshhosssssossssszrypboybsyfssmdssssssgihbudsospdcusmosmoindflyybvmfcsshrsghfowsdphossspscssssssgsssssscgssssscfmspmbhoyuhssuplsbhsssvnitocnusmdcucfmjssspssssssssssssomvsshsssssspssssssssssssssussssrgssssssolmfbsydmssssdsssssrdpsjdssssssssssssssssplasssmyssssssdsssssamlssssfssssssssssssssmpdmsssflsssssdslpyhgsrdssssssshssdlshpssssfsrsssssshrsxssssmlavssdlsnpruupysdprdliypoxmybssssssssxpmsssssssssssshguslsyssslrpflsssdbmsrcdspvsssypsamssmhsblssfssdbssssmsssssfdasssalpmsssamsshglysusssshglyspdsssunalcosydslkulbpofmdssxssssgsgufsssssdyssssdssssusmysspmdssvmsssssivsssssmpohsssshgopsssssinocdusyspvssssvssssssssssrgyssspmsvlmsrvssscfulyusdfssssssssssssssssssrpssspssrgoyssssgmhssssssssssssvssssssupssssqbvysssussysssapsuoscpmhssssssssssssdsrsssxssssssalbhmssdmsssssscmphssslfgrmchdgvdsosucdssfwsacdhsmpvvmsssssssssssplslssshrlhssmssvlbyssshdrgwkmssqcoglurspvlgcllascyphoudsrpusylfgsssspblyssssssbssssssomsslussrmvlussssfycossssssosphyssrscgshpragcscbchoralpbyssbsvdyssssssuxlssdlsssssssssssssssssssssdsssussmbdsssssamhssssssssssssssdsssssssdpssssssssssfsgsssssdlussslsusopxasmdspmssscpovdussvyslssmssussssssdmssssuspdlsssmftdglasssmalatmlocwvhpmgzssssussssssnyshsmlsunvsvlysstcnssssssssssssssspsssussssssdoyssssssfysssssshgpssssssdbunckgsssthylssycsubdssssssndsvsssssslyssugssssowssjuspxgusssshowcnuysloncsupdgfdsslsstacnslusfghwdlsbnsssspsussbyscsubssssslcghslsvddsmhssssjulynbyssssphugkousssowlcymns
1381  | 1662                     | ertaniocvsplttushtpyutsudwbvumgdlatcpisppmgdsyusuqphplgpmypppplppppppuhslypppppppyvpppppsulcspommdbpppppppppppppppppppppnjpppppsgppppydncmpppppfsnhgpmuqycalinscyvpcncpppppspppppppppppppppppppposbpgpppisbhpmpgxyppppppodbdppppupppppvfpppppmulympppbusoybppfscipypslhppodbpdppppppffpppppppopfppppuppppypppmppppppppcbipppppyityfcvppppdmcpppppppppuvppppppppxbppppppocmxppldgmpyppppsmpobuppppopcmtypgpppstaimcyphpchmvxpppppplppppphpgpppkppppppocdphpppuxhpppppgiophyppppwacubpsdvmuutcivappubppoitanocluspaddmacopfpdgpppplvmpppppppppppppppppppuypppplpppppppgupppppppppppppbfqppsgpppppugpppppppvbbcpdmppppcumppbgpppppppppppprpppppmpppyppppppppppppppppppppppppppygnpppppppppppppppppppvpsfplmpyppppppppppppppbrpppxrdyppppppppppppppppppppppppppppppvyupsmpppppppppppppppcyppppcuypppppppsbpumpppspppfpsuqpgkmpponmocucuddpppcfujppmdcmcoprslujpuuppppppppbgppupppppppppppnupppfblsonppppppnsicupphbmdppppppppppppppfppppwdppppdlyppkppppppppppyppdspupdpppmfpbvpplsuppppyppgpppppogppghpppdspppuppgohdpspsdhpslubyppcumpppugppypppppufcpppvypppppyodpppppwppppppgidpppppdroupppppppppppppppppgozpppygdpppppcmcdompspfospdiwpuupmidpcppgfcpppppppppppgupppppucuhpppplchdigprmhchbmppcruuosinpmchvmpgmppdppppppppplppppplflpppppprucmfgppplcpruypbdspocgdpppppppppppppppkppblplfocdpppgxpppyppppppppppogppppcvpppplyupvlysgypppppcilybppplpcppppplgpppppdcvypppppndcrugomcpppppppppppppppppppslmphsoocdmsopppucnrypboxncigdpplmgppppppppouppppmzppppppvppppomybsdpuvgirsghfowpdcuppdppvindflyppvmfchbugdppfpcfoypgppoyuhsphopscxppppmpgoncusmpsspmbhppsupsuplbhppppvnitoclaspdcucyffqpppppppuppppppprjdpppppppomvppppppppdppppprdpppppppphsppppppmuppbpppppmyppuppsdpgsppfppolmfbppddmpppppppppmpppvppflsupppxpruyppppppppppppppppppppppppppmppppppspppppppuslpppdmlrshyppypppppmppppyhppppspafspppchpppppumpppppppmpppppppslpybpdlycsrcupsducymliypuyvybppppppppppppnpppmppdppmppppudnyoxmpmhglyppppuahglyfdapppunalcosyddlkulpuppmdpusppppvpppppppppppppppppppppbpofpppgufpppppppppppppppppppphpppppyppmdpmvpppppppsdypppsppdpprvpsvgrdgysgmrpppmpmppppxmpohpppphgopppqupinocdushppvscfurgoyfvlmfppppppmpgsppppyppppppmpxdpppbusmyppmsyypppppposcpmhsppppppppplypprpppvpppadppppppppdmppppppcmphhupgfgrmchppsalosucddpfwschdswppppxppppppddvgppluvmppprdgacdlpprvgxlfpprgwkpppphgglursplubcllascyphohmdfylppgfpcosulxpgplgpppbpbhmlvumppppvbrmyppufpyrypdpppppdosphyppgppfshpragcpvmchoralpbyppbpvdyppdplupppppmpppppdfpppppplpbypmppppppmbdpppppppppppppppppppppuppppplappppvllyppppamhspppppppppppppppppspplpppppsppppppfsgpppppdlupmppppsospxappppxuuppppppmmftpvplppppuvyppppumqppppmcpovudppddglanyppppatmlocsvotcnspppppxmgzpppppdlpppppplgpyvmwgpppbfyppphpphpgpppunpdbusvlypppthuglypncfbsppgpppwspuppppppdoypppppppppppfudppwgsdjupppcnuyppppsyupdfnpsoumytacnslupgghwdlpvlpsdpppppyoypppppxpppppphowlppypsoncvboculynbcsubpphuglcghpppplcymnpppdjdvalutcrspgppknmcpypowodppppguppppppbchgxpsysppoctmduppppsmpnryppppkppsyrhppppupprtsdnsuqlwp
1382  | 1796                     | ertaniocvsluuuuuluouuuuflbvuuuurucmfguuulcpruyubuuuuuudsuuuuupgohcuuuygnuuuuuuuuuuuuuuuuuuuuuuuuuuuuouuuuuuuuuuuuuuuuuuuuyuuuuuybuuuuudmuuuuuuuuuuuuuouuuuusmuuuuuruguuuuosuuuuudmuuuuuuuuuuuusbpumuuusohuuupmrypblouoyfuuucnuuuuucfuuouupcnmoulonbuvuuuuuuybsduuusprsghuuuvqhopsuuuuuusonpuufownsicuudhbluvbuuuuuoyhuuuuuysfyuuuumpconcusmlxfmumcuuuuuuuuuuduuumuuuuuuuuuuuuuupuguuuuuoguuuuguuulrvmuuuuuuuuuuuuujvyuuduycyordpumuuuuguuuuuuuuuuuububuuusguuupwsduuuugidvbuuudouuuusdvmuugumyuuuuuufluuuuuopruyuuucdomuuuguspdiwuuupmiduumuuuuuusuuuuuuuusllpuuulrshcuuuuchidguuuuchbmuuuuuuosinpmchvmpgmuuuuuupydcumuuuslpybuugfvsrcdbuuccymcdyuuuuuuuuucgduuuuuuuuuuuuumpvuubluudncduuunhglyuguuuuhglyryguuuunalcosydulyupvuuumduuuuuuuuuuvuguuuuupvuuuuudcvkmuuupndcuuuumcuuduuuhmuuuulmpyuuduluuuuxucpmuuuuvucnmucyuxncimoculmgdurdgyuurpuuuufbuuuuugdpuuuumduuguzpgihbudvufpdcuuuurgoindflgkuvmfcpyuuuuuuuuuyuuymuuuucubvyuugsusyuuugsuuoscpmspmhbuuufusuplbhuuruvnitoclaumdcudmfuuuupcmphudugfgrmchuuuduosucduyfwschdswuuuuuuuuuspuuuuuulufcuuvrgdhuuuuprvuuuuuurgwkuuuuhgglurspyxpcllascyphoudsrpguusyguuuuuuuhguuuuubsuuuuupduuuuufmryuuuuuurypdulcuduosphypmuudfshprgfuucychoralpbyuuspadvyuuuuuuyuuuuubuuuumuuuuuuuuufsuuuuuuuuuuuuuuuuuuuukuuyuulfoyuuuuuuuuuuuuumuuuucmpuuucopuuuupgcuuuuuuuuauuuufdausuualpmuulduuuuusguuuuuuciluguuuluuuuuuuuxuumftuuuuuuuuuyuuuugsuuuuuuuuuuuuuuduuunusmyuupunvtymuyutcnsuuuuuuuumdsuuusvguuuusgmhuuymxuuuufyuuuuuuhpguuuuuqdbunckvlmuthugscfulfbsdfucpuwsuuuuuuuuuuyulyuuuuuuuuuuuuhwguuuuuuucnuyuuovuuupdfnuupluutacnsluuushwdaduuuuuuuluuuuyuuuuuuuhuuuuuxuuuuuualbhmuudvlynbuuuuuuhuguyuuuuudlcymnuvmuuuualcautlrsxgxnmcpyuhsuuuuuomduuuudsuuuuulhuuysuualvbyfughcossulquvdyluntryuuuufurtsdbfluuuomutsdyuxuuuvcyyrhtmuluguytnguuuuuuuuuuuuuuuuuuuushuuuudhpuuuufuuuuuuuuuuuuuuuuuuuumudluumbdupsluuuuliypoxmybuuuuuuuuuplauuuuvluuuuuuamhsuuuuuuuuuuuuuuuuuuuuluvuuuuuuuuuufsguuuuudluuuuuuusopxadbpuluuuuuuuuuuuuuuulubpofuuugufudmuuuuuupdluuuualdglahuuuhoatmlovavopmgzsdypuuuuuuuuuuuuuuuuuuuuuuuuuuivuuuuumpohuuuuhgopcuuuuinocdusyupvuuuucwhuuuguuuuuuuuuuuuuuuuuuuuuuuuuuufuduuuusdjuuuuuuuuuuuuuuuuspuuuuuuuucopuuuuguuuuuuulpsuuuuupypuuuuuuuuuuuuuuuuuuupsuuuuubocsuuuucsubuuuuulcghuyuuddvghuuuuuuuuuuuuuuuuuuklfuuuuowoduuuugusuuuubbchgxmpvuupoctmpuuuuusmpkuuuuuuuuuuuuuuuuusduuuuuusqulyuuusuquvuuuhltmpyuuuydtsubqlyuugdlatisbhdpmgdsuyuuuuuuuuuuuuuuuuuuuuudflyuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuslpbvfuuuuyuuuuuuuuuuuvuuuguvluudoupspumcopduuuuuuuuuuuuuuuuuuuumuuuydusuvydcuxpuuucoguuuuuuuumuuuuumuuuuulumquuuhgcpovdxyuuuuuubsouyuuuuscipyfuuvguuuuuuusuuuuuuuuuuuuubuuuuumuuuuuuuupmuuuuuuupcbhluuuuyityfcvuuuudmcuuuuuuuuuuusvluuuuuxbdoyuupocmxuuudghuuuuuusmpobuuvuuopcmsyuuuuustaimcythmlhmvuuuuuuuuuuuuuhuupuukuuuuuuocdphuuuuxhuuuuonuidouuuuuwacubuuupjgitcivauuudppoitanoclusuaddmacoufpduuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuusofquuuuuucvsyuuuuuuuuuuuuuuuuumyuuuupbspduuuhwkuuuurupcpmuuuusmvuuuuuuuuuuuuuuuuuuuujuuuuuysuuuuuususmcuuvuulcssfuucuuuuuuuuuuuuuuuubpuuudrdyuuuusguruuuuncyuhuuufsnhguuqyucalinscyvpcncvluuugpuuuupuumuuuuuuuuuuuuucugusuufuusuquuufguuuuodbuujfuuufuuuodmdfuuuurslujuuupbuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuopfuuuuuuuuumduuuuuuuuuuuuuufuuuuwduuuudlyuukuuuuuuuuuuuuvuuuuuuuuumfuuuuulsuuuupyumpyuuuuuuuuuuuuuuuuupuuuuuudpsuuuuuslubyuuuumpuuuuuuuuuuuguuuuuuuuuuuuuuuuuuuuuuuuuugouuuuuuuudruuuuuuuuuuuuuuuupubcuuumcygfcuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuugfcuuuuuuuuuuuuuuuuuuouuuuuuuduuuuuurmucpupupcrupuuuuuuuuu
1388  | 1800                     | ertanioclcpruyuuuuuuuuuuuuuuuuouugohucmfguuulbvuuuuuuygnuuuuuuuuuuduouuuuuuuuuuuuuuuuuuuuyuuuuuybuuuuvsuuuuuuuuuuuuuuouuubusmuuuuurugupmuoduuuuuuuuuuuuuuuuuuuuhsouuuusouuuuuurpsumbuuyfuuuuuuuuuuuuuuonuuuusvuuuuuycfuuuucybsonuduhrsghobdvqhodmouuyuuvuuuuufwduuupslhsonpuuuuunscifyohbuvsyfuuubuuooncusmpuuumucuuuuuuuuuuuuuuuuuuuuuuuulxuuuuuuunuuuuuuuuuuumudrjduuyoduuuuuuhouuuuupombugrduplvuyuufuuogiuuuuuubuuumumyuuuuusduuugufuuuuuupwuuuubugidsguumpuuuuufluuuvbuprdmuuuusdvmuxgduuuuuuucdomuuuuyspdiospupmimdusluuuuulrshyzuuuuucuuguuhucuuuuuchlpuuucuchbmuumuuuosinpmchvmpgslpybuumuusrcduuugchmcdbuucumuumuuuupyducvuuufluucgduuuuuudnyuuuuuhglybluuuuhglyrupvuuunalcosydulkuluuuhcduuulmupvlyuuuuuuuuuuuuuuuuuucuuuuulguuuupdcvyuuuupndcuuuumcuvyuuuxuuuupmuuuuuuulucyuuuccuyuurvucmnrdgyxncigdpfumguugkmuuuumocuguzduuuupvuuuuumrpuuuuugirhbududpdcufbluuuindflyuuvmfcoyuuuuuduuuuuumpyuuucuuoscpgsuuuuuugsuuuuuumspmbmhuufusuplbhudmuvnitoclaumdcucgrmchupfhuosucduufwschdswuuumpduuuuurgduuuluuuuudgrdhuuuuprvuuuusurgwkspuuhuglurspgyucllascyphoudsrpuuuuuguuuuuuuuvuuuusbuuuhguomuxufcurmyuuuuuurypduuuuudosphypduuufshpragcycycporalpbyuubgvdyuuuudsuuufsspamuuubuuumuuuuuuuuuuufuuyhuuuuuuuuuuuuuuuuuuuuuukuuuuuuuyuuuuuuuuuuuuvuuuuulfoyuuumpuuuuuuuuuuuuucsuuuucuaopuupxauuuualpmuuufduuuuuuuuuuuuugcumftusguuuuuuciluguuuluuuuuuuuuyuugsxunyuuuuuuunvtyuuuutcnsuupmdsuduuuuuuuuuuusmyuumuuyuusvgufyusgmhuhpmxuuuuudbunckguuuthuglquyufbsvlmuuuwsscfulyuydfuuuuuuuuuuuuuuuuuwguuuuuuucnuyuuuuuuupdfnuuuluutacnsluuughwdluuuuuuuuuuuuvypamovuuuuuuuuuuuuuuusmhduuuuulyhouuualbhuguxuuunbulcymnuuusyumalutcrsuuuvmnmcpyuacdlhsuxgxuuuudvguuuugvysuuuuulnrgsuulvonhcumdyflssyrhcosulubrtsdnquuuwlputsdyuuuyuucyyrhtmuuuuxuunguuuuuuuuuuguuuuuuuuuuuuuuuuuuuuuuuuuuuuuuduuuuuuuuuuuuuuuuuhpuuuuuuuumuuuuuumbduuuuuuuuudluuuuuupsluuuuliypoxmybvluuuuuuamhsuuuuuuuuuuuuuuuuuuuuluuuuulmfbuuufsguuvuudluuuuuuusopxauupuldbuuuusuuuuuuuuluuuuuuuuuuuudmuuubpopdlugufaldglafdmualatmlocwvhpmgzuyuuuuuuvushuuhusdypuuufgyuupuuuuuuuuuuuuuuuuuivuuuuumpohuuuuhgopuuuuuinocdusyupvuuuuuuuuuuuuuuuufduuuuguuuuuusdjuuuuuuuuuuuuuuuuuuuuuuuuuucopuuusguuuuuuulpsuuuuupyuupuuuuuuuuuuuuupuuuyuuuuuubocsuuuucpsuuuuuulcghuuuusdvguuuuuuuuuuuuuuuuuuukowduuuowuuuuuugulfuuuubchgxuuuuupoctmuduuuusmpksuuuuubuuuuuuuuuuupuuuuuusqulyuuusuquuuuuhltmpyuuuydtsulpmuuugdlatisbhddkgdsypblvmpuuuuuuuuuuuuuuuuuuuluuuuupmuuuuudflyuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuvfuuuuuuuuuuuuuuuuuuuuguuuuudouuuuumcopduuuuuuuuspuuuuuuuuuuuuuuyduuuuudcuuumuucogusuvyuuuxpuuuuuuuuuuuuuumuuhuumuuuxylumquubsocpovduscipyfuuvguuuuuuyuuuuuuuuuuuuuubusuuuuuuuuuuuupmuuuuumupcbiuuuuuyityfcvuuuhdmcuusvlyuuuuuuuuuuuuuxbuuuuupocmuuuudghdoyuuusmpobuuuuuopcmtyuuuuustaimcyphshhmvuuusoumyuuulyhuuvuukuuulyuocdphuuhuxhuuupxuiophyhowlwacuboncvmuutcivauuudppoitanoclusuaddmacoufpduuwuuuuuuuuuuuuuuuuusyuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuufquuuuuuuuuuuuuuuuspduuuuushuuuuluupbuuuuuuuuuuuygruuuvpmuuuymgvuuuuupcjuuuuusduuuuuuuuuuuuuuuuuuuumuuuuuuyvuuusfusucmuuuuuulcspuuucbruuuurdyuuuuuuuuuuuuunyuuuuusguuuuuuncyuuusmfsnhguuqyucalinscyppcncpuuumupuuuuuuuuusuuuuusuquuufgguuuuuuuujfuuufuuuuumdfuuuurslujuuupuuodbuuuuuuuuuuuuuuuuuuuuuuuuuuuuodbuuuuuuuuuuuuumduuopfuuuuuuuuufuuuuwduuuudlyuukuuuuuuuuuuuuuuuuuuuuuumfuuuuvlsuuuupyuuuuuuuuuuuuuuuuumpyupuuuuuudpsuuuuuslubyuuuumpuuuuuuuuuuuuuuuuuuuuuuuuuuuguuuuuuuuuuuuuuuuuuuudruuuugouuuuuuuuuuuuuuuuuuuygfcuuupubcuuumcouuuuuuuuuuuuuuuuuugfcuuuuuuuuuuuuuuuuuuuuuuuuuuduuuuuurmpucuuupcruuuuuuuuuuuuuuuuupuuuuuuuuuluuuuuufluuuuuur
1392  | 1848                     | ertaniocvslogppppppppppppppppppppppppppvypppppcyopmppmppppppppppdppppuprvppuprdgyppwrpppppgidpppppdouppppppppppppmppppppozpppppdrgoypcdcmopfpmppspdiwpdhdmidfpmpopppkbvypppspsyupppppposcpmhppchuppppppchbrmpmppuosinpmchvmpdmlpppppcmphpppgfgrmchpppdposucdpplwschpslhbppppfpcgdppppyplpppppprdgppblpprvcdpppprgwkpppphgglurspgypcllascyphoupsrvlypppgppppppppppvpppbppplgcolmpdcvyrmyppndcurypmlvmppdosphypppppfshprauypcyccoralpbyucnmvdypxncigdpblmgpsgpdppppppmpppzpvbpppdmppppsdvmpxgfgihbudppppdcuplppppindflyppvmfgvppppdppppppppgpppppcppppppgspppslpgsppppppmspmbhpppfpsuplbhppppvnitoclaumdcufmtppppppdpcumppppppppppppugpvpdppppnvtypmppmnybcppsptcnsppppppppvppvpppppppppppppphypppgupfyplmpyphpgppppppdbunckghgxthuglyycpfbsppppppwspppppppppppppvyppppppppppppwgpppppcycnsucuypppupdfnpppppptacnslupsphwdlpppymocugppgkyppppyhppppppuppppampsmhpppppflynbppppuyhugpppppppplcymnpppmpppalutcrspppppnmcpypfbppppppppppfdappppalpmyspxppppnryppppdsnhcmappppssyrhpppxppprtsdnapppwpyutsdgspppppcyyrhtmppdypppusmypppmdspvmghppupppppufcppdpppppsvgppppsgmhpppmxppppppppppppppupppppqupppppvlmgppppscfulyupdfppppppsppppppdpppppppppppppppppppplcppppgfpppppudvppppsbppppppppppppppppppppadpppppppppppppppppppphuppppxspppppalbhmppdvppppppkppppplfyoppppdvgppppvmpppppcacdlpcoxgxpppgcppppppppppppppplhppppplvbylypmdylsgpgfpcocisulxpllgpppfpppppvppppppppppppppppppppgppppppppppppppppppppppppppppppppppppppppppppppdpppppppppppppppppppppppppppmppppppmbdpppphpppppppppppppppppppppplappppvlppppamhspppppppppppppppppppplppppppppppppfsgppgppdlulugpppsopxapppplppppppppppppppplpppppuppppppdmpppppppdlpphoaldglappppalatmlocwpvpmgzpomvppvppppppphppppppppppppphupppppolmfbppdmpppppppppppppppppppppppppppppppgpppppppppppppppppppppppppppfudppppsdjuppppppdmpppppppppppppppppcopppppgpshpppplpuslppppypppppppppppppppppppphpppppphdlppppyliypoxmpblcowkdgpppppppppppppppppppppppppppppcshgpppppdguppvppppchgxppppppoctmppdbppsmusppppppppppppppppppdupppppsbpofpppsdylpppphlduymppppptsubqlypppplatisbgupmgdsusdypppfyvpypppppppppppppppppppivpppppmpohpppphgohpppppinocdusyppvppppupppppvfppppppppppppppppppppgpppppdopppppmcopdppppppppppppppspppppppppydpppppdcppppupcogupppppppppppppppppppppppppppsuppppxyppppppbsouyppppscipyfppvgpppppppppppppppppppppblfppppuppppppppmsppppbupcbimpvppyityfcvppppdmcppppppppppppppppppsxbppppppocmxpppdghpvppppsmpobpppppopcmtypppppstaimcyphpchmvppppppppppppphpppppkppdflyocdphpppuxhppppppiophyppppwacubpppvmuutcivapppsppoitanocluspaddmacopfpdpppvluppppspppppbplyppppppppppppppppppmppppppsuvypppxpuppfqpppppppppmpppppmppppplumqpppggcpopvdupppppppbppprpppppmpppypppppppppppspppppppppppppppppppmppppppppppppppppppsfhlpppsvlyppppppppppbrpppprdypppppuppppppdoypppppppppppppppppppsmpppppvppppppsyupppppsoumyppplypppppppppsppppdsuqpphfguppppxpppjfphowlppppmoncupprsldfppuppppppppppppppppppppppppppppppujppppppppppppppppppmdppppppppppppppfppppwdvsypdlyppkppppppppppppppppupspdpmfpushplsulpppypppppppppppygppppvlpppupmgvpdpsppcjpslubyppuumppppppppppppppppmupppppyvppppppsucmpppppulcsppppcdrppppppppppppppppppppnypppygsgfcppppncypppppfsnhgppqypcalinscgfpcncpppppppppppppppppcpppppdpppppprmucpppppcrppppppppppyppppppppppppodbylppppppflpppppprucmfgppplcpruypypppppppppppppppppppopfppppppppppppppppppppppppppppppoppppppppppppppppppppypuvppybppppppppppppppppppppompyppsmppppprugppppodmppppppppppppppppppphsoppppsopppppprypbopppyfppppppppppppgpouppgomoppppphwdpppppybsdpppgprsghfowdqmcopppppppppppppppppppcubppppcfoyppppoyuhpppppsfyppppmpconcusmppfmumcppppppppppppppppppppppppppppppppppppppppppppoppprjdbvppppppppppppppppdppppprdpppdsppppppgohcpppygnbppppmypppppsdpppppfpppppppppppppppppppppmppppppflpppppppruypppppppppppppppppppppppuppmppppppspppppppuslppppplrshyppppsbpumpppppppppppppppppponppppcumppppcfpyducpcnuslpybbmkfvsrcdvppccymcdyonphoppppppombppppsonppppmpnsicupudhuvbppnhglypppnyphglyrpppppunalcosydplkulppppmdpppppdppppppppppppppp
1396  | 1865                     | ertaniocvsluuuuuuuuuuuuuuuuuuuuuuuvyupmucyoduuuuuuuuuuuuuuurvuugurdgyuuurpuupwuuuuuugiduuuuudouuuuuuumuuuuuufuuuuuozrgoyuduukgucmcdomudmuospdiwuuupmiduuumfouuuuusyuuuuuuuoscpmhhucuuuuuchdigurluchbmuuuuuuosinpmchvmpgmdrcguuuuugrmchuuuuuosucpmufwschdswuudulbuuupslhucgdduuuuuurdgyuuuuprvbluuuurcluuuuxhgglurspyuuuulascyphovdsrpuupvllxuuugduuuuyuuubuuucumomulguuurmdcvuuuurpndcuuuumosphyulvyufshpragcucychoralpcduubuvducnmuuguxncigdpulmguubmuuusguuuuuuzuuuuupvvbuuudmuuuusdgiuhgbduupdcuuuuuuuindflyuuvmfcuuuuuuvuuuuuuuguuuuucuuuuubgsuuuuuugsuumvuumspmbhuuufusuplbhuuyuvnitoclmftdlucyfquuuuupuuuubcucumuuuuuuuuuuunyuuuuuuunvtyuuutcnsuuuuuuuuuuuuuupuuuuuuupvuuuyuuuuuufyuuhuuuhpguuuulmdbunckguuuthuglyycafbsuuuuuuwsuuuuupyuuuuuuuuuxuuuuuuuuvywguuuuuudcnuyuuuusyupdfnucyluutacnsluupghwdlspafuyhuugkmuyuumocugudmduuuuuuuuusmhuuuuuulynbuuuuuuhuguuyuuuuulcymnuuuuuuualutcrsumpuunmcpyuuuuuumuuuuuuuauuuffdauuysalpmubnryuuuudunhcuuuuuussyrhpuuuuuurtsdnuuuuwuputsdyxuuyugcyyrhtmuuuuuuunguuuuusymuupmdsuvmuusuduuuuuuuuuudufcuusdghuuusgmhuuumxuuuuuuuuuuuuuuuuuuuuquuuuuuvlmuuuuuscfulyuudfuuuuuuuuuuuuguuuuupduuuuuuuuuuuuuuuuuuuulcuuuugfuvuuuudsuuuusbuuuuuuuuuuuuuuaduuuuuuuuuuuuuuuuuuuuhuuuuuxuuuuuualbhmuudvuuuuuuuuuuuuukyuuulfdvguuuuvmuuuuuuacdlucuxgxucopuuuupgoyuuuuuuuulhuuuuulvbycuumdylyfugfucosulxuvciluguuusguuuuuuuuuuuuuuuuuuuuuuguuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuduuuuuuuuuuuuuuuuuuuuuuuuuuumuuuuuumbduuuuuuuuuuuuhouuuuuuuuuuuuplauuuuvluuuuuuamhsuuuuuuuuuuuuuuuuuuuuluupuuuuuuuuufsguuuuudlusuuuuuspoxauvuumuuuuuuuuuuuuuuuluuuuuuuuuuuudluuuuuulafuuuugudglaouuuuuatmlocwvopmgzuuuuuupomvuuuuhuuuuuuuuuuuuupuuuuuhhuuuuuolmfbuudmuuuuuuguuuuuuuuuuuuuuuuuuguuuuuuuuuuuuuuuuuuuuuuuuuuufuduuuusdjuuuuuuuuuuuuudmuuuuuuuuuuucopuuuuguuuuuuulpsuuuuhpyuuuuuuuuuuuuuuuuuushyuuuugybocsuuupcsubuuliylcghybuuddvguuuuuuuuuuuuuuuuuuukowduuuowuuuuuuguuuuuuubchgxuuuuupoctmpuuuuusmpkuuuuusuuuuuuuuuuuuduuuuuusqulyuubsuquuuguhltmpyupoydtsubqlyuugdlatisbhdpmgdsypdxuuusdyuuuuuvuuuuuuuuuuuuvuuuuuuuuivuuuuumpohuuuuhgopuuuuuinocdusydpvuuubvfuuuuuuuuuuuuuuuuuuuuguuuuudouuuuumcopduuuuuuuuuuuuuuuuuuuuspuuyduuuuudcuuuuuucoguuuuuuuuuuuuupuuuuuuuuuuuuuhuuuuupsuuuuuuubsouyuuupscipyfuuvguuuuuuuuuuuuuuuuuuuuubuuuuuuluuuuuuupmuuuuuufpcbibuuuuyitpmvuuugudmcuuuuuuuuuuuuuuuuuuuuuuuuuuxcyouuuufycvuuususmpsblyuuuopcmtyuuuuustaimcyphvmhmvuuuuuuuuuuuvuhuuulukuuusluocdfuuuuuxhuuuuuuiophyuuuuwacubuuuvmuutcivauuudppoitanoclusuaddmacoufpduuuuuuuuuuuuuuuuspuuuuuuuuuuuuuuuuuuuuuuuuuumlyuuuusuvyuufxpuuuuuuuuuuuuuumuuuqumuuuuulumquupbgcpovduuuuuuuruuuupmuuuyuuuuuuuuuuuuuuuusuuuuuuuuuuuuuuuuuuumuuuuuuuuuuuuusfuuuuuhluuuusvlyuuuubruuuurdyuuuuuuuuuuuuuuuuuudoyuuuuuuuuuuuuusmuuuuuuuuuuuvuuuuuusyuuuuuusoumyuuulyuuupuuuuusuquudfguuuhwuuuujpxuufuuuhomdfuuuuosrpndcuuduuuuuuuuuuuuuuuuuuuuuuuuuuuuuuvuuuuuuuuuuuuuuuuuulujuuuuuuuuuuuuuuuuuumduuuuumpcuufuuuuuuuuuuuuuuudguuuuluuuuuudrunhuupuuuuuuuuuuuuuuulyyguulumcuuumrfuuuuslcnvcypypuuuuuuuuuuuuuuuuuuuuuuuuuuuuupjuuuuuupyvuuuuululcsgfyuubuuuuuuuuuuuuuuupuuuuubyuuuuusguuuuunncyuuudrfsnhguuqyucalinscyvpcncyluuuupuuuuuuuuuuuuuuuuuuuuuuugupcruuuuuuuuuuuuuuuodbuuuuuuuuuluodbuufluuuuuurucmfguuulcpruyubuuuuuuuuuuuuuuugfcuuuuuuuopfuuuuuuuuuuuuuuuuduuuuuurmucpuuuduuuuuuuuuuuuuouuuuuybuvuuuuuuuuuuuuuuuuuuouuuuusmpyuuuruguuuuodmuuuuuuuuuuuuuuuuuuuhsouuuusouuuuuurypbouugyfuuuuuuuuuuuuuuouuuuumouugouhwduuuuuybsduuugprsghfowduhospuumcouuupbcuuuuuuucuuuuuucfoyuuuuoyuhuuuuusfyuuuumpconcusmpufmumcuuuuuuuuuuuuuuuupuuuuupuuuuuuuuuuuuuuuuuuuuuuuuurjduuuuuubvuuuuuuuuuuduuuuurdpuuuuuuuudsuuuuupgohbuuuygmyuucuusduuuuufuuuuuuuuuuuuuuuuuuuuumpuuuuufluuuuuupruyuuuuuuuuuuuuuuuuuuuuuuuuuumuunuuusuuuuuuuusluuuuulrshyuuuuuuuuuusbpumuuuuuuuuuuuucuuuuuoumuuucuupyducfuuuslpcnuuufvsrcdvuuuybmcdyuyhgkbuuuhouuuuupombuuuusonpuuuuunsicuuuhbumbuuuuuuuhglyruuuumunalcosyluykuluuuuduuuuuuuuuuuuduuuuuuuuuuuuuuuuuuuug
1402  | 1909                     | ertaniocvslpppkgpwppppppgidpppppumfoppuppsyppppppposcpomhppppdpppppzmcdomrpppospdiwpuupmdmipppfocmphpppgfgrmcupppdposuchphfwchcdswpppcmpoppppiuosinpmchdgpgmpppppvprvpppppdrgwkpppphgglurspyppcllascyphoudsrdscgppgppppppppppppppblppppcgpplpppprmypppppprypddlbppdsophlypupcfshprafcppymcoralpbyvlbpvdlglyppydcvypppppndcppppmcpppppppppppgpppppppplppppppcdppppppucnmppppxncigdpplmgppppppppppplpxpzppppppvpppppmdpppsppgihbudpvbpdcuqpppmpindflyppvmfcpuupppppppmftpgvmpppcdmpppusdgugxgpgscpyuppuspmnyplyfpsuplbhppppdnitoclaumvcucyfqpbhppppppppnvtypppmvfpvpppjdpbcupppppptcnspppppsthugllypppbspvppppppubcppcumpppppppppppppppppppwghppppppcubckgpxppupsycmlppnltacnspvppdhwdlppmpppphppppguppplmpypppppupppppppsmhpppxpplynblupppphugppppspamlcymnmppppvyalutcrsfyhppnmcpyppcyppppcuypppppppppppppyuspppfpnrypgkmpfnhmocugudssyrhpdpmppprtsdnppppwpputsdypppyppcayrhtmpppppppngpfblppppppppppppypppppppppppppppppmpppppppppppppppppppppuappppfdappppulpmpppdapppppppppxppppgspppppmdspdmsgmhpppplusmpppppppppdsupppppqupppppvlmpppypscfuufcldfppupgpppppppppppppyppppppppppppppppppppppppppppppvpgppppppppppppppppppppspppadpdpppppppppppppppppphulcppxpgfpppaludsppdvsbppppppppppppbhmpppdvgppppvmppppppacdlpppxgxppppppkppppppppppppplhppppplvbypplmdylfvpgfpcosulxppplgppppppcoppppppgcpppppppppppppgpppppfoypppplypppppsgpppppccilugppplppppppppppdpppppppppppppppppppppppppppmppppppmbdppppppppppppppppppppppppppplappppvlppppppamhspppppppppppppppppppplpppppphoppppfsgpppppdluppppppsopxapppplppppppppppppppplpppppuppppppdmpppppppdlppppamdglappspalatmlocwvhpmgzpspppppppppppphppppppppppppppppppppppppomvpppppppppppppppppppppppphspppppppgppppppppppppupppppgspppppolfudppdmsdjupppppppppppppppppppppppppmbpppppgcoppppplpsupppppyppppppppppppppppppppypdmpppbocsppppcsubppppplcghppshddvgphpppppfpppppppppppkowdpppowppdlppgupupslpbchliypoxmpoctmpypbppsmpkppppppppppppppgxppduppmppsqulypppsuqpvppphltmpyuppydtsubqlyupgdlatisubppmgdsuypppppppppppppppppbpofgufmppppppppppppppppppphppmppyppppppvpppppppsdyppppppdopppppppppppppppppppibhppppmpohpppmhgopppvfpinocdusyppvppppppppcopdpppdyppppppcogupppppppppppppppppppppppppphppppppxyppspppbsouyppppscipyfppvgpppppppppppppppppppppbppppppuppppsuppmppppppppcbipppppyityfcvppppdmcpppppppppppppppppppxlfbppppocmxpppdghppppbusmpompvpppopcmtypppppstaimcyphpchmvppppppspppppphpppppkppppppocdphpppuxhppppppiophyppppwacubpppvmuutcivapppdppoitanocluspaddmacopfpdpppppppvppppppppppppppppppppppppppppppppslpbyppppppppppppfqpppupppppvlupppppflyppppppppppppppbppppppppppspprpppspmpppyxpupppppppppppppppppppuvyppppumqppppmcpovdupppppppsfpppppppppppppppppppbrpppsrdyppppppppppppppppmpppppppppppppppppsmphlppppsvlyppppppppppppppppppppppppupppsppdoysuqpppfguppppppppjfpppfpppvpmdfppsyrslujpsoupppuplyppppppppppppppmypppphwppppppxpppppphowlpppmdoncvsyppfdppppfppppwdppppdlyppkppppppppppppppppupppppmfppppplsuppppypppppppppppppppppppuppupppppdpspppppslubyppuumpspdppppushpppplpppppppppppppppygppppvlpppppmgvppdrppcjpppppsdppppppppppppppygfcppmupppppyvppppppsucmpppppulcspgfccppppppppppppppppppppppnypdpppsgprmucpncypcrppfsnhgppqypcalinscyvpcncpplppppppflpppppprucmfgppplcpruypbppppppppppppppppgpppppppppodbpodbpppppppppppppppppppoppppppppppppppppppppypppppybppppopfpppppppppppppopppppsmppppprugppppodmpppppppppppppppppuvhsoppppsopppppprypbopppyfmpypppppppppppouppppmoppppphwdpppppybsdpppgprsghfowdqhospgpppppppppppppppppcppppppcfgoppppoyuhpppppsfypppompconcusmppfmmcouppppppppppppbcppppppppppppppppppppppppppppppppprjdppppppppppppppppppdppppprdppppppppppppppppppppbpppppmypppppsdpppppbvppppppppppppppppppppmppppppflppppppprsdhppyggnpppppohcpppppppppppuypppppsppppppmuslppppplrshypppppppppppppppppppppppppppcppppppumuppppppyducvpppslpybpppfvsrcdpppccsmcdyppyppppppppppppppppubpppompppppcfudnyppcnuhglynbmkpphglyrpppppunalcosydplkulpombmdppsonppppppnsicdpphbuvbppppppppppppppppppppppppppppppppppppppppppppppppuppppppppppppppppppppmpppppogrdypprppppppppppppppppppppvypppppcyodpppmfppppppprgoy

我用来生成数据字符串的脚本在这里,以防对任何人有用!


不幸的是,当使用官方得分手时,这将挂起。请记住,从某种意义上讲,您实际上只会得到5个错误的猜测;第六种错误的猜测会使您立即迷失方向。
nneonneo 2014年

@nneonneo好的,谢谢!我将解决此问题,如果无法解决,将其删除。在我的手动测试中,它期望第六个错误的猜测会造成损失,但也许我对结束条件有误。
tttppp 2014年

只是添加一些额外的信息以帮助您进行调试:当提供单词时distinct,程序的输出按顺序是eitanogsuc,这意味着即使它猜错5次,它也会以某种方式停止提供输出。
user12205 2014年

@ace辉煌,谢谢。这很有帮助。
tttppp 2014年

@ace请您重新测试一下?我已经手动测试了它在正确点丢失的“区别”(我也测试了它丢失的“章鱼”,获胜的“耳朵”和结束它的“ END”)。谢谢!
tttppp 2014年

1

d编程语言是我对这一挑战的首选工具。

略低于2,048字节的限制,尽管在某些部分进行了一些微调,以减少字节数,但所有繁重的工作仍保持清晰可读。这个求解器的性能不是很好,我希望它会很容易被击败,但这只是使问题不断发展而已。可以这么说。

编辑#1正如已经指出的那样,原始代码在耗尽所有元音时很容易死亡。由于它无法正常工作,因此我将其替换为一种更加粗鲁的随机猜测方法。

编辑#2:原始代码已修复,现在可以使用。

得分

25.7; totalerr: 24,529.9 (average of 10 tests).

怎么运行的

该求解器是完全随机的。即使是随机也是随机的,有趣的时刻!

当程序收到输入时,它将猜测一个尚未猜测的随机字符,并将其发送到STDOUT。

猜测算法因此起作用:

  1. 随机选择两个字符组(辅音或元音)之一。
  2. 随机选择以下两种模式之一:
    • 使用字母频率作为RNG的权重。较高的频率更有可能被选择。
    • 随机选择一个字符,而不考虑频率。
  3. 根据在步骤2中选择的模式返回单个字符。
import std.stdio, std.random, std.array, std.math, std.algorithm;

alias double[char] Hash;
alias uniform U;

bool first = true;
Hash cons, vowel;
char[] guessed;
Mt19937 rng;

int fails;

void main()
{
    rng.seed( unpredictableSeed );

    auto get() { return stdin.readln.replace( "\r", "" ).replace( "\n", "" ); }

    string input, last;

    while( ( input = get ) != "END" )
    {
        if( first ) last = input;
        if( input == last && !first ) ++fails;

        if( fails == 6 || !input.any!( x => x == '_' ) )
        {
            fails = 0;
            last = null;
            guessed = [];
            first = true;
            continue;
        }

        stdout.writeln( guess );
        stdout.flush;

        if( !first ) last = input;
        if( first ) first = false;
    }
}

char guess()
{
    reroll:
    Hash group;
    double min, max;
    bool useWeight = U( 0, 2, rng ) == 1;

    if( guessed.filter!( c => vowel.keys.any!( x => x == c ) ).count < vowel.length && U( 0, 2, rng ) == 1 )
    {
        group = vowel;
        min = useWeight ? 2.758 : 0;
        max = useWeight ? 12.702 : 4;
    }
    else
    {
        group = cons;
        min = useWeight ? 0.074 : 0;
        max = useWeight ? 9.056 : 20;
    }

    double choice = U!( "()" )( min, max, rng );
    char chr;

    if( useWeight )
    {
        foreach( k, v; group )
            if( v < choice )
                chr = k;
    }
    else
    {
        int counter = 0;

        foreach( k, v; group )
        {
            if( counter == cast( int )choice.floor )
            {
                chr = k;
                break;
            }

            ++counter;
        }
    }

    if( guessed.any!( x => chr == x ) || chr == char.init )
        goto reroll;
    else
    {
        guessed ~= chr;
        return chr;
    }
}

K keys( K, V )( V[K] a )
{
    K[] ks;
    foreach( k, v; a )  ks ~= k;
    return ks;
}

static this()
{
    cons = [ 't': 9.056, 'n': 6.749, 's': 6.327, 'h': 6.049, 'r': 5.987, 'd': 4.253, 'l': 4.025, 'c': 2.782, 'm': 2.406, 'w': 2.360, 'f': 2.228, 'g': 2.015, 'y': 1.974, 'p': 1.929, 'b': 1.492, 'v': 0.978, 'k': 0.772, 'j': 0.153, 'x': 0.150, 'q': 0.095, 'z': 0.074 ];
    vowel = [ 'e': 12.702, 'a': 8.167, 'o': 7.507, 'i': 6.966, 'u': 2.758 ];
}

@ace耗尽所有元音后,似乎陷入了无限滚动的循环中。我不确定为什么会这样,但是直到我得到平方为止,我才编辑了一个不太复杂的版本。我可能会也可能不会重新发布元音/辅音猜测器。
Tony Ellis

使用dmd编译器会产生错误./test.d(44): Error: cannot implicitly convert expression (uniform(0, Letters.length, rng)) of type ulong to int。我设法通过解决此问题cast(int)。运行10次后,您的平均分数为22.4个单词,其中有24529.1个错误的猜测。我将重新测试您是否修复了更高级的版本:)玩得开心
2014年

@ace比我想象的还要好。哈。无论如何,“更智能”的猜测器现在已修复,但老实说,它在损坏时会更好地工作,请确定。
Tony Ellis

现在的分数是多少?
justhalf 2014年

@justhalf 分数= 25.7,总计= 24529.9(10次测试的平均值)
2014年

0

JAVASCRIPT + HTML解决方案

<!DOCTYPE html>

<head>

    <title>Hangman Game</title>
    <meta charset="utf-8">

    <style type="text/css">

        *{

            font-family: sans-serif;
            color: teal;

        }

        #man {

            float: right;
            margin-left: 0%;
            position: absolute;
            top: 20px;
            left: 50%;

        }

    </style>

</head>

<body>

    <div>
        <h1>Welcome To Hangman!</h1>
        <h2>Your current word to guess is: <span id="word"></span></h2>
        <input type="text" name="letter" id="letter">
        <h3>You entered the letter: <span id="chosenLetter"></span></h3>
        <h3>Incorrect Letters: <span id="incorrect"></span></h3>
        <h3>Chances Left: <span id="chance"></span></h3>
        <h2>Game Status: <span id='gameStatus'>In Progress</span></h2>
        <img id='man' src="../images/hangman/white.PNG" />

    </div>

    <script type="text/javascript">

        var word = document.getElementById('word');
        var input = document.getElementById('letter');
        var displayLetter = document.getElementById('chosenLetter');
        var chanceDisplay = document.getElementById('chance');
        var gameStatus = document.getElementById('gameStatus');
        var image = document.getElementById('man');
        var incorrect = document.getElementById('incorrect');
        var list = ['apple', 'banana', 'elephant', 'fruit', 'pencil', 'boomerang', 'trophy', 'slippers', 'university', 'curtain','connection', 'grandmother', 'inflation', 'recording', 'conversation', 'king', 'reception', 'distribution', 'cigarette'];
        var imagesList = ['white.PNG','one.PNG','two.PNG','three.PNG','four.PNG','five.PNG','six.PNG','seven.PNG','eight.PNG'];
        var imagesIndex = 0;
        image.src = "../images/hangman/" + imagesList[imagesIndex];
        var currentWordIndex = Math.floor(Math.random()* list.length);
        var currentW = list[currentWordIndex];
        console.log(currentW);
        var wordLength = currentW.length;
        var chances= 8;
        chanceDisplay.textContent = chances;
        for(i = 0; i < wordLength; i++){

            var nodeDash = document.createElement('span');
            nodeDash.classList.add('dash');
            var textNode = document.createTextNode(' _ ');
            nodeDash.appendChild(textNode);
            word.append(nodeDash);

        }
        var dashes = document.getElementsByClassName('dash');

        input.addEventListener('keyup', function(){

            event.preventDefault();
            var alphabet = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'];
            if(event.keyCode === 13){

                var letterChosen = input.value;
                input.value = '';
                var match = 0;
                var checkLength = letterChosen.length;
                if(checkLength === 1){

                    console.log('length is correct');
                    var checkIfLetter = 0;
                    var checkIfCorrect = 0;

                    for(i = 0; i < alphabet.length; i++){

                        if(alphabet[i] == letterChosen){

                            console.log('is an alphabetic letter');
                            match += 1;
                            checkIfLetter++;
                            displayLetter.innerHTML = letterChosen;

                        } 

                    }

                    if(checkIfLetter == 0){

                        displayLetter.innerHTML = 'Not A Single Letter';

                    }

                    if(match == 1){

                        var checkIfDone = 0;

                        for(i = 0; i < (1 + currentW.length); i++){

                            if(letterChosen == currentW[i]){

                                dashes[i].textContent = ' ' + letterChosen + ' ';

                            } else{

                                checkIfCorrect ++;

                            }

                        }

                        for(i = 0; i < currentW.length; i++){

                            var temporaryCheck = ' ' + currentW[i] + ' ';

                            if(dashes[i].textContent == temporaryCheck){

                                checkIfDone++;

                            }

                        }

                        if(checkIfDone == currentW.length){

                            gameStatus.innerHTML = 'GAME ENDED: YOU WON!';
                            gameStatus.style.color = 'lightgreen';

                            for(i = 0; i < dashes.length; i++){

                                dashes[i].style.color = 'lightgreen';

                            }

                        }

                        if(!(checkIfCorrect <= currentW.length)){

                            incorrect.innerHTML += (letterChosen + ', ');
                            chances--;
                            chanceDisplay.textContent = chances;
                            imagesIndex++;
                            image.src = "../images/hangman/" + imagesList[imagesIndex];
                            if(chances == 0){

                                for(i = 0; i < dashes.length; i++){

                                    if(dashes[i].innerHTML == ' _ '){

                                        dashes[i].innerHTML = ' ' + currentW[i] + ' ';
                                        dashes[i].style.color = 'red';

                                    }

                                    gameStatus.innerHTML = 'GAME OVER: TRY AGAIN';

                                }


                            }

                        }

                    }

                } else{

                    displayLetter.innerHTML = "Not A Single Letter";

                }

            }

        });



    </script>

</body>


1
欢迎来到PPCG!这看起来像是一个Hangman游戏。不幸的是,问题在于编写“ Hangman解算器”(一种播放Hangman而不是允许用户玩的程序)。
OOBalance
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.