Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions app/src/main/java/com/example/myapp/Question.kt
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
package com.example.myapp

import java.util.*

/**
* Created by rohitramaswamy on 11/07/17.
*/
class Question
{
var number=1
var answer = false
var mod = 1
private var mod = 1
private val bound = 1234

constructor()
{
this.mod = 103
this.number = ((12345*152+1) % mod).toInt()
this.number = getRandomNumber()
}

fun setAnswer(): Boolean
Expand All @@ -24,14 +27,19 @@ class Question
{
return false
}
sq--;
sq--
}
return true
}

fun getNextQuestion()
{
this.number = ( this.number + 12345*152+1)%mod
this.number = getRandomNumber()
this.answer = setAnswer()
}

private fun getRandomNumber(): Int
{
return Random().nextInt(bound)
}
}
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext.kotlin_version = '1.1.3-2'
ext.kotlin_version = '1.1.50'
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.android.tools.build:gradle:3.0.0-beta6'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

// NOTE: Do not place your application dependencies here; they belong
Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Mon Jul 10 23:12:14 IST 2017
#Thu Oct 26 21:10:32 BRST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip