代码高尔夫:电话号码到单词

时间:2010-06-03 20:54:44

标签: language-agnostic code-golf rosetta-stone

Guidelines for code-golf on SO

我们都看到了电话号码:1-800-BUY-MORE等等。

您可以编写的最短代码是什么,它将为7位美国电话号码生成所有可能的单词组合。

输入将是一个七位整数(或字符串,如果这更简单),并假设输入正确形成。

输出将是七个字符的字符串列表

例如,数字428-5246将产生

GATJAGM
GATJAGN
GATJAGO
GATJAHM
GATJAHN
GATJAGO
GATJAIM
GATJAIN
GATJAIO 等等......

获胜标准将是来自任何语言的代码,其中字符最少,产生每个可能的字母组合。

附加说明:

  • 使话语更有趣 只能通过使用 北美经典上的字母 键盘手机有三个字母 每个号码as defined here 这意味着排除了Z和Q.
  • 对于数字'1',请放一个空格。
  • 对于数字'0',请输入连字符' - '

将输出识别为真实英语单词而获得的奖励积分。好的,不是真的。 ; - )

已添加:好的,让我们一起使用“Nick's Modified North American Classic Key Pad”,它在6键上有一个'O'(哦,不是零)。

9 个答案:

答案 0 :(得分:18)

Python,107个字符

f=lambda p:p and[i+j for i in'O 1 ABC DEF GHI JKL MN PRS TUV WXY'.split()
[int(p[0])]for j in f(p[1:])]or[p]

Python,122个字符(带有reduce的旧版本)

f=lambda p:reduce(lambda x,y:[i+j for i in x for j in y],
['O 1 ABC DEF GHI JKL MN PRS TUV WXY'.split()[int(k)]for k in p])

PS。给我一些“竖起大拇指”,新来的,我需要投票

使用示例:

