示例#1
0
文件: random.c 项目: tankerwng/mruby
static mrb_value 
mrb_random_g_rand(mrb_state *mrb, mrb_value self)
{
  mrb_value random = mrb_const_get(mrb,
          mrb_obj_value(mrb_class_get(mrb, "Random")),
          mrb_intern_lit(mrb, "DEFAULT"));
  return mrb_random_rand(mrb, random);
}
示例#2
0
文件: random.c 项目: ASnow/mruby
static mrb_value
mrb_random_g_rand(mrb_state *mrb, mrb_value self)
{
  mrb_value random = get_random(mrb);
  return mrb_random_rand(mrb, random);
}