Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Program Hanging  RSS feed

 
Jason Rod
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am having problems with a program hanging on a class method and I am not sure if it is caused by an infinite loop or something else. Here is the method.


studAns[i][j] is a double matrix containing 8 students(i), each with 10 answers(j).
answerKey[j] is a single matrix containing 10 answers(j).

I have no problems compiling the code, and I get no errors when running the program, it just hangs. After looking at the method I could not discern any problems with it, and I have checked and double checked and I know that this is the method on which the program hangs.
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does anything in the body of this loop have any effect on the loop condition?


I believe you just want an "if" rather than a "while" -- you only need to increment the score once for any given combination of "i" and "j".
 
Jason Rod
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
oh great, that worked, thanks a bunch.
[ May 22, 2006: Message edited by: Jason Rod ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!