>>> len(f('4285246'))
1458
>>> f('4285246')
['GATJAGM', 'GATJAGN', 'GATJAHM', 'GATJAHN', 'GATJAIM', 'GATJAIN', 'GATJBGM', 'GATJBGN', 'GATJBHM', 'GATJBHN', 'GATJBIM', 'GATJBIN', 'GATJCGM', 'GATJCGN', 'GATJCHM', 'GATJCHN', 'GATJCIM', 'GATJCIN', 'GATKAGM', 'GATKAGN', 'GATKAHM', 'GATKAHN', 'GATKAIM', 'GATKAIN', 'GATKBGM', 'GATKBGN', 'GATKBHM', 'GATKBHN', 'GATKBIM', 'GATKBIN', 'GATKCGM', 'GATKCGN', 'GATKCHM', 'GATKCHN', 'GATKCIM', 'GATKCIN', 'GATLAGM', 'GATLAGN', 'GATLAHM', 'GATLAHN', 'GATLAIM', 'GATLAIN', 'GATLBGM', 'GATLBGN', 'GATLBHM', 'GATLBHN', 'GATLBIM', 'GATLBIN', 'GATLCGM', 'GATLCGN', 'GATLCHM', 'GATLCHN', 'GATLCIM', 'GATLCIN', 'GAUJAGM', 'GAUJAGN', 'GAUJAHM', 'GAUJAHN', 'GAUJAIM', 'GAUJAIN', 'GAUJBGM', 'GAUJBGN', 'GAUJBHM', 'GAUJBHN', 'GAUJBIM', 'GAUJBIN', 'GAUJCGM', 'GAUJCGN', 'GAUJCHM', 'GAUJCHN', 'GAUJCIM', 'GAUJCIN', 'GAUKAGM', 'GAUKAGN', 'GAUKAHM', 'GAUKAHN', 'GAUKAIM', 'GAUKAIN', 'GAUKBGM', 'GAUKBGN', 'GAUKBHM', 'GAUKBHN', 'GAUKBIM', 'GAUKBIN', 'GAUKCGM', 'GAUKCGN', 'GAUKCHM', 'GAUKCHN', 'GAUKCIM', 'GAUKCIN', 'GAULAGM', 'GAULAGN', 'GAULAHM', 'GAULAHN', 'GAULAIM', 'GAULAIN', 'GAULBGM', 'GAULBGN', 'GAULBHM', 'GAULBHN', 'GAULBIM', 'GAULBIN', 'GAULCGM', 'GAULCGN', 'GAULCHM', 'GAULCHN', 'GAULCIM', 'GAULCIN', 'GAVJAGM', 'GAVJAGN', 'GAVJAHM', 'GAVJAHN', 'GAVJAIM', 'GAVJAIN', 'GAVJBGM', 'GAVJBGN', 'GAVJBHM', 'GAVJBHN', 'GAVJBIM', 'GAVJBIN', 'GAVJCGM', 'GAVJCGN', 'GAVJCHM', 'GAVJCHN', 'GAVJCIM', 'GAVJCIN', 'GAVKAGM', 'GAVKAGN', 'GAVKAHM', 'GAVKAHN', 'GAVKAIM', 'GAVKAIN', 'GAVKBGM', 'GAVKBGN', 'GAVKBHM', 'GAVKBHN', 'GAVKBIM', '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AIN', 'GBUKBGM', 'GBUKBGN', 'GBUKBHM', 'GBUKBHN', 'GBUKBIM', 'GBUKBIN', 'GBUKCGM', 'GBUKCGN', 'GBUKCHM', 'GBUKCHN', 'GBUKCIM', 'GBUKCIN', 'GBULAGM', 'GBULAGN', 'GBULAHM', 'GBULAHN', 'GBULAIM', 'GBULAIN', 'GBULBGM', 'GBULBGN', 'GBULBHM', 'GBULBHN', 'GBULBIM', 'GBULBIN', 'GBULCGM', 'GBULCGN', 'GBULCHM', 'GBULCHN', 'GBULCIM', 'GBULCIN', 'GBVJAGM', 'GBVJAGN', 'GBVJAHM', 'GBVJAHN', 'GBVJAIM', 'GBVJAIN', 'GBVJBGM', 'GBVJBGN', 'GBVJBHM', 'GBVJBHN', 'GBVJBIM', 'GBVJBIN', 'GBVJCGM', 'GBVJCGN', 'GBVJCHM', 'GBVJCHN', 'GBVJCIM', 'GBVJCIN', 'GBVKAGM', 'GBVKAGN', 'GBVKAHM', 'GBVKAHN', 'GBVKAIM', 'GBVKAIN', 'GBVKBGM', 'GBVKBGN', 'GBVKBHM', 'GBVKBHN', 'GBVKBIM', 'GBVKBIN', 'GBVKCGM', 'GBVKCGN', 'GBVKCHM', 'GBVKCHN', 'GBVKCIM', 'GBVKCIN', 'GBVLAGM', 'GBVLAGN', 'GBVLAHM', 'GBVLAHN', 'GBVLAIM', 'GBVLAIN', 'GBVLBGM', 'GBVLBGN', 'GBVLBHM', 'GBVLBHN', 'GBVLBIM', 'GBVLBIN', 'GBVLCGM', 'GBVLCGN', 'GBVLCHM', 'GBVLCHN', 'GBVLCIM', 'GBVLCIN', 'GCTJAGM', 'GCTJAGN', 'GCTJAHM', 'GCTJAHN', 'GCTJAIM', 'GCTJAIN', 'GCTJBGM', 'GCTJBGN', 'GCTJBHM', 'GCTJBHN', 'GCTJBIM', 'GCTJBIN', 'GCTJCGM', 'GCTJCGN', 'GCTJCHM', 'GCTJCHN', 'GCTJCIM', 'GCTJCIN', 'GCTKAGM', 'GCTKAGN', 'GCTKAHM', 'GCTKAHN', 'GCTKAIM', 'GCTKAIN', 'GCTKBGM', 'GCTKBGN', 'GCTKBHM', 'GCTKBHN', 'GCTKBIM', 'GCTKBIN', 'GCTKCGM', 'GCTKCGN', 'GCTKCHM', 'GCTKCHN', 'GCTKCIM', 'GCTKCIN', 'GCTLAGM', 'GCTLAGN', 'GCTLAHM', 'GCTLAHN', 'GCTLAIM', 'GCTLAIN', 'GCTLBGM', 'GCTLBGN', 'GCTLBHM', 'GCTLBHN', 'GCTLBIM', 'GCTLBIN', 'GCTLCGM', 'GCTLCGN', 'GCTLCHM', 'GCTLCHN', 'GCTLCIM', 'GCTLCIN', 'GCUJAGM', 'GCUJAGN', 'GCUJAHM', 'GCUJAHN', 'GCUJAIM', 'GCUJAIN', 'GCUJBGM', 'GCUJBGN', 'GCUJBHM', 'GCUJBHN', 'GCUJBIM', 'GCUJBIN', 'GCUJCGM', 'GCUJCGN', 'GCUJCHM', 'GCUJCHN', 'GCUJCIM', 'GCUJCIN', 'GCUKAGM', 'GCUKAGN', 'GCUKAHM', 'GCUKAHN', 'GCUKAIM', 'GCUKAIN', 'GCUKBGM', 'GCUKBGN', 'GCUKBHM', 'GCUKBHN', 'GCUKBIM', 'GCUKBIN', 'GCUKCGM', 'GCUKCGN', 'GCUKCHM', 'GCUKCHN', 'GCUKCIM', 'GCUKCIN', 'GCULAGM', 'GCULAGN', 'GCULAHM', 'GCULAHN', 'GCULAIM', 'GCULAIN', 'GCULBGM', 'GCULBGN', 'GCULBHM', 'GCULBHN', 'GCULBIM', 'GCULBIN', 'GCULCGM', 'GCULCGN', 'GCULCHM', 'GCULCHN', 'GCULCIM', 'GCULCIN', 'GCVJAGM', 'GCVJAGN', 'GCVJAHM', 'GCVJAHN', 'GCVJAIM', 'GCVJAIN', 'GCVJBGM', 'GCVJBGN', 'GCVJBHM', 'GCVJBHN', 'GCVJBIM', 'GCVJBIN', 'GCVJCGM', 'GCVJCGN', 'GCVJCHM', 'GCVJCHN', 'GCVJCIM', 'GCVJCIN', 'GCVKAGM', 'GCVKAGN', 'GCVKAHM', 'GCVKAHN', 'GCVKAIM', 'GCVKAIN', 'GCVKBGM', 'GCVKBGN', 'GCVKBHM', 'GCVKBHN', 'GCVKBIM', 'GCVKBIN', 'GCVKCGM', 'GCVKCGN', 'GCVKCHM', 'GCVKCHN', 'GCVKCIM', 'GCVKCIN', 'GCVLAGM', 'GCVLAGN', 'GCVLAHM', 'GCVLAHN', 'GCVLAIM', 'GCVLAIN', 'GCVLBGM', 'GCVLBGN', 'GCVLBHM', 'GCVLBHN', 'GCVLBIM', 'GCVLBIN', 'GCVLCGM', 'GCVLCGN', 'GCVLCHM', 'GCVLCHN', 'GCVLCIM', 'GCVLCIN', 'HATJAGM', 'HATJAGN', 'HATJAHM', 'HATJAHN', 'HATJAIM', 'HATJAIN', 'HATJBGM', 'HATJBGN', 'HATJBHM', 'HATJBHN', 'HATJBIM', 'HATJBIN', 'HATJCGM', 'HATJCGN', 'HATJCHM', 'HATJCHN', 'HATJCIM', 'HATJCIN', 'HATKAGM', 'HATKAGN', 'HATKAHM', 'HATKAHN', 'HATKAIM', 'HATKAIN', 'HATKBGM', 'HATKBGN', 'HATKBHM', 'HATKBHN', 'HATKBIM', 'HATKBIN', 'HATKCGM', 'HATKCGN', 'HATKCHM', 'HATKCHN', 'HATKCIM', 'HATKCIN', 'HATLAGM', 'HATLAGN', 'HATLAHM', 'HATLAHN', 'HATLAIM', 'HATLAIN', 'HATLBGM', 'HATLBGN', 'HATLBHM', 'HATLBHN', 'HATLBIM', 'HATLBIN', 'HATLCGM', 'HATLCGN', 'HATLCHM', 'HATLCHN', 'HATLCIM', 'HATLCIN', 'HAUJAGM', 'HAUJAGN', 'HAUJAHM', 'HAUJAHN', 'HAUJAIM', 'HAUJAIN', 'HAUJBGM', 'HAUJBGN', 'HAUJBHM', 'HAUJBHN', 'HAUJBIM', 'HAUJBIN', 'HAUJCGM', 'HAUJCGN', 'HAUJCHM', 'HAUJCHN', 'HAUJCIM', 'HAUJCIN', 'HAUKAGM', 'HAUKAGN', 'HAUKAHM', 'HAUKAHN', 'HAUKAIM', 'HAUKAIN', 'HAUKBGM', 'HAUKBGN', 'HAUKBHM', 'HAUKBHN', 'HAUKBIM', 'HAUKBIN', 'HAUKCGM', 'HAUKCGN', 'HAUKCHM', 'HAUKCHN', 'HAUKCIM', 'HAUKCIN', 'HAULAGM', 'HAULAGN', 'HAULAHM', 'HAULAHN', 'HAULAIM', 'HAULAIN', 'HAULBGM', 'HAULBGN', 'HAULBHM', 'HAULBHN', 'HAULBIM', 'HAULBIN', 'HAULCGM', 'HAULCGN', 'HAULCHM', 'HAULCHN', 'HAULCIM', 'HAULCIN', 'HAVJAGM', 'HAVJAGN', 'HAVJAHM', 'HAVJAHN', 'HAVJAIM', 'HAVJAIN', 'HAVJBGM', 'HAVJBGN', 'HAVJBHM', 'HAVJBHN', 'HAVJBIM', 'HAVJBIN', 'HAVJCGM', 'HAVJCGN', 'HAVJCHM', 'HAVJCHN', 'HAVJCIM', 'HAVJCIN', 'HAVKAGM', 'HAVKAGN', 'HAVKAHM', 'HAVKAHN', 'HAVKAIM', 'HAVKAIN', 'HAVKBGM', 'HAVKBGN', 'HAVKBHM', 'HAVKBHN', 'HAVKBIM', 'HAVKBIN', 'HAVKCGM', 'HAVKCGN', 'HAVKCHM', 'HAVKCHN', 'HAVKCIM', 'HAVKCIN', 'HAVLAGM', 'HAVLAGN', 'HAVLAHM', 'HAVLAHN', 'HAVLAIM', 'HAVLAIN', 'HAVLBGM', 'HAVLBGN', 'HAVLBHM', 'HAVLBHN', 'HAVLBIM', 'HAVLBIN', 'HAVLCGM', 'HAVLCGN', 'HAVLCHM', 'HAVLCHN', 'HAVLCIM', 'HAVLCIN', 'HBTJAGM', 'HBTJAGN', 'HBTJAHM', 'HBTJAHN', 'HBTJAIM', 'HBTJAIN', 'HBTJBGM', 'HBTJBGN', 'HBTJBHM', 'HBTJBHN', 'HBTJBIM', 'HBTJBIN', 'HBTJCGM', 'HBTJCGN', 'HBTJCHM', 'HBTJCHN', 'HBTJCIM', 'HBTJCIN', 'HBTKAGM', 'HBTKAGN', 'HBTKAHM', 'HBTKAHN', 'HBTKAIM', 'HBTKAIN', 'HBTKBGM', 'HBTKBGN', 'HBTKBHM', 'HBTKBHN', 'HBTKBIM', 'HBTKBIN', 'HBTKCGM', 'HBTKCGN', 'HBTKCHM', 'HBTKCHN', 'HBTKCIM', 'HBTKCIN', 'HBTLAGM', 'HBTLAGN', 'HBTLAHM', 'HBTLAHN', 'HBTLAIM', 'HBTLAIN', 'HBTLBGM', 'HBTLBGN', 'HBTLBHM', 'HBTLBHN', 'HBTLBIM', 'HBTLBIN', 'HBTLCGM', 'HBTLCGN', 'HBTLCHM', 'HBTLCHN', 'HBTLCIM', 'HBTLCIN', 'HBUJAGM', 'HBUJAGN', 'HBUJAHM', 'HBUJAHN', 'HBUJAIM', 'HBUJAIN', 'HBUJBGM', 'HBUJBGN', 'HBUJBHM', 'HBUJBHN', 'HBUJBIM', 'HBUJBIN', 'HBUJCGM', 'HBUJCGN', 'HBUJCHM', 'HBUJCHN', 'HBUJCIM', 'HBUJCIN', 'HBUKAGM', 'HBUKAGN', 'HBUKAHM', 'HBUKAHN', 'HBUKAIM', 'HBUKAIN', 'HBUKBGM', 'HBUKBGN', 'HBUKBHM', 'HBUKBHN', 'HBUKBIM', 'HBUKBIN', 'HBUKCGM', 'HBUKCGN', 'HBUKCHM', 'HBUKCHN', 'HBUKCIM', 'HBUKCIN', 'HBULAGM', 'HBULAGN', 'HBULAHM', 'HBULAHN', 'HBULAIM', 'HBULAIN', 'HBULBGM', 'HBULBGN', 'HBULBHM', 'HBULBHN', 'HBULBIM', 'HBULBIN', 'HBULCGM', 'HBULCGN', 'HBULCHM', 'HBULCHN', 'HBULCIM', 'HBULCIN', 'HBVJAGM', 'HBVJAGN', 'HBVJAHM', 'HBVJAHN', 'HBVJAIM', 'HBVJAIN', 'HBVJBGM', 'HBVJBGN', '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AHM', 'HCUJAHN', 'HCUJAIM', 'HCUJAIN', 'HCUJBGM', 'HCUJBGN', 'HCUJBHM', 'HCUJBHN', 'HCUJBIM', 'HCUJBIN', 'HCUJCGM', 'HCUJCGN', 'HCUJCHM', 'HCUJCHN', 'HCUJCIM', 'HCUJCIN', 'HCUKAGM', 'HCUKAGN', 'HCUKAHM', 'HCUKAHN', 'HCUKAIM', 'HCUKAIN', 'HCUKBGM', 'HCUKBGN', 'HCUKBHM', 'HCUKBHN', 'HCUKBIM', 'HCUKBIN', 'HCUKCGM', 'HCUKCGN', 'HCUKCHM', 'HCUKCHN', 'HCUKCIM', 'HCUKCIN', 'HCULAGM', 'HCULAGN', 'HCULAHM', 'HCULAHN', 'HCULAIM', 'HCULAIN', 'HCULBGM', 'HCULBGN', 'HCULBHM', 'HCULBHN', 'HCULBIM', 'HCULBIN', 'HCULCGM', 'HCULCGN', 'HCULCHM', 'HCULCHN', 'HCULCIM', 'HCULCIN', 'HCVJAGM', 'HCVJAGN', 'HCVJAHM', 'HCVJAHN', 'HCVJAIM', 'HCVJAIN', 'HCVJBGM', 'HCVJBGN', 'HCVJBHM', 'HCVJBHN', 'HCVJBIM', 'HCVJBIN', 'HCVJCGM', 'HCVJCGN', 'HCVJCHM', 'HCVJCHN', 'HCVJCIM', 'HCVJCIN', 'HCVKAGM', 'HCVKAGN', 'HCVKAHM', 'HCVKAHN', 'HCVKAIM', 'HCVKAIN', 'HCVKBGM', 'HCVKBGN', 'HCVKBHM', 'HCVKBHN', 'HCVKBIM', 'HCVKBIN', 'HCVKCGM', 'HCVKCGN', 'HCVKCHM', 'HCVKCHN', 'HCVKCIM', 'HCVKCIN', 'HCVLAGM', 'HCVLAGN', 'HCVLAHM', 'HCVLAHN', 'HCVLAIM', 'HCVLAIN', 'HCVLBGM', 'HCVLBGN', 'HCVLBHM', 'HCVLBHN', 'HCVLBIM', 'HCVLBIN', 'HCVLCGM', 'HCVLCGN', 'HCVLCHM', 'HCVLCHN', 'HCVLCIM', 'HCVLCIN', 'IATJAGM', 'IATJAGN', 'IATJAHM', 'IATJAHN', 'IATJAIM', 'IATJAIN', 'IATJBGM', 'IATJBGN', 'IATJBHM', 'IATJBHN', 'IATJBIM', 'IATJBIN', 'IATJCGM', 'IATJCGN', 'IATJCHM', 'IATJCHN', 'IATJCIM', 'IATJCIN', 'IATKAGM', 'IATKAGN', 'IATKAHM', 'IATKAHN', 'IATKAIM', 'IATKAIN', 'IATKBGM', 'IATKBGN', 'IATKBHM', 'IATKBHN', 'IATKBIM', 'IATKBIN', 'IATKCGM', 'IATKCGN', 'IATKCHM', 'IATKCHN', 'IATKCIM', 'IATKCIN', 'IATLAGM', 'IATLAGN', 'IATLAHM', 'IATLAHN', 'IATLAIM', 'IATLAIN', 'IATLBGM', 'IATLBGN', 'IATLBHM', 'IATLBHN', 'IATLBIM', 'IATLBIN', 'IATLCGM', 'IATLCGN', 'IATLCHM', 'IATLCHN', 'IATLCIM', 'IATLCIN', 'IAUJAGM', 'IAUJAGN', 'IAUJAHM', 'IAUJAHN', 'IAUJAIM', 'IAUJAIN', 'IAUJBGM', 'IAUJBGN', 'IAUJBHM', 'IAUJBHN', 'IAUJBIM', 'IAUJBIN', 'IAUJCGM', 'IAUJCGN', 'IAUJCHM', 'IAUJCHN', 'IAUJCIM', 'IAUJCIN', 'IAUKAGM', 'IAUKAGN', 'IAUKAHM', 'IAUKAHN', 'IAUKAIM', 'IAUKAIN', 'IAUKBGM', 'IAUKBGN', 'IAUKBHM', 'IAUKBHN', 'IAUKBIM', 'IAUKBIN', 'IAUKCGM', 'IAUKCGN', 'IAUKCHM', 'IAUKCHN', 'IAUKCIM', 'IAUKCIN', 'IAULAGM', 'IAULAGN', 'IAULAHM', 'IAULAHN', 'IAULAIM', 'IAULAIN', 'IAULBGM', 'IAULBGN', 'IAULBHM', 'IAULBHN', 'IAULBIM', 'IAULBIN', 'IAULCGM', 'IAULCGN', 'IAULCHM', 'IAULCHN', 'IAULCIM', 'IAULCIN', 'IA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M', 'IBTLCGN', 'IBTLCHM', 'IBTLCHN', 'IBTLCIM', 'IBTLCIN', 'IBUJAGM', 'IBUJAGN', 'IBUJAHM', 'IBUJAHN', 'IBUJAIM', 'IBUJAIN', 'IBUJBGM', 'IBUJBGN', 'IBUJBHM', 'IBUJBHN', 'IBUJBIM', 'IBUJBIN', 'IBUJCGM', 'IBUJCGN', 'IBUJCHM', 'IBUJCHN', 'IBUJCIM', 'IBUJCIN', 'IBUKAGM', 'IBUKAGN', 'IBUKAHM', 'IBUKAHN', 'IBUKAIM', 'IBUKAIN', 'IBUKBGM', 'IBUKBGN', 'IBUKBHM', 'IBUKBHN', 'IBUKBIM', 'IBUKBIN', 'IBUKCGM', 'IBUKCGN', 'IBUKCHM', 'IBUKCHN', 'IBUKCIM', 'IBUKCIN', 'IBULAGM', 'IBULAGN', 'IBULAHM', 'IBULAHN', 'IBULAIM', 'IBULAIN', 'IBULBGM', 'IBULBGN', 'IBULBHM', 'IBULBHN', 'IBULBIM', 'IBULBIN', 'IBULCGM', 'IBULCGN', 'IBULCHM', 'IBULCHN', 'IBULCIM', 'IBULCIN', 'IBVJAGM', 'IBVJAGN', 'IBVJAHM', 'IBVJAHN', 'IBVJAIM', 'IBVJAIN', 'IBVJBGM', 'IBVJBGN', 'IBVJBHM', 'IBVJBHN', 'IBVJBIM', 'IBVJBIN', 'IBVJCGM', 'IBVJCGN', 'IBVJCHM', 'IBVJCHN', 'IBVJCIM', 'IBVJCIN', 'IBVKAGM', 'IBVKAGN', 'IBVKAHM', 'IBVKAHN', 'IBVKAIM', 'IBVKAIN', 'IBVKBGM', 'IBVKBGN', 'IBVKBHM', 'IBVKBHN', 'IBVKBIM', 'IBVKBIN', 'IBVKCGM', 'IBVKCGN', 'IBVKCHM', 'IBVKCHN', 'IBVKCIM', 'IBVKCIN', 'IBVLAGM', 'IBVLAGN', 'IBVLAHM', 'IBVLAHN', 'IBVLAIM', 'IBVLAIN', 'IBVLBGM', 'IBVLBGN', 'IBVLBHM', 'IBVLBHN', 'IBVLBIM', 'IBVLBIN', 'IBVLCGM', 'IBVLCGN', 'IBVLCHM', 'IBVLCHN', 'IBVLCIM', 'IBVLCIN', 'ICTJAGM', 'ICTJAGN', 'ICTJAHM', 'ICTJAHN', 'ICTJAIM', 'ICTJAIN', 'ICTJBGM', 'ICTJBGN', 'ICTJBHM', 'ICTJBHN', 'ICTJBIM', 'ICTJBIN', 'ICTJCGM', 'ICTJCGN', 'ICTJCHM', 'ICTJCHN', 'ICTJCIM', 'ICTJCIN', 'ICTKAGM', 'ICTKAGN', 'ICTKAHM', 'ICTKAHN', 'ICTKAIM', 'ICTKAIN', 'ICTKBGM', 'ICTKBGN', 'ICTKBHM', 'ICTKBHN', 'ICTKBIM', 'ICTKBIN', 'ICTKCGM', 'ICTKCGN', 'ICTKCHM', 'ICTKCHN', 'ICTKCIM', 'ICTKCIN', 'ICTLAGM', 'ICTLAGN', 'ICTLAHM', 'ICTLAHN', 'ICTLAIM', 'ICTLAIN', 'ICTLBGM', 'ICTLBGN', 'ICTLBHM', 'ICTLBHN', 'ICTLBIM', 'ICTLBIN', 'ICTLCGM', 'ICTLCGN', 'ICTLCHM', 'ICTLCHN', 'ICTLCIM', 'ICTLCIN', 'ICUJAGM', 'ICUJAGN', 'ICUJAHM', 'ICUJAHN', 'ICUJAIM', 'ICUJAIN', 'ICUJBGM', 'ICUJBGN', 'ICUJBHM', 'ICUJBHN', 'ICUJBIM', 'ICUJBIN', 'ICUJCGM', 'ICUJCGN', 'ICUJCHM', 'ICUJCHN', 'ICUJCIM', 'ICUJCIN', 'ICUKAGM', 'ICUKAGN', 'ICUKAHM', 'ICUKAHN', 'ICUKAIM', 'ICUKAIN', 'ICUKBGM', 'ICUKBGN', 'ICUKBHM', 'ICUKBHN', 'ICUKBIM', 'ICUKBIN', 'ICUKCGM', 'ICUKCGN', 'ICUKCHM', 'ICUKCHN', 'ICUKCIM', 'ICUKCIN', 'ICULAGM', 'ICULAGN', 'ICULAHM', 'ICULAHN', 'ICULAIM', 'ICULAIN', 'ICULBGM', 'ICULBGN', 'ICULBHM', 'ICULBHN', 'ICULBIM', 'ICULBIN', 'ICULCGM', 'ICULCGN', 'ICULCHM', 'ICULCHN', 'ICULCIM', 'ICULCIN', 'ICVJAGM', 'ICVJAGN', 'ICVJAHM', 'ICVJAHN', 'ICVJAIM', 'ICVJAIN', 'ICVJBGM', 'ICVJBGN', 'ICVJBHM', 'ICVJBHN', 'ICVJBIM', 'ICVJBIN', 'ICVJCGM', 'ICVJCGN', 'ICVJCHM', 'ICVJCHN', 'ICVJCIM', 'ICVJCIN', 'ICVKAGM', 'ICVKAGN', 'ICVKAHM', 'ICVKAHN', 'ICVKAIM', 'ICVKAIN', 'ICVKBGM', 'ICVKBGN', 'ICVKBHM', 'ICVKBHN', 'ICVKBIM', 'ICVKBIN', 'ICVKCGM', 'ICVKCGN', 'ICVKCHM', 'ICVKCHN', 'ICVKCIM', 'ICVKCIN', 'ICVLAGM', 'ICVLAGN', 'ICVLAHM', 'ICVLAHN', 'ICVLAIM', 'ICVLAIN', 'ICVLBGM', 'ICVLBGN', 'ICVLBHM', 'ICVLBHN', 'ICVLBIM', 'ICVLBIN', 'ICVLCGM', 'ICVLCGN', 'ICVLCHM', 'ICVLCHN', 'ICVLCIM', 'ICVLCIN']

