常规的命令

Linux和mac下常规的命令

没错,亲爱的博主大大又来写防忘文了,主要记录一些常用的命令或者开发小技巧......长期更新.......
  • terminal 下进入了python vim怎么退出来?
    quit() 或者exit()
彩票类app,大乐透选号算法
+(NSArray *)calcuateBallsWithNum:(NSInteger)num andTotalCount:(NSInteger)totalNum{
    NSMutableArray *arrT = [NSMutableArray arrayWithCapacity:totalNum];
    for (NSInteger i = 1; i<(totalNum+1); i++) {
        NSString *a = [NSString stringWithFormat:@"%02ld",(long)i];
        [arrT addObject:a];
    }
    NSMutableArray *arr_balls = [NSMutableArray arrayWithCapacity:num];
    for (int i = 0; i<num; i++) {
        int x = arc4random()%(totalNum-i);
        [arr_balls addObject:[arrT objectAtIndex:x]];
        [arrT removeObjectAtIndex:x];
    }
    return arr_balls;
}
红球35个选5个,篮球12个选2个
 _arr_letou = [NSMutableArray arrayWithCapacity:2];
    [_arr_letou addObject:[[MLTool calcuateBallsWithNum:5 andTotalCount:35] sortedArrayUsingSelector:@selector(compare:)]];
    [_arr_letou addObject:[[MLTool calcuateBallsWithNum:2 andTotalCount:12] sortedArrayUsingSelector:@selector(compare:)]];
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • Ubuntu的发音 Ubuntu,源于非洲祖鲁人和科萨人的语言,发作 oo-boon-too 的音。了解发音是有意...
    萤火虫de梦阅读 99,818评论 9 468
  • 【投资要点】 ·6-8月欧洲杯/美洲杯/奥运会等赛事为国内彩票业带来强催化。彩票是我国唯一合法博彩形式,近8/7年...
    walker小凯阅读 11,650评论 1 9
  • 目录 目录 第一章 windows下客户端软件putty 1.1 Putty简介 1.2 Putty快速启动 第...
    adminlyrics阅读 5,046评论 0 4
  • vim 选择文本,删除,复制,粘贴 文本的选择,对于编辑器来说,是很基本的东西,也经常被用到,总结如下: v 从...
    壹首簡單的歌阅读 4,340评论 0 7
  • 阳光从窗口喷洒进来 照在我的书箱子上 我看着她 一点一点向上爬 穿过桌脚在我脚上留下斑驳的影子 直到她 爬上桌面...
    白平阅读 2,812评论 4 3