Forum Membership - support@scriptbasic.org
1 REM https://rosettacode.org/wiki/Attractive_numbers10 FOR x = 1 TO 12020 LET n = x30 LET c = 040 IF n MOD 2 <> 0 THEN 7050 LET n = INT(n / 2)60 LET c = c + 170 IF n MOD 2 = 0 THEN 4080 FOR i = 3 TO SQR(n) STEP 290 IF n MOD i <> 0 THEN 120100 LET n = INT(n / i)110 LET c = c + 1120 IF n MOD i = 0 THEN 90130 NEXT i140 IF n <= 2 THEN 160150 LET c = c + 1160 IF NOT(PRIME(c)) THEN 180170 PRINT x,180 NEXT x
1 REM https://rosettacode.org/wiki/Nth_root10 LET a = INT(RND * 5999) + 220 PRINT "nth root of "; a; "..."30 FOR n = 1 TO 1040 LET p = .0000150 LET x = a60 LET y = a / n70 IF ABS(x - y) <= p THEN 11080 LET x = y90 LET y = ((n - 1) * y + a / y ^ (n - 1)) / n100 IF ABS(x - y) > p THEN 80110 PRINT n; " : "; y120 NEXT n
1 REM https://rosettacode.org/wiki/Prime_decomposition10 LET loops = 10020 FOR x = 1 TO loops30 LET n = x40 PRINT n; " : ";50 LET c = 060 IF n MOD 2 > 0 THEN 11070 LET n = INT(n / 2)80 LET @(c) = 290 LET c = c + 1100 IF n MOD 2 = 0 THEN 70110 FOR i = 3 TO SQR(n) STEP 2120 IF n MOD i > 0 THEN 170130 LET n = INT(n / i)140 LET @(c) = i150 LET c = c + 1160 IF n MOD i = 0 THEN 130170 NEXT i180 IF n <= 2 THEN 210190 LET @(c) = n200 LET c = c + 1210 FOR y = 0 TO c220 IF @(y) = 0 THEN 250230 PRINT @(y); " ";240 LET @(y) = 0250 NEXT y260 PRINT270 NEXT x
1 REM Prime Table10 PRINT "Generating table of primes below..."20 HTML30 PRINT "<center><table><tr>"40 FOR y = 1 TO 5050 FOR x = 1 TO 2060 LET i = i + 170 PRINT "<td style = 'border:1px solid black; background-color:yellow;'>"80 PRINT i; ":<br /> "; PRIME(i)90 PRINT "</td>"100 NEXT x110 PRINT "</tr><tr>"120 NEXT y130 PRINT "</tr></table></center>"
1 REM USD currency conversion10 GET u20 PRINT "$"; u; " USD ="30 GET e40 GET g50 GET i60 GET j70 PRINT u * e; " EUR"80 PRINT u * g; " GBP"90 PRINT u * i; " INR"100 PRINT u * j; " JPY"
<form action = "https://www.lucidapogee.com/netbasic/" target = "output" method = "get"><p>U<br /><input type = "text" name = "U" value = "1"><br />E<br /><input type = "text" name = "E" value = ".925881"><br />G<br /><input type = "text" name = "G" value = ".7924"><br />I<br /><input type = "text" name = "I" value = "82.628"><br />J<br /><input type = "text" name = "J" value = "145.96"></p><input type = "hidden" name = "listing" value = "1%20REM%20USD%20currency%20conversion%0D%0A10%20GET%20u%0D%0A20%20PRINT%20%22%24%22%3B%20u%3B%20%22%20USD%20%3D%22%0D%0A30%20GET%20e%0D%0A40%20GET%20g%0D%0A50%20GET%20i%0D%0A60%20GET%20j%0D%0A70%20PRINT%20u%20*%20e%3B%20%20%22%20EUR%22%0D%0A80%20PRINT%20u%20*%20g%3B%20%22%20GBP%22%0D%0A90%20PRINT%20u%20*%20i%3B%20%22%20INR%22%0D%0A100%20PRINT%20u%20*%20j%3B%20%22%20JPY%22%0D%0A"><input type = "submit"></form><iframe name = "output"></iframe>