编写魔术拼写检查器


14

游戏《挥舞的双手》介于纸笔魔术:聚会和精心制作的剪刀石头布之间。每转一圈,您就为每个手写下八个手势之一:

  • 扭动的F
  • 提供的Palm
  • S小憩
  • Wave
  • D指点
  • C圈数
  • staB
  • N整理

几乎没有其他重要的优先规则:

  • 如果双手示意,P您将自动投降。(这是一种简化,但是我们继续。)
  • 一次只能用一只手做手势B

同一只手执行的一系列手势可以投射一个咒语,其中每个咒语都与一个特定序列相关。这些序列可以重叠,但是每个手势只能用作单个咒语的最终手势(因此,您一次最多可以创建两个咒语)。有些咒语要求双手同时做出手势。

您的任务是给定每只手的手势列表,以确定在当前回合中可以施放哪些咒语。对于每只手,列表中的最后一个字母代表当前回合选择的手势。

这是手势序列的列表。大写字母表示单手执行的手势,小写字母表示双手进行的手势。

B           Stab
cDPW        Dispel magic               
cSWWS       Summon elemental           
cw          Magic mirror               
DFFDD       Lightning bolt             
DFPW        Cure heavy wounds          
DFW         Cure light wounds          
DPP         Amnesia                    
DSF         Confusion                  
DSFFFc      Disease                    
DWFFd       Blindness                  
DWSSSP      Delayed effect             
DWWFWc      Raise dead                 
DWWFWD      Poison                     
FFF         Paralysis                  
FPSFW       Summon troll               
FSSDD       Fireball                   
P           Shield                     
p           Surrender                  
PDWP        Remove enchantment         
PPws        Invisibility               
PSDD        Charm monster              
PSDF        Charm person
PSFW        Summon ogre
PWPFSSSD    Finger of death
PWPWWc      Haste
SD          Missile
SFW         Summon goblin
SPF         Antispell
SPFPSDW     Permanency
SPPc        Time stop
SSFP        Resist cold
SWD         Fear
SWWc        Fire storm
WDDc        Lightning bolt
WFP         Cause light wounds
WFPSFW      Summon giant
WPFD        Cause heavy wounds
WPP         Counterspell
WSSc        Ice storm
WWFP        Resist heat
WWP         Protection from evil
WWS         Counterspell

是的,Lightning bolt而且Counterspell各有两个不同的序列。

您可以编写程序或函数,只要不经过预处理,就可以通过STDIN,命令行参数或函数参数以任何方便的列表或字符串格式接受输入。您可以通过返回值或通过打印到STDOUT输出成对的咒语。同样,您可以使用任何方便的列表或字符串格式,只要输出是明确的即可。

您可以假设左右手的序列长度相同,并且它们是有效的(尤其是B永远不会由两只手同时执行)。请注意,输入将包含大写字母。小写字母仅在上面的列表中使用,表示两只手需要执行相同的(大写)手势。

对于以双手手势结尾的咒语,您应该只输出一个咒语。如果一只手无法执行咒语,则需要用仅包含连字符的字符串来表示,-

这是代码高尔夫球,因此最短的答案(以字节为单位)获胜。

例子

每个示例包括三行:左手序列,右手序列(均为输入;最右边的手势为最新手势)以及所有可能的拼写组合的列表(输出)。

WFP
WWS
[["Cause light wounds","Counterspell"],["Shield","Counterspell"]]

SD
BB
[["Missile","Stab"]]

WWP
WPP
[["Surrender"]]

DFW
CCW
[["Cure light wounds","-"]]

FFW
WWF
[["-","-"]]

DCW
CCW
[["Magic mirror"]]

WFPSFW
PPDDPP
[["Summon goblin","Shield"],["Summon ogre","Shield"],["Summon troll","Shield"],
 ["Summon giant","Shield"],["Summon goblin","Amnesia"],["Summon ogre","Amnesia"],
 ["Summon troll","Amnesia"],["Summon giant","Amnesia"]]

BSWWS
CSWWS
[["Counterspell","Counterspell"]]

CSWWS
CSWWS
[["Counterspell","Counterspell"],["Counterspell","Summon elemental"],
 ["Summon elemental","Counterspell"],["Summon elemental","Summon elemental"]]

PWPWWC
BBSPPC
[["Haste"],["Time stop"]]

@TheBestOne“尤其是,B永远不会由两只手同时执行”
Martin Ender 2014年

Answers:


3

CJam,987个931 925 663字节

qN/:Q;"Üãã0Ш¬Áó:-/ð1$½Ï¶¶òu´dóá3äÑì?´ì>³3cïCà×M×âÀCÒû¬u?xO,ÆFv)pÙû!¼ eÖUÈRÙnÂo/µ¾H¼RÎÚç¡ñ>z"32f-222bCb" BcDPWSwFdps"f=S/"[zõs¢@>2¯f¥sy<éSGÆÄbÚØÜ}}¤ºÅd¸(EWfa¤éõbfXpÀS7éÛM¼å© Ñæ¶a«I³þ>ÙÜ¡/¦$lâ µãÆØ¢§&á¼óÀwÏU¤ôYðçQòÔR#pÓzP×°~ï]v«viÚY¶¨¯`|o(Nê@æGÏ]ÌÉþMNÒÀ2yÌgÊ]Ê4Ê|BÃKWãIowIQ£Í-,_¥÷¶ºK-;Kr ÕtVæWï÷¦?+ÜÌÜó˯çp2Mvmc!hàtc»¬}sIæTÌÂ&ë6º²>Nº¯¦F¤½{ÜOSµ¸Ñ'|`²P³íD¿Z.c¢ Ò¿ñÅ¢MRöDk?à§iõ;­¡k'çTÑñ"31f-225b26b97f+:c"j"Ser'z/{(eu\+}%]z_{{~SaQX={_QV=W):W=={_el+m*}{m*:s}?}/:s{S+2$S+#)1$"-":D?@@}%-2<}%1:V(:X(:W;\}2*m*{z_,1>{)__~=\Da&,!={a+}{;}?$W>}*~}%_&_,({[D_]a-}*_{{`D&,!},}:A~,{A}*_["Surrender"_]a:S&,{;S}*p

请注意,这仅包含ASCII码32至255的所有ASCII字符。SE可能会跳过某些字符,因此最好从上面的链接复制代码

上面的代码是以下925字节解决方案的基本转换版本:

