• 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

Revisionf5e000057fb32faa2d828ab5757fd844b274fe53 (tree)
Time2024-04-12 06:26:52
AuthorAlbert Mietus < albert AT mietus DOT nl >
CommiterAlbert Mietus < albert AT mietus DOT nl >

Log Message

refactored

Change Summary

Incremental Difference

diff -r 24b2b4be542f -r f5e000057fb3 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:13:10 2024 +0200
+++ b/CMP_OTHER_LANGUAGES/Sieve_in_rPython/basic-1/MainClass.py Thu Apr 11 23:26:52 2024 +0200
@@ -116,6 +116,11 @@
116116 local int count:=0; ///Semantics: instance var, with function-local scope
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
119+ if count >= len(PRIMES) {
120+ print("Warning: Can only check {len(PRIMES)} primes, {gotPrime) is not verified")
121+ return
122+ }
123+
119124 expect := PRIMES[count]
120125 if expect != gotPrime {
121126 printf("ERROR: Prime no {count} should be {expect}, but got {gotPrime}”)
@@ -123,17 +128,15 @@
123128 count += 1;
124129 }///ToContinue"""
125130 if self.verifyCorrectPrime_count >= len(self.verifyCorrectPrime_PRIMES):
126- print ("Warning: cannot verify prime (no %s): %s -- Only %s primes build-in" % (
127- self.verifyCorrectPrime_count, gotPrime, len(self.verifyCorrectPrime_PRIMES)))
128- else:
129- expect = self.verifyCorrectPrime_PRIMES[self.verifyCorrectPrime_count]
130- if expect != gotPrime:
131- print ("ERROR: Prime no %s should be %s, but got %s" % (self.verifyCorrectPrime_count, expect, gotPrime))
132-
131+ print ("Warning: Can only check %s primes, {%s) is not verified" %(
132+ len(self.verifyCorrectPrime_PRIMES), gotPrime))
133+ return
134+ expect = self.verifyCorrectPrime_PRIMES[self.verifyCorrectPrime_count]
135+ if expect != gotPrime:
136+ print ("ERROR: Prime no %s should be %s, but got %s" % (self.verifyCorrectPrime_count, expect, gotPrime))
133137 self.verifyCorrectPrime_count +=1
134138
135139
136-
137140 def powerOn__power(self, max):
138141 """///CastleCode
139142 powerOn() on self.power