Lv.1
在 随机数函数,再也不用担心用random搞不出来随机数了!) 中回复
究极繁化版()())()
console.clear()
class random {
constructor(min, max) {
this.min = min;
this.max = max;
this.PI = Math.PI
this.poor = () => this.max > this.min ? ((this.max - this.min) * Math.PI / ((this.PI / Math.PI) * this.PI)) | 0 : ((this.min - this.max) * Math.PI / ((this.PI / Math.PI) * this.PI)) | 0
}
randint() {
return Math.floor(
Math.random() * (this.poor() + this.min)
)
}
};
class Random extends random {
constructor(min, max) {
super(min, max);
this.log = console.log;
}
randint() {
return super.randint()
}
};
globalThis.Random = Random;
var test = new Random(10, 100).randint();
console.log(test)2022-11-10T16:58:35 点赞:1
在 代码教学(优化代码~)很逊的(dog) 中回复
switch个人不太喜欢)每个分支写完都要break,而且case要用冒号贼像py,格式化文档后格式也十分难看)
2022-11-15T15:12:10 点赞:2
在 【lj氵帖】《论如何让自己在JS上显得很NB(对萌新)》 中回复
给我置顶?()
yee~
class Randint {
constructor(min = 0, max = 100) {
max > min ? this.min = min : this.min = max; max > min ? this.max = max : this.max = min;
this.randint = (Math.random() * (max - min) + min).toString();
this.length = this.randint.split('.')[1].length
};
float(decimal_places = 0) {
return decimal_places >= this.length ? Number(this.randint) : Number(this.randint.split('.')[0] + '.' + this.randint.split('.')[1].substring(0, decimal_places))
};
int() {
return this.randint | 0
}
};
2022-11-16T13:24:58 点赞:0
在 你说这个人是不是* 中回复
原来隆美尔也就半吊子代码()应该先world.querySelectorAll('player').find(e => e.player.name == '爱摆烂咕咕的屑芜能.bushi').player.kick()![]()
2022-11-20T18:04:10 点赞:2
在 LZ的反box3++引擎代码,大家可以直接复制粘贴()为岛三反box3++事业作出贡献() 中回复
所以玩家还能被摧毁???!e.desdroyed啥意思()()玩家未被摧毁???())(我好像不太能理解![]()
2022-11-23T17:29:03 点赞:2