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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ captures/

# Intellij
*.iml
.idea/*.xml
.idea/workspace.xml
.idea/tasks.xml
.idea/gradle.xml
Expand Down
15 changes: 12 additions & 3 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 bo = 1232

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

fun setAnswer(): Boolean
Expand All @@ -34,4 +37,10 @@ class Question
this.number = ( this.number + 12345*152+1)%mod
this.answer = setAnswer()
}
}

private fun getRand(): Int
{
return Random().nextInt(bo)
}

}