试图找到正确的方法,但我无法

时间:2019-01-05 05:56:42

标签: javascript html5

  • 用户启动游戏时获得1000 INR
  • 每次尝试(点击开始)均需支付100印度卢比
  • 如果用户的印度卢比少于100卢比,则游戏结束
  • 每次尝试都会生成三个随机数,每个随机数都在0-9范围内
  • 如果所有数字都是奇/偶(例如2 4 6),则用户将获得300印度卢比
  • 如果数字以任意顺序相差1(例如2 3 4或3 2 4或4 6 5),则用户将获得800印度卢比
  • 如果所有数字都相同(例如4 4 4),则用户将获得1000印度卢比
  • 其他用户没有钱

    function randomNum(min, max) {
      var YourMoney = 100
      var MoneyLeft
      var n = []
      for (i = 0; i < 3; i++) {
        n.push(Math.floor(Math.random() * max) + min)
      }
      document.getElementById("randomNumbers").innerHTML = n;
    
      YourMoney = YourMoney - 100
      document.getElementById("remain").innerHTML = YourMoney
    
      if (YourMoney < 100) {
        document.getElementById("lost").innerHTML = "You have lost ";
      }
    
    }
    

1 个答案:

答案 0 :(得分:0)

我已经在1小时内编写了这段代码! phe! :) ..希望它有帮助..在您了解完整代码后,还可以删除所有控制台!

java.lang.IllegalArgumentException: Not a valid geo location: -118.2541117, 33.985805
    at com.firebase.geofire.GeoLocation.<init>(GeoLocation.java:51)
    at com.example.webforest.quickaidlikeuber2nd.CustomerMapActivity.getDriversAround(CustomerMapActivity.java:577)
    at com.example.webforest.quickaidlikeuber2nd.CustomerMapActivity.access$2300(CustomerMapActivity.java:76)
    at com.example.webforest.quickaidlikeuber2nd.CustomerMapActivity$10.onLocationResult(CustomerMapActivity.java:512)
    at com.google.android.gms.internal.location.zzau.notifyListener(Unknown Source)
    at com.google.android.gms.common.api.internal.ListenerHolder.notifyListenerInternal(Unknown Source)
    at com.google.android.gms.common.api.internal.ListenerHolder$zaa.handleMessage(Unknown Source)
for i in range(0,4):
    x1 = (i != c)
    x2 = (knows(i, c))
    x3 = (knows(c, i))
    print("-------")
    # if x1 & x2 | x3!=1: # note != 
    if x1 & x2 | (x3!=1):  # you may want this
        print(c)