错误在路易斯安那州经济发展的广告? [英] Bug in Louisiana Economic Development Ad?

查看:95
本文介绍了错误在路易斯安那州经济发展的广告?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我读了2011年6月发行Wired杂志的一天,我遇到了一个广告为路易斯安那州经济发展,presumably ActionScript编写。

I was reading the June 2011 issue of Wired magazine the other day, and I came across an ad for Louisiana Economic Development, presumably written in ActionScript.

我本来以为这是一个聪明的广告,但看进去后,似乎有在code相当明显的bug。

I originally thought that it was a clever ad, but after looking into it, it seems like there's a fairly obvious bug in the code.

难道只是我,或者应该破发返回

Is it just me, or should that break be a return?

推荐答案

我把它称为一个错误,因为理想的结果很可能是导航到该URL,如果这些利益中的任何一个被保持,如果什么都不做他们都不是。因此,我会改变的逻辑如下(暂时忽略从scriptocalypse注释中提到的问题):

I'd call it a bug, since the desired outcome would most likely be to navigate to the URL if any one of those interests is held and do nothing if none of them are. As such, I would change the logic to the following (ignoring for the moment the issues mentioned in the comment from scriptocalypse):

if (this.innovator.hasInterestIn(interest[i])){
    navigateToURL("www.OpportunityLouisiana.com/digital");
    return;
}

当然,

,这不会看起来不错的广告,因为该URL不会在显着的code底部显示。也许是一个更好的选择是将组织的逻辑是这样的循环:

Of course, this wouldn't look as good in an ad, since the URL wouldn't be prominently displayed at the bottom of the code. Perhaps a better alternative would be to organize the logic in the loop like this:

if (this.innovator.hasInterestIn(interest[i])){
    break;
} else if (i == n-1){
    return;
}

这篇关于错误在路易斯安那州经济发展的广告?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