-
Notifications
You must be signed in to change notification settings - Fork 64
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
Conversation
那个设置哪些积木显示的窗口怎么没了,我很喜欢那个功能() |
There was a problem hiding this 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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
看起来,扩展提供了 3 个不同类型数据的处理的语法糖和一些集成 api
- 那是不是可以按照不同类型分成不同扩展了,我们现在不提倡搞大集合。
- 部分语法糖,感觉过于内聚,晦涩了。比如“取余”操作,你做成了’在 a 到 b 中循环‘,不经非常难理解, 也和我们正常环境中接触到数学知识没有匹配上。我觉得可能不是很好的设计。应该中通用易懂点。、
- 字符串那个块的积木,我没用没用,用成功,为什么会有单独的变量积木就是返回输入的字符串?链接积木没有使用成功。
建议在扩展讨论群中,获取其他扩展作者的建议。
× HGN √HCN |
关于以小驼峰来命名函数这点实在改不动,已经在ccw上跟HCN商量过了,HCN表示能接受。下次命名一定符合规范。 |
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/numpro/Operation_pro.js
Outdated
const { | ||
BlockType, ArgumentType, TargetType, Cast, | ||
} = Scratch; |
There was a problem hiding this comment.
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);
MoreBugOfDog/numpro/Operation_pro.js
Outdated
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这段重复代码过多了。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Switch statements being forgotten 🥲
MoreBugOfDog/numpro/Operation_pro.js
Outdated
return JSON.parse(args.a).some(i => i > args.b) | ||
} | ||
bArrayhavenotsmallnumber(args){ | ||
return JSON.parse(args.a).some(i => i > |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
导向不良
最新更改: |
额,我还是更喜欢原来的descp。首先这个扩展还涉及字符串数组对象,跟这个描述的“数学”本身关系并不多;其次这个描述既长又太夸张了。我选择的“Green for Go”出自Thomas Greenberg的专辑《Something Simple》的第17首;PR#195的“Moving Onwards”也是出自《Something Simple Acoustic》;封面更是印证这点,算是一个彩蛋了。 |
我刚改正没按小驼峰命名的错误,计划编写使角色按照函数图像轨迹运动的积木,积木类型conditional,这样它运动过程中可以运行别的积木。 |
There was a problem hiding this 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 条)
修复了所有review出的问题
请审核
20240406