水果机

编程入门 行业动态 更新时间:2024-10-23 22:38:00

水果机

水果机

懒得描述了,直接上链接。

MyCode:

public static int FruitMachine(List<string[]> reels, int[] spins){int score = 0;int[] scoresArr = { 100, 90, 80, 70, 60, 50, 40, 30, 20, 10 };Dictionary<string, int> reeldic = new Dictionary<string, int> { {"Wild",0},{"Star",1},{"Bell",2},{"Shell",3},{"Seven",4},{"Cherry",5},{"Bar",6},{"King",7},{"Queen",8},{"Jack",9},};string reel1 = reels[0][spins[0]];string reel2 = reels[1][spins[1]];string reel3 = reels[2][spins[2]];if (reel1 != reel2 && reel2 != reel3 & reel1 != reel3){return score;}else if (reel1 == reel2 && reel2 == reel3){score = scoresArr[reeldic[reel1]];return score;}else{string samereel = reel1 == reel2 ? reel1 : reel3;score = scoresArr[reeldic[samereel]] / 10;if (samereel != "Wild" && (reel1 == "Wild" || reel2 == "Wild" || reel3 == "Wild")){score = score * 2;}return score;}}

更多推荐

水果机

本文发布于:2024-03-09 14:40:25,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1725259.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:水果机

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!