rt

An obligatory Java Project
Log | Files | Refs | LICENSE

commit 3a2ccb7f05e9323eac5223f389ba97735e8ade22
parent 5a75721760a728ce466d9b29f33e973c87452c6e
Author: zerous Naveen Narayanan <zerous@nocebo.space>
Date:   Mon, 25 Nov 2019 19:18:52 +0100

Use setScore() after validation

Diffstat:
Mscript.java | 4+++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/script.java b/script.java @@ -49,11 +49,11 @@ public class script { public boolean assignUser(int p, acc a, Lock lock) { lock.lock(); try { - a.setScore(); if (p == 0) { for (int i = 0, j = 1; i < 3; i++) { if (roles[i][j].isEmpty() == true) { + a.setScore(); roles[i][j] = a.getUname(); roles[i][j+1] = Integer.toString(a.getScore()); System.out.println("dbg: " + roles[i][0] + a.getUname() + roles[i][2]); @@ -62,8 +62,10 @@ public class script { } } else if (p > 0) { if (roles[p - 1][1].isEmpty() == true) { + a.setScore(); roles[p - 1][1] = a.getUname(); roles[p - 1][2] = Integer.toString(a.getScore()); + System.out.println("dbg: " + roles[p - 1][0] + a.getUname() + roles[p - 1][2]); return true; } }