qN/:Q;
"B|Stab|cDPW|Dispel magic|cSWWS|Summon elemental|cw|Magic mirror|DFFDD|Lightning bolt|DFPW|Cure heavy wounds|DFW|Cure light wounds|DPP|Amnesia|DSF|Confusion|DSFFFc|Disease|DWFFd|Blindness|DWSSSP|Delayed effect|DWWFWc|Raise dead|DWWFWD|Poison|FFF|Paralysis|FPSFW|Summon troll|FSSDD|Fireball|P|Shield|p|""Surrender":R"|PDWP|Remove enchantment|PPws|Invisibility|PSDD|Charm monster|PSDF|Charm person|PSFW|Summon ogre|PWPFSSSD|Finger of death|PWPWWc|Haste|SD|Missile|SFW|Summon goblin|SPF|Antispell|SPFPSDW|Permanency|SPPc|Time stop|SSFP|Resist cold|SWD|Fear|SWWc|Fire storm|WDDc|Lightning bolt|WFP|Cause light wounds|WFPSFW|Summon giant|WPFD|Cause heavy wounds|WPP|Counterspell|WSSc|Ice storm|WWFP|Resist heat|WWP|Protection from evil|WWS|Counterspell"]s'|/2/_
{{~SaQX={_QV=W):W=={_el+m*}{m*:s}?}/:s{S+2$S+#)1$"-":D?@@}%-2<}%1:V(:X(:W;\}2*
m*{z_,1>{)__~=\Da&,!={a+}{;}?$W>}*~}%_&
_,({[D_]a-}*_{{`D&,!},}:A~,{A}*
_[R_]a:S&,{;S}*p

换行仅用于显示。这可以打很多,但至少我通过了所有测试用例-_-。

这花费了比预期更长的时间。

UPDATE 1-稍微修改一下代码部分。仍然有更多的空间。琴弦部分也可以打高尔夫球/打底,但由于其他所有答案也都没有,我现在将避免这样做。

更新2-完成代码打高尔夫球,现在该压缩字符串了。

更新3 -Base转换字符串以将代码大小减少到663字节(可以减少到640字节,但是然后还有0到31个ASCII代码字符,这确实很难处理,我只会留在它们身上当我再次遭到殴打时)。

在这里在线尝试


4

蟒蛇2,685

定义一个f接受两个字符串的函数。返回值是字符串Surrender如果玩家投降,则。否则,由字符串(表示双手拼写法)和长度为2的字符串元组(表示每只手分别表示法术)组成的集合。

Base64编码的源:

I2VuY29kaW5nOkxhdGluCmV4ZWMiIiJ42mVTTWvjMBC951foJntxy+61iwtNjLqFLJhqQYeQg2KPbYEsBUlOGtrub98Zp6Efe7Lm6c2H3jyvy9Y0KVuWXCa940VT1arklYl7sGzUvWkQk0pJJEzj6B0DCyO4pC0vKiGqquRr0w/JGdeznbeJYKqxmgKwAfThxI5+cm2kiwtuKeUdr+uS340OotEYSYEs77opGu8wVlJKJFRg9QlaBl0HXHK1UUoobF97E4knBObVOmh7igarilpSv7exU/AWRxZS0sjCBNhpArCwHAzYFo+VwugRRn9cMAauGbRL9FS8mZNWgw4jw2IxQZhBcQH3EOYZPrX0fVwwhFSNTeXc1PUQmO9YCzpccrwg8LeJ0Vjkfczs/c4aLCdr7HDn0rwOO8fYFXk1hFE7nPGEoBTz2PjoxBpPL5Gki1wwjVMqulzpKX4VXX3WpzeaXorDVhf+5+UpWtIKA3z82zhKfeiMbMonCevgE64It8e64EcGBzOz5ZcC+eK+tHrctZrZIhTrm+f1Jm47H1hkxrE1Mx2z14DtjyZcclm8nvYodJbn2rUMt5eFzV+zLctIn8ulD1zz2xmiSoYqBY3KZxZcFvM8f10sz65vjqg/eZyNJgRMJO8J0cw/XDDoCGQyIdqSL3EdLfozvtkOKY8aObRJck59jCV/cAcTzc5Yk07z3hXxfmm0C62uxuCPGYHF5Pe0I7olIxIQRhSoqpr//yZ0P6IPzYWWL3CeK75ooWNdhrrlN015T4dimb/cZ6GwePgZIE3BbZqX5+ypOOUkxRNJcWauUSbWMkJPZ5TSzujr1XPWFm3+bRasyW+/568F2iQE3AQaf7uxm6sfKHs4f3jNt/9cMNXTZmIiIiIuZGVjb2RlKCd6aXAnKQ==

源具有exec "eu352909HE%#NTHQh".decode('zip')执行以下代码的形式:

L=dict(B='Stab',cDPW='Dispel magic',cSWWS='Summon elemental',DFFDD='Lightning bolt',DFPW='Cure heavy wounds',DFW='Cure light wounds',DPP='Amnesia',DSF='Confusion',DWSSSP='Delayed effect',DWWFWD='Poison',FFF='Paralysis',FPSFW='Summon troll',FSSDD='Fireball',P='Shield',PDWP='Remove enchantment',PSDD='Charm monster',PSDF='Charm person',PSFW='Summon ogre',PWPFSSSD='Finger of death',SD='Missile',SFW='Summon goblin',SPF='Antispell',SPFPSDW='Permanency',SSFP='Resist cold',SWD='Fear',WFP='Cause light wounds',WFPSFW='Summon giant',WPFD='Cause heavy wounds',WPP='Counterspell',WWFP='Resist heat',WWP='Protection from evil',WWS='Counterspell')
G=lambda l,r,L:{L[s]for s in L if l.endswith(s.upper())and all(r[~i]==s[~i].upper()or'a'>s[~i]for i in range(len(s)))}
B=dict(cw='Magic mirror',DSFFFc='Disease',DWFFd='Blindness',DWWFWc='Raise dead',PPws='Invisibility',PWPWWc='Haste',SPPc='Time stop',SWWc='Fire storm',WDDc='Lightning bolt',WSSc='Ice storm')
d='-'
def f(l,r):c=G(l,r,B)|G(r,l,B);return[c|{(x,y)for x in G(l,r,L)or d for y in G(r,l,L)or d}-{(d,d)*(len(c)>0)},'Surrender'][l[-1]==r[-1]=='P']

@FryAmTheEggman已修复。
feersum 2014年

啊哈,巧妙地使用集合来解决问题:)
FryAmTheEggman 2014年

2

Java 1565 1388

致电java M %leftString %rightStringSurrender如果玩家投降则输出。否则以这种形式输出字符串bothHandSpell;oneHandSpell,oneHandSpell;...。请注意,这是一个相当复杂的问题的单一解决方案。:)

class M{String[]a="B,cDPW,cSWWS,DFFDD,DFPW,DFW,DPP,DSF,DWSSSP,DWWFWD,FFF,FPSFW,FSSDD,P,PDWP,PSDD,PSDF,PSFW,PWPFSSSD,SD,SFW,SPF,SPFPSDW,SSFP,SWD,WFP,WFPSFW,WPFD,WPP,WWFP,WWP,WWS,-".split(","),b="Stab,Dispel Magic,Summon elemental,Lightning bolt,Cure heavy wounds,Cure light wounds,Amnesia,Confusion,Delayed effect,Poison,Paralysis,Summon troll,Fireball,Shield,Remove enchantment,Charm monster,Charm person,Summon ogre,Finger of death,Missile,Summon goblin,Antispell,Permanency,Resist cold,Fear,Cause light wounds,Summon Giant,Cause heavy wounds,Counterspell,Resist heat,Protection from evil,Counterspell,-".split(","),c="cw,DSFFFc,DWFFd,DWWFWc,PPws,PWPWWc,SPPc,SWWc,WDDc,WSSc".split(",");public static void main(String[]a){System.out.println(new M().s(a[0],a[1]));}int e,f,g,h,i,j,k,l,m,n;String s(String o,String p){if(m(o,p,"p")>0)return"Surrender";String q="";f=e=0;for(;f<10;f++)q+=(m(o,p,c[f])|m(p,o,c[f]))>0?"Magic mirror,Disease,Blindness,Raise dead,Invisibility,Haste,Time stop,Fire storm,Lightning Bolt,Ice storm".split(",")[f*(e=1)]+";":"";for(f=0;f<33-e;f++)for(g=f<1?1:0,h=0;g<32-h&m(o,p,a[f])>0;)q+=m(p,o,a[++g*(e=1)])>0?b[f]+","+b[g*(h=1)]+";":"";return q;}int m(String o,String p,String r){k=n=0;if(r=="-")n=1;if((i=o.length())<(j=r.length()))return n;for(;k<j;)n|=((o.charAt(l=i-j+k)|32)!=((m=r.charAt(k++))|32)|((m|32)==m&(p.charAt(l)|32)!=(m|32)))?2:0;return n==2?0:1;}}

缩进:

class M{

    String[]a="B,cDPW,cSWWS,DFFDD,DFPW,DFW,DPP,DSF,DWSSSP,DWWFWD,FFF,FPSFW,FSSDD,P,PDWP,PSDD,PSDF,PSFW,PWPFSSSD,SD,SFW,SPF,SPFPSDW,SSFP,SWD,WFP,WFPSFW,WPFD,WPP,WWFP,WWP,WWS,-".split(","),b="Stab,Dispel Magic,Summon elemental,Lightning bolt,Cure heavy wounds,Cure light wounds,Amnesia,Confusion,Delayed effect,Poison,Paralysis,Summon troll,Fireball,Shield,Remove enchantment,Charm monster,Charm person,Summon ogre,Finger of death,Missile,Summon goblin,Antispell,Permanency,Resist cold,Fear,Cause light wounds,Summon Giant,Cause heavy wounds,Counterspell,Resist heat,Protection from evil,Counterspell,-".split(","),c="cw,DSFFFc,DWFFd,DWWFWc,PPws,PWPWWc,SPPc,SWWc,WDDc,WSSc".split(",");

    public static void main(String[]a){
        System.out.println(new M().s(a[0],a[1]));
    }

    int e,f,g,h,i,j,k,l,m,n;

    String s(String o,String p){
        if(m(o,p,"p")>0)
            return"Surrender";
        String q="";
        f=e=0;
        for(;f<10;f++)
            q+=(m(o,p,c[f])|m(p,o,c[f]))>0?"Magic mirror,Disease,Blindness,Raise dead,Invisibility,Haste,Time stop,Fire storm,Lightning Bolt,Ice storm".split(",")[f*(e=1)]+";":"";
        for(f=0;f<33-e;f++)
            for(g=f<1?1:0,h=0;g<32-h&m(o,p,a[f])>0;)
                q+=m(p,o,a[++g*(e=1)])>0?b[f]+","+b[g*(h=1)]+";":"";
        return q;
    }

    int m(String o,String p,String r){
        k=n=0;
        if(r=="-")
            n=1;
        if((i=o.length())<(j=r.length()))
            return n;
        for(;k<j;)
            n|=((o.charAt(l=i-j+k)|32)!=((m=r.charAt(k++))|32)|((m|32)==m&(p.charAt(l)|32)!=(m|32)))?2:0;
        return n==2?0:1;
    }

}

编辑:使用彼得的建议以更少的代码创建一个String数组。

任何改进的提示将不胜感激。


这种通用技术将为您节省几百个字符。
彼得·泰勒

1

JavaScript(ES6),1070 941

Base64编码:

Zj0obCxyKT0+e3k9WyItIl0sRD1bXSxSPVtdLEw9W10sZD17fSxidG9hKGBK1pvQHQOKyl6XWZqCJzRwM9bRK6aaifV6V6Z6e1qXRxJZZLQxqCJzWaKuuivRzDQuKCG2eKeDVuiW3QMUUMPQK6t7WF5q/LXCi6d2zQMU9bQK6t7WWKCG3XCi6d2zQMVbQCad6yJrQM8/QKid+6yKifQKIXQOKx5qx7QKIUUVzQGWKd2d6yzQNYUV3QN6VrJ53V5995y3QNZJJI/RFqKx7V15p3QKZYVZzQ+iKyifQNZYVYPQ9qtqXFysis0FFF0Summon1troll0FPSFW0Fireball0FSSDD0Shield0P0Surrender0p0Remove1enchantment0PDWP0Invisibility0PPws0Charm1monster0PSDD0Charm1person0PSDF0Summon1ogre0PSFW0Finger1of1death0PWPFSSSD0Haste0PWPWWc0Missile0SD0Summon1goblin0SFW0Antispell0SPF0Permanency0SPFPSDW0Time1stop0SPPc0Resist1cold0SSFP0Fear0SWD0Fire1storm0SWWc0Lightning1bolt0WDCs0Cause1light1wounds0WFP0Summon1giant0WFPSFW0Cause1heavy1xcKLp3bNFjxQ9AqLp7Xq7KXpZdFjz9CHHtbLaK5tFkknNEXrIrLdYXmrdFlhT9D66LXnLYqJ9X66JtXr4pdFlj9AqLp7Xq7KXpZdFlkmApLnJlcGxhY2UoLzEvZywiICIpLnNwbGl0KDApLmV2ZXJ5KCh2LHgsYSk9PmRbeCUyfHxhW3grMV1dPXYpO2s9KGgsbyxHKT0+KG49ZFtzXSxxPWgubWF0Y2gocysiJCIsImkiKSkmJlsuLi5zXS5ldmVyeSgoYyxpKT0+ISh3PWMubWF0Y2goIlthLXpdIikpfHxoW2o9aStoLnNlYXJjaChxKV09PW9bal0pJiYodz9+fkQuaW5kZXhPZihuKT9EOltdOkcpLnB1c2gobik7Zm9yKHMgaW4gZCl7ayhsLHIsTCk7ayhyLGwsUik7aWYoRD09ZFsicCJdKXJldHVybiBEfVI9Ui0xP3k6UjtMPUwtMT95Okw7cmV0dXJuIEQtMXx8UiE9TD9MLnNvbWUocz0+Ui5zb21lKHQ9PiFELnB1c2goW3MsdF0pKSl8fEQ6RH0=

您可以通过eval(atob("Zj0obCxyK..."))在Firefox控制台中运行来运行它。

压缩的代码(可能包括Stack Exchange不支持的字符):

f=(l,r)=>{y=["-"],D=[],R=[],L=[],d={},btoa(`JÖÐÊ^Y'4p3ÖÑ+¦õzW¦z{ZGYd´1¨"sY¢®º+ÑÌ4.(!¶x§VèÝPÃÐ+«{X^jüµÂ§vÍõ´
êÞÖX Ýp¢éݳ@Å[@&ë"k@Ï?@¨û¬ô
!t+jÇ´
!EÍ)Ýë,Ð5ÝzV²yÝ^}÷·@ÖI$Ñ¢±í]y§t
eYÍ¢+(@ÖXUÐö«j\\¬Í]ºi¨[k¢Ytô[Ab­æÚ]I ÃÑ(bzWt?D®®·§uêô§D^ÞÕéÜ©íéíÐðÖ?B'¾+"n)b·-?4
«Y¨Ë^¯CÒ=ªæÖ«²ô= ÅÑ+¦õ¢
ÞÐô[Ab«Öõuæ­CÖ<TH=jË^ÐõYg42+,W´H=ºi¨X(nX§Ñ!VÐ   íÊ^]<]z¹éÜËDô[Dâíl¶tHóÜѬËur]Ñ$?A^j½X=·µ²Ú+DYÍm)àÕº%·E
ÍjëÖX Ýp¢éݳE?D®j'ÖÝô[@ºÇµæ¯Ë\\(ºwlÑcÅ@¨º{^®Ê^]<ýqíl¶æÑdsD^²+-Ö·Eý®^rبWë¢m^¾)tYcô
§µêì¥éeÑe`).replace(/1/g," ").split(0).every((v,x,a)=>d[x%2||a[x+1]]=v);k=(h,o,G)=>(n=d[s],q=h.match(s+"$","i"))&&[...s].every((c,i)=>!(w=c.match("[a-z]"))||h[j=i+h.search(q)]==o[j])&&(w?~~D.indexOf(n)?D:[]:G).push(n);for(s in d){k(l,r,L);k(r,l,R);if(D==d["p"])return D}R=R-1?y:R;L=L-1?y:L;return D-1||R!=L?L.some(s=>R.some(t=>!D.push([s,t])))||D:D}

由于拼写字典仅包含字母,因此我们可以将其视为base64编码的字符串,并使用数字作为分隔符和空格。我将类似于base64的字符串“解码”为二进制字符串,其大小为原始字符串的3/4。

轻度松懈:

f=(l,r)=>{

// y - default array
// D,R,L - result arrays for Doublehanded, Right and Left
// d - dictionary mapping of spell combos to spell names
y=["-"],D=[],R=[],L=[],d={},

// split string on `0` and replace `1`s with spaces, to populate `d`
btoa(`<UGLY BINARY STRING>`).replace(/1/g," ").split(0).every((v,x,a)=>d[x%2||a[x+1]]=v);

// given a main hand, off hand, and result array to populate,
// decide if current combo `s` applies
k=(h,o,G)=>
    (n=d[s],q=h.match(s+"$","i")) // does `s` match the end of `h`, case insensitive?
    &&
    [...s].every((c,i)=>
        !(w=c.match("[a-z]")) ||     // is every letter of `s` not lowercase
        h[j=i+h.search(q)]==o[j]  // or (if lowercase), a match between the hands?
    )
    &&
    (w?                    // if the last letter so `s` was lowercase
        ~~D.indexOf(n)?    //   if D doesn't already have this spell
                       D   //      add it to D
                      :    //   else
                       []  //      add it to a throwaway array
      :G).push(n);         // else, add it to this hand's result array

for(s in d){
    k(l,r,L);    // test this spell against each hand
    k(r,l,R);
    if(D==d["p"]) return D  // if the doublehanded result is "Surrender"
                            // return immediately
}

R=R-1?y:R;   // replace empty arrays with ["-"]
L=L-1?y:L;   // (`[]-1` is -1, which is truthy, while ["foo"]-1 is `NaN`, falsy)

return D-1||R!=L         // if D is empty, or R and L not both empty, 
                ?        //   add all pairwise R/L combos to D and return D
                 L.some(s=>R.some(t=>!D.push([s,t])))
                                                     ||D
                :D      //    otherwise, just return D

}

我特别喜欢的一种高尔夫是用来测试空阵array - 1

  • 空数组将产生真实值: [] - 1 => "" - 1 => 0 - 1 => -1 (truthy)
  • 填充数组将产生一个falsey值: ["foo"] - 1 => "foo" - 1 => NaN (falsey)
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.