你可能会注意到我在学校0->'O',1->'1'。如果这不能取悦你,请改变你的文字。

答案 1 :(得分:11)

Mathematica,87个字符 -

版本3(生成有效英文单词)下面的奖励曲目

此版本包含当前列出的Q,连字符和空格规则。

#<>""&/@Tuples@Join[{{"-"},{" "}},"A"~CharacterRange~"Y"~Drop~{17}~Partition~3][[#+1]]&

Mathematica:98个字符

 k[x_]:=Tuples[Table[Union[{{"-"},{1}},
           Partition[CharacterRange["A","Y"],3]][[(x+1)[[i]]]],{i,1,7}]]

请注意loooong名字

用法

     k[{4,2,8,5,2,4,6}]

编辑&gt;

仅输出唯一案例。 计算唯一序列:

     Length[k[{4,2,8,5,2,4,6}]]

修改

版本2:96个字符

 k[x_]:=Tuples[Table[Union[{{"-"},{1}},
           Partition[CharacterRange["A","Y"],3]][[(x+1)[[i]]]],{i,1}]]


第3版:奖金追踪 - 生成有效的英文单词



我认为Mathematica非常强大,但对于速记竞争来说过于冗长。无论如何,在鞠躬和离开“比赛”之前,我想出现一个更多的功能,只是为了娱乐,并检查声明“奖励点是否因为将输出识别为真正的英语单词而获奖。好吧,不是真的。 - )“是否属实。

