summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortomsmeding <tom.smeding@gmail.com>2016-09-01 20:50:56 +0200
committertomsmeding <tom.smeding@gmail.com>2016-09-01 20:50:56 +0200
commitc4e6a3c7df4dafe5353c0739f27d15d4a5c6a143 (patch)
treeab4958c0f4743a7c5511c8ed701fb3b86703324f
parentabeb43aa08efba521e3cb94cffd30f9c7dd48250 (diff)
Add more example codeHEADmaster
-rw-r--r--error.txt2
-rw-r--r--primes.txt18
2 files changed, 19 insertions, 1 deletions
diff --git a/error.txt b/error.txt
index 14bcb38..417238e 100644
--- a/error.txt
+++ b/error.txt
@@ -1,3 +1,3 @@
def main(){
- print(if 1 kaas; else swag);
+ print(if 1 kaas; else swag; + 1);
}
diff --git a/primes.txt b/primes.txt
new file mode 100644
index 0000000..e693345
--- /dev/null
+++ b/primes.txt
@@ -0,0 +1,18 @@
+def checkprime(n){
+ i = 2;
+ s = int(sqrt(n));
+ while i <= s {
+ if n % i == 0 break;
+ i += 1;
+ }
+ return(i < s);
+}
+
+def main(argc,argv){
+ N = 100;
+ i = 2;
+ while i < N {
+ if checkprime(i) print(i);
+ i += 1;
+ }
+}