codeguru-il / corewars8086

Core Wars for standard 8086 assembly.
Apache License 2.0
31 stars 19 forks source link

fix (Competition|Window.java): random wars visual & combinations & stop #21

Closed eLoopWoo closed 6 years ago

eLoopWoo commented 6 years ago

every war should generate different loadAddress for the warriors the loadAddress is calculated by a rand object loadAddress = rand.nextInt(ARENA_SIZE) rand object is using a seed to generate a random number

wars to run are now calculated by getTotalNumberOfWars() (warsPerCombination * combinations) solution, following every war we increment seed value by 1 for (int warCount = 0; warCount < getTotalNumberOfWars(); warCount++) { runWar(...); seed ++;

seeds are created by hashing user's seed string currently used seed is shown while ongoing wars using "SEED!@#=" as a prefix to seed will use the value without hashing

stop button to stop an ongoing competition