代码是:

d[x_] := Join @@ (DictionaryLookup[# <> ""] & /@ 
    Tuples@Join[{{"-"}, {" "}}, 
       "a"~CharacterRange~"y"~Drop~{17}~Partition~3][[x + 1]])

使用

调用时
d[{7, 2, 3, 4, 7, 8, 4, 2}] 

结果是

{"sadistic"}  

使用

调用时
d[{2,6,8,2,4}]  

结果是

{"botch", "couch"}

打电话
d[{3, 2, 4, 5}]

结果是

{"fail"}

很好,不是吗?

答案 2 :(得分:9)

q, 52 39 chars

(cross/)(3 cut"--- ",.Q.A except"QZ")

q在左边评估。

.Q.A包含矢量“ABC ... XYZ”

除了返回x,不包括y

中的值

将“---”加入修改后的char矢量

切成3块

cross返回所有可能的组合,并应用于所有块

q)(cross/)(3 cut"---   ",.Q.A except"QZ")[4 2 8 5 2 4 6] 
"GATJAGM"
"GATJAGN"
"GATJAGO"
"GATJAHM"
"GATJAHN"
"GATJAHO"
"GATJAIM"
"GATJAIN"
"GATJAIO"
....

答案 3 :(得分:5)

J,60 62 65 67 个字符

