• R/O
  • SSH

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Revisiond77d9d753afa680acbe7005f5e38a5d8d82a4ad0 (tree)
Time2024-04-12 06:42:50
AuthorAlbert Mietus < albert AT mietus DOT nl >
CommiterAlbert Mietus < albert AT mietus DOT nl >

Log Message

refactored

Change Summary

Incremental Difference

diff -r f5e000057fb3 -r d77d9d753afa CMP_OTHER_LANGUAGES/Sieve_in_rPython/basic-1/MainClass.py
--- a/CMP_OTHER_LANGUAGES/Sieve_in_rPython/basic-1/MainClass.py Thu Apr 11 23:26:52 2024 +0200
+++ b/CMP_OTHER_LANGUAGES/Sieve_in_rPython/basic-1/MainClass.py Thu Apr 11 23:42:50 2024 +0200
@@ -117,23 +117,28 @@
117117 cons PRIMES:= [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97];
118118
119119 if count >= len(PRIMES) {
120- print("Warning: Can only check {len(PRIMES)} primes, {gotPrime) is not verified")
120+ print("Warning: Can only check {len(PRIMES)} primes; {gotPrime) is not verified")
121121 return
122122 }
123123
124124 expect := PRIMES[count]
125125 if expect != gotPrime {
126126 printf("ERROR: Prime no {count} should be {expect}, but got {gotPrime}”)
127-
127+ } else {
128+ printf("Success, found {gotPrime}, prime no {count} (verified)")
129+ }
128130 count += 1;
129131 }///ToContinue"""
130132 if self.verifyCorrectPrime_count >= len(self.verifyCorrectPrime_PRIMES):
131- print ("Warning: Can only check %s primes, {%s) is not verified" %(
133+ print ("Warning: Can only check %s primes; %s is not verified" %(
132134 len(self.verifyCorrectPrime_PRIMES), gotPrime))
133135 return
136+
134137 expect = self.verifyCorrectPrime_PRIMES[self.verifyCorrectPrime_count]
135138 if expect != gotPrime:
136139 print ("ERROR: Prime no %s should be %s, but got %s" % (self.verifyCorrectPrime_count, expect, gotPrime))
140+ else:
141+ print ("Success, found %s, prime no %s (verified)" % ( gotPrime, 1+self.verifyCorrectPrime_count))
137142 self.verifyCorrectPrime_count +=1
138143
139144