var rooms = {
bedroom: {
info: "A dusty bed lies sideways in the midle of the room";
north: function ( ) {
//this function returns an error
}
}
};
Run Code Online (Sandbox Code Playgroud)
我无法解决为什么这会返回一个意外的标识符
- 编辑感谢另一个问题
在javascript他有很好的部分
var myObject = {
value: 0;
increment: function (inc) {
this.value += typeof inc === 'number' ? inc : 1;
}
};
Run Code Online (Sandbox Code Playgroud)
这和我在做什么有什么不同?
int RandInt(int a, int b){
return (rand()%b+a);
}
Run Code Online (Sandbox Code Playgroud)
我想生成随机字符值,所以我这样称呼它
char asciiValue = RandInt(65, 90);
Run Code Online (Sandbox Code Playgroud)
但我的输出并不是我所期望的......我做错了什么?
--edit为randint调用输入了错误的值,我的不好