~.('---   ','Q'(~:#])25{.65|.a.){~((7$3)#:i.3^7)+"1]3*"."0":

使用Nick's Modified North American Classic Key Pad。

   ~.('---   ','Q'(~:#])25{.65|.a.){~((7$3)#:i.3^7)+"1]3*"."0":4285246
...
ICTJCHM
ICTJCHN
ICTJCHO
ICTJCIM
ICTJCIN
ICTJCIO
ICTKAGM
ICTKAGN
ICTKAGO
ICTKAHM
ICTKAHN
ICTKAHO
ICTKAIM
ICTKAIN
ICTKAIO
ICTKBGM
ICTKBGN
ICTKBGO
ICTKBHM
ICTKBHN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VJBGN
ICVJBGO
ICVJBHM
ICVJBHN
ICVJBHO
ICVJBIM
ICVJBIN
ICVJBIO
ICVJCGM
ICVJCGN
ICVJCGO
ICVJCHM
ICVJCHN
ICVJCHO
ICVJCIM
ICVJCIN
ICVJCIO
ICVKAGM
ICVKAGN
ICVKAGO
ICVKAHM
ICVKAHN
ICVKAHO
ICVKAIM
ICVKAIN
ICVKAIO
ICVKBGM
ICVKBGN
ICVKBGO
ICVKBHM
ICVKBHN
ICVKBHO
ICVKBIM
ICVKBIN
ICVKBIO
ICVKCGM
ICVKCGN
ICVKCGO
ICVKCHM
ICVKCHN
ICVKCHO
ICVKCIM
ICVKCIN
ICVKCIO
ICVLAGM
ICVLAGN
ICVLAGO
ICVLAHM
ICVLAHN
ICVLAHO
ICVLAIM
ICVLAIN
ICVLAIO
ICVLBGM
ICVLBGN
ICVLBGO
ICVLBHM
ICVLBHN
ICVLBHO
ICVLBIM
ICVLBIN
ICVLBIO
ICVLCGM
ICVLCGN
ICVLCGO
ICVLCHM
ICVLCHN
ICVLCHO
ICVLCIM
ICVLCIN
ICVLCIO

答案 4 :(得分:5)

的Haskell:


只是一个纯函数(69 78 chars)::

f=mapM(\x->("-":" ":words"ABC DEF GHI JKL MNO PRS TUV WXY")!!read[x])

用法:

Prelude> f "626"
["MAM","MAN","MAO","MBM","MBN","MBO","MCM","MCN","MCO","NAM","NAN","NAO","NBM","NBN","NBO","NCM","NCN","NCO","OAM","OAN","OAO","OBM","OBN","OBO","OCM","OCN","OCO"]

作为一个完整的程序(93 102 chars)::

main=getLine>>=mapM print.mapM(\x->("-":" ":words"ABC DEF GHI JKL MNO PRS TUV WXY")!!read[x])

用法:

~$ ./a.out
626
"MAM"
"MAN"
"MAO"
"MBM"
"MBN"
"MBO"
"MCM"
"MCN"
"MCO"
"NAM"
"NAN"
"NAO"
"NBM"
"NBN"
"NBO"
"NCM"
"NCN"
"NCO"
"OAM"
"OAN"
"OAO"
"OBM"
"OBN"
"OBO"
"OCM"
"OCN"
"OCO"

[...,"PRS","TUV","WXY"]替换为[...,"PQRS","TUV","WXYZ"]以获取国际键盘,+ 2个字符。

print替换为putStrLn以删除输出中的引号,+ 3个字符。

仅添加符号和单词之间的换行符和空格以删除水平滚动条。

答案 5 :(得分:3)

Perl,101个字符:

这会滥用glob运算符<{a,b,c}{d,e,f}>来计算笛卡尔乘积:

$,=$/;print eval"<{".(join"}{",map{s/\B/,/g;$_}           # wrapped to fit
map{(0,1,join("",A..Z)=~/...S?Z?/g)[$_]}pop=~/./g)."}>" 

作为一个程序(111个字符):

perl -e'$,=$/;print eval"<{".(join"}{",map{s/\B/,/g;$_}map{(0,1,join("",A..Z)=~/...S?Z?/g)[$_]}pop=~/./g)."}>"' 4285246

编辑:合并了mobrule的建议

答案 6 :(得分:2)

Python, 157 139 119 chars:

选项卡和换行符......;)
现在使用“Nick's Modified Keypad”

def p(a,b=''):
 if a:[p(a[1:],b+c)for c in '-, ,ABC,DEF,GHI,JKL,MNO,PRS,TUV,WXY'.split(',')[int(a[0])]];return
 print b

用法:(+ 12c)

p('4285246')

答案 7 :(得分:1)

Ruby,109个字符

l=%w{- \  ABC DEF GHI JKL MN PRS TUV WXY};p$_.chars.map{|d|[*l[d.to_i].chars]}.reduce(&:product).map{|x|x*""}

用法:

echo "2345678" | ruby -lne 'l=%w{- \  ABC DEF GHI JKL MN PRS TUV WXY};p$_.chars.map{|d|[*l[d.to_i].chars]}.reduce(&:product).map{|x|x*""}'

“2345678”的结果 - 长度1458

ADGJMPT
ADGJMPU
ADGJMPV
ADGJMRT
ADGJMRU
ADGJMRV
ADGJMST
ADGJMSU
ADGJMSV
ADGJNPT
ADGJNPU
ADGJNPV
ADGJNRT
ADGJNRU
ADGJNRV
ADGJNST
ADGJNSU
ADGJNSV
ADGKMPT
ADGKMPU
ADGKMPV
ADGKMRT
ADGKMRU
ADGKMRV
ADGKMST
ADGKMSU
ADGKMSV
ADGKNPT
ADGKNPU
ADGKNPV
ADGKNRT
ADGKNRU
ADG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U
CFGLNSV
CFHJMPT
CFHJMPU
CFHJMPV
CFHJMRT
CFHJMRU
CFHJMRV
CFHJMST
CFHJMSU
CFHJMSV
CFHJNPT
CFHJNPU
CFHJNPV
CFHJNRT
CFHJNRU
CFHJNRV
CFHJNST
CFHJNSU
CFHJNSV
CFHKMPT
CFHKMPU
CFHKMPV
CFHKMRT
CFHKMRU
CFHKMRV
CFHKMST
CFHKMSU
CFHKMSV
CFHKNPT
CFHKNPU
CFHKNPV
CFHKNRT
CFHKNRU
CFHKNRV
CFHKNST
CFHKNSU
CFHKNSV
CFHLMPT
CFHLMPU
CFHLMPV
CFHLMRT
CFHLMRU
CFHLMRV
CFHLMST
CFHLMSU
CFHLMSV
CFHLNPT
CFHLNPU
CFHLNPV
CFHLNRT
CFHLNRU
CFHLNRV
CFHLNST
CFHLNSU
CFHLNSV
CFIJMPT
CFIJMPU
CFIJMPV
CFIJMRT
CFIJMRU
CFIJMRV
CFIJMST
CFIJMSU
CFIJMSV
CFIJNPT
CFIJNPU
CFIJNPV
CFIJNRT
CFIJNRU
CFIJNRV
CFIJNST
CFIJNSU
CFIJNSV
CFIKMPT
CFIKMPU
CFIKMPV
CFIKMRT
CFIKMRU
CFIKMRV
CFIKMST
CFIKMSU
CFIKMSV
CFIKNPT
CFIKNPU
CFIKNPV
CFIKNRT
CFIKNRU
CFIKNRV
CFIKNST
CFIKNSU
CFIKNSV
CFILMPT
CFILMPU
CFILMPV
CFILMRT
CFILMRU
CFILMRV
CFILMST
CFILMSU
CFILMSV
CFILNPT
CFILNPU
CFILNPV
CFILNRT
CFILNRU
CFILNRV
CFILNST
CFILNSU
CFILNSV

答案 8 :(得分:0)

Python 243字符

pad = [" ","-","ABC","DEF","GHI","JKL","MN","PRS","TUV","WXY"]
def c(p,v):
  try:
    if 1>len(v):print p;return        
    map(lambda a:c(p+a,v[1:]),pad[int(v[0])])
  except:
    p(p+"-",v[1:])        
c("","4285246")