Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

提交 更多运算(numpro.js) 拓展 #197

Closed
wants to merge 0 commits into from

Conversation

MoreBugOfDog
Copy link
Contributor

@MoreBugOfDog MoreBugOfDog commented Mar 12, 2024

修复了所有review出的问题
请审核
20240406

@Arkos123
Copy link
Collaborator

那个设置哪些积木显示的窗口怎么没了,我很喜欢那个功能()

@Arkos123
Copy link
Collaborator

VUW}ZEAWZ7YH7PBZOU~TWFL
这些积木感觉都可以删除吧(因为已经有字符串扩展了)

@Arkos123
Copy link
Collaborator

image
这些感觉也可以不要了,有进制扩展了
image

@fath11
Copy link
Contributor

fath11 commented Mar 15, 2024

Here are my suggestions
image
image
image
image

everything else can stay

Copy link
Contributor

@sylarhcn sylarhcn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree with the above two suggestions on streamlining the blocks

Copy link
Contributor

@sylarhcn sylarhcn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

看起来,扩展提供了 3 个不同类型数据的处理的语法糖和一些集成 api

  1. 那是不是可以按照不同类型分成不同扩展了,我们现在不提倡搞大集合。
  2. 部分语法糖,感觉过于内聚,晦涩了。比如“取余”操作,你做成了’在 a 到 b 中循环‘,不经非常难理解, 也和我们正常环境中接触到数学知识没有匹配上。我觉得可能不是很好的设计。应该中通用易懂点。、
  3. 字符串那个块的积木,我没用没用,用成功,为什么会有单独的变量积木就是返回输入的字符串?链接积木没有使用成功。

建议在扩展讨论群中,获取其他扩展作者的建议。

@MoreBugOfDog
Copy link
Contributor Author

zh-cn:
与 bilioicik 开发完成未PR的拓展合并,已经经过 bilioicik 的同意。
修复了review出的问题。

en:
Merged with bilioicik to finish development of un-PR'd extensions, with bilioicik's permission.
Fixed problems with review.
@fath11 @sylarhcn @FurryR

@MoreBugOfDog MoreBugOfDog requested a review from sylarhcn April 5, 2024 02:15
@MoreBugOfDog
Copy link
Contributor Author

关于以小驼峰来命名函数这点实在改不动,已经在ccw上跟HGN商量过了,HGN表示能接受。下次命名一定符合规范。

× HGN √HCN

@bilioicik
Copy link

关于以小驼峰来命名函数这点实在改不动,已经在ccw上跟HCN商量过了,HCN表示能接受。下次命名一定符合规范。

@fath11
Copy link
Contributor

fath11 commented Apr 5, 2024

image
this will 100% trigger a lot of people, it will be better if you use neutral example inputs that have no chance of making people mad.

@fath11
Copy link
Contributor

fath11 commented Apr 5, 2024

My problems with this extension still stand. All of these functionalities can already be done with existing extensions. You should focus more on #195

@MoreBugOfDog
Copy link
Contributor Author

我对这个扩展的问题仍然存在。所有这些功能都已经可以通过现有的扩展来完成。你应该更多地关注#195

Hello fath11!
We will be further culling or hiding duplicate blocks for this extension.
Thank you for your review.
For PR #195 , we are making changes to him, thank you for your attention.

Comment on lines 1 to 3
const {
BlockType, ArgumentType, TargetType, Cast,
} = Scratch;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

为了兼容性考虑,需要使用 IIFE 格式才能使用 Scratch 对象,这涉及到扩展的加载原理。

(function (Scratch) {
  // 你的代码。
})(Scratch);

Comment on lines 5219 to 5231
if (symbol === 'equal') return Cast.compare(arg1, arg2) === 0
if (symbol === 'strictlyEqual') return String(arg1) === String(arg2)
if (symbol === 'greater') return Cast.compare(arg1, arg2) > 0
if (symbol === 'less') return Cast.compare(arg1, arg2) < 0
if (symbol === 'greaterOrEqual') return Cast.compare(arg1, arg2) >= 0
if (symbol === 'lessOrEqual') return Cast.compare(arg1, arg2) <= 0
if (symbol === 'unequal') return Cast.compare(arg1, arg2) !== 0
if (symbol === 'strictlyUnequal') return String(arg1) !== String(arg2)
if (symbol === 'equalNegative') return Cast.compare(arg1, -arg2) === 0
if (symbol === 'EqualPON') return Cast.compare(arg1, -arg2) === 0 || Cast.compare(arg1, arg2) === 0
if (symbol === 'approximatelyEqual') return Math.abs(arg1 - arg2) <= 0.5
if (symbol === 'vertical') return ((arg1 - (arg2 - 90)) % 180) === 0
if (symbol === 'parallel') return ((arg1 - arg2) % 180) === 0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这段重复代码过多了。

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Switch statements being forgotten 🥲

return JSON.parse(args.a).some(i => i > args.b)
}
bArrayhavenotsmallnumber(args){
return JSON.parse(args.a).some(i => i >
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

导向不良

@bilioicik
Copy link

最新更改:
numpro重复的if更改为了简洁的switch和case;
numpro与已有扩展雷同的关于大于小于判断功能被删除;
字符互换积木中的参数默认值分别更改为了ccw、c、w;
新出了四个关于数组中元素大小的精简化积木;
改为使用 IIFE 格式。

@MoreBugOfDog
Copy link
Contributor Author

All issues reviewed have been resolved, please review again.
已经解决所有审核出的问题,请再次审查。
@sylarhcn @fath11 @FurryR

@bilioicik
Copy link

额,我还是更喜欢原来的descp。首先这个扩展还涉及字符串数组对象,跟这个描述的“数学”本身关系并不多;其次这个描述既长又太夸张了。我选择的“Green for Go”出自Thomas Greenberg的专辑《Something Simple》的第17首;PR#195的“Moving Onwards”也是出自《Something Simple Acoustic》;封面更是印证这点,算是一个彩蛋了。

@bilioicik
Copy link

我对这个扩展的问题仍然存在。所有这些功能都已经可以通过现有的扩展来完成。你应该更多地关注#195

我刚改正没按小驼峰命名的错误,计划编写使角色按照函数图像轨迹运动的积木,积木类型conditional,这样它运动过程中可以运行别的积木。

@MoreBugOfDog
Copy link
Contributor Author

@fath11 @sylarhcn @FurryR
please review

Copy link
Contributor

@sylarhcn sylarhcn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

你有超过 200 个积木。我认为这个扩展的使用负担会非常高。

请保持扩展的简洁

或提供设计目标与方案给大家讨论

(超过200个积木的结论,通过 l10n 数量大概判断的,因为单个语言的 l10n 有 300 条)

.gitignore Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants