What is the best BASIC Pocket Computer
04-16-2014, 08:23 PM
Post: #74
 Guenter Schink Senior Member Posts: 312 Joined: Dec 2013
RE: What is the best BASIC Pocket Computer
(04-16-2014 12:47 AM)Dave Britten Wrote:  Here you go, prime factors in GW-BASIC. I haven't done any real performance tuning, apart from selecting an algorithm that's more efficient than "2 plus all the odd numbers".

OK there where only minor changes to the code necessary. Deleted line 5, as UBASIC calculates long variables with a size of 542 words (whatever that is ) and timing (line 15 and 920) has a different syntax.

Code:
   10   input "X=";X    15   clr time    20   M=int(sqrt(X))    30   F=0    40   data 2,1,2,2    50   for I=1 to 4    60   read S:gosub 500    70   next I   100   if X<=1 then 900   105   data 4,2,4,2,4,6,2,6   110   for I=1 to 8   120   read S:gosub 500   130   next I   140   restore 105   190   if F>M then F=X:S=0:gosub 500   200   goto 100   500   F=F+S   510   if X/F<>int(X/F) then return   520   X=X/F   530   M=int(sqrt(X))   540   print F;   550   goto 510   900   print   910   print "Execution time: ";   920   print time1000/1000;:print "s"   930   end

Your example of 167699497 is calculated in about 2.4 seconds

Günter
 « Next Oldest | Next Newest »

 Messages In This Thread What is the best BASIC Pocket Computer - Namir - 03-30-2014, 03:31 AM RE: What is the best BASIC Pocket Computer - Raymond Del Tondo - 03-30-2014, 04:08 AM RE: What is the best BASIC Pocket Computer - HP67 - 03-30-2014, 07:01 AM RE: What is the best BASIC Pocket Computer - Namir - 03-30-2014, 11:38 AM RE: What is the best BASIC Pocket Computer - HP67 - 03-30-2014, 11:59 AM RE: What is the best BASIC Pocket Computer - Bill (Smithville NJ) - 03-30-2014, 12:57 PM RE: What is the best BASIC Pocket Computer - Thomas Radtke - 03-30-2014, 01:17 PM RE: What is the best BASIC Pocket Computer - Bill (Smithville NJ) - 03-30-2014, 01:46 PM RE: What is the best BASIC Pocket Computer - Erwin - 01-09-2019, 05:24 PM RE: What is the best BASIC Pocket Computer - Sylvain Cote - 03-30-2014, 12:58 PM RE: What is the best BASIC Pocket Computer - Bill (Smithville NJ) - 03-30-2014, 01:11 PM RE: What is the best BASIC Pocket Computer - JurgenRo - 01-04-2019, 10:32 PM RE: What is the best BASIC Pocket Computer - Dave Britten - 03-30-2014, 02:11 PM RE: What is the best BASIC Pocket Computer - W_Max - 03-30-2014, 03:39 PM RE: What is the best BASIC Pocket Computer - Dieter - 03-30-2014, 06:34 PM RE: What is the best BASIC Pocket Computer - Garth Wilson - 03-30-2014, 07:29 PM RE: What is the best BASIC Pocket Computer - Howard Owen - 03-31-2014, 09:34 PM RE: What is the best BASIC Pocket Computer - Garth Wilson - 03-31-2014, 10:03 PM RE: What is the best BASIC Pocket Computer - Francois Lanciault - 03-31-2014, 08:59 PM RE: What is the best BASIC Pocket Computer - Raymond Del Tondo - 03-31-2014, 09:16 PM RE: What is the best BASIC Pocket Computer - Marcus von Cube - 04-01-2014, 08:42 AM RE: What is the best BASIC Pocket Computer - Namir - 04-01-2014, 05:25 PM RE: What is the best BASIC Pocket Computer - W_Max - 04-01-2014, 09:55 AM RE: What is the best BASIC Pocket Computer - robert rozee - 04-05-2014, 01:18 PM RE: What is the best BASIC Pocket Computer - Dave Britten - 04-05-2014, 06:42 PM RE: What is the best BASIC Pocket Computer - robert rozee - 04-11-2014, 02:02 PM RE: What is the best BASIC Pocket Computer - Thomas Radtke - 04-12-2014, 06:56 AM RE: What is the best BASIC Pocket Computer - robert rozee - 04-12-2014, 07:51 PM RE: What is the best BASIC Pocket Computer - Thomas Radtke - 04-17-2014, 07:06 AM RE: What is the best BASIC Pocket Computer - Bill (Smithville NJ) - 04-17-2014, 01:19 PM RE: What is the best BASIC Pocket Computer - Johnny Shek - 04-06-2014, 04:20 AM RE: What is the best BASIC Pocket Computer - Guenter Schink - 04-08-2014, 04:30 PM RE: What is the best BASIC Pocket Computer - Johnny Shek - 04-09-2014, 07:54 AM RE: What is the best BASIC Pocket Computer - Alvaro - 04-09-2014, 02:27 PM RE: What is the best BASIC Pocket Computer - Alvaro - 04-09-2014, 02:29 PM RE: What is the best BASIC Pocket Computer - Katie Wasserman - 04-06-2014, 06:20 AM RE: What is the best BASIC Pocket Computer - Johnny Shek - 04-06-2014, 07:52 AM RE: What is the best BASIC Pocket Computer - Katie Wasserman - 04-06-2014, 07:07 AM RE: What is the best BASIC Pocket Computer - rprosperi - 04-06-2014, 06:13 PM RE: What is the best BASIC Pocket Computer - Joe Horn - 04-08-2014, 02:53 AM RE: What is the best BASIC Pocket Computer - toml_12953 - 01-07-2019, 08:40 PM RE: What is the best BASIC Pocket Computer - rprosperi - 01-08-2019, 02:45 AM RE: What is the best BASIC Pocket Computer - toml_12953 - 01-11-2019, 03:32 AM RE: What is the best BASIC Pocket Computer - ckreling - 05-07-2014, 01:36 AM RE: What is the best BASIC Pocket Computer - Dave Britten - 04-07-2014, 01:25 AM RE: What is the best BASIC Pocket Computer - Katie Wasserman - 04-07-2014, 08:24 AM RE: What is the best BASIC Pocket Computer - rprosperi - 04-07-2014, 05:49 PM RE: What is the best BASIC Pocket Computer - Dave Britten - 04-07-2014, 06:12 PM RE: What is the best BASIC Pocket Computer - Alvaro - 04-06-2014, 08:26 PM RE: What is the best BASIC Pocket Computer - Csaba Tizedes - 01-04-2019, 07:56 PM RE: What is the best BASIC Pocket Computer - Katie Wasserman - 04-07-2014, 12:19 AM RE: What is the best BASIC Pocket Computer - Johnny_Bjoern - 04-07-2014, 08:23 PM RE: What is the best BASIC Pocket Computer - Katie Wasserman - 04-07-2014, 11:55 PM RE: What is the best BASIC Pocket Computer - Katie Wasserman - 04-08-2014, 01:44 AM RE: What is the best BASIC Pocket Computer - Dave Britten - 04-08-2014, 11:06 AM RE: What is the best BASIC Pocket Computer - rprosperi - 04-08-2014, 01:02 PM RE: What is the best BASIC Pocket Computer - david sanz - 04-08-2014, 09:05 AM RE: What is the best BASIC Pocket Computer - rprosperi - 04-08-2014, 01:12 PM RE: What is the best BASIC Pocket Computer - Guenter Schink - 04-08-2014, 03:49 PM RE: What is the best BASIC Pocket Computer - rprosperi - 04-08-2014, 06:59 PM RE: What is the best BASIC Pocket Computer - Katie Wasserman - 04-08-2014, 08:40 PM RE: What is the best BASIC Pocket Computer - rprosperi - 04-09-2014, 01:51 AM RE: What is the best BASIC Pocket Computer - Bill (Smithville NJ) - 04-08-2014, 09:53 PM RE: What is the best BASIC Pocket Computer - Dave Britten - 04-08-2014, 10:03 PM RE: What is the best BASIC Pocket Computer - Bill (Smithville NJ) - 04-08-2014, 11:23 PM RE: What is the best BASIC Pocket Computer - Katie Wasserman - 04-08-2014, 11:50 PM RE: What is the best BASIC Pocket Computer - Bill (Smithville NJ) - 04-09-2014, 02:09 AM RE: What is the best BASIC Pocket Computer - Bill (Smithville NJ) - 04-09-2014, 11:54 AM RE: What is the best BASIC Pocket Computer - Johnny Shek - 04-09-2014, 03:16 PM RE: What is the best BASIC Pocket Computer - Bill (Smithville NJ) - 04-09-2014, 06:28 PM RE: What is the best BASIC Pocket Computer - Bill (Smithville NJ) - 04-09-2014, 11:59 AM RE: What is the best BASIC Pocket Computer - Dave Britten - 04-10-2014, 03:32 PM RE: What is the best BASIC Pocket Computer - Bill (Smithville NJ) - 04-10-2014, 06:44 PM RE: What is the best BASIC Pocket Computer - Nick_S - 04-12-2014, 06:55 AM RE: What is the best BASIC Pocket Computer - Bill (Smithville NJ) - 04-12-2014, 12:29 PM RE: What is the best BASIC Pocket Computer - Waon Shinyoe - 04-13-2014, 05:26 AM RE: What is the best BASIC Pocket Computer - Sukiari - 01-07-2019, 08:14 AM RE: What is the best BASIC Pocket Computer - Dave Britten - 04-15-2014, 04:19 PM RE: What is the best BASIC Pocket Computer - Guenter Schink - 04-15-2014, 10:03 PM RE: What is the best BASIC Pocket Computer - Dave Britten - 04-16-2014, 12:47 AM RE: What is the best BASIC Pocket Computer - Guenter Schink - 04-16-2014 08:23 PM RE: What is the best BASIC Pocket Computer - Dave Britten - 04-16-2014, 08:45 PM RE: What is the best BASIC Pocket Computer - Guenter Schink - 04-16-2014, 09:16 PM RE: What is the best BASIC Pocket Computer - Bill (Smithville NJ) - 04-16-2014, 09:41 PM RE: What is the best BASIC Pocket Computer - Guenter Schink - 04-18-2014, 09:12 PM RE: What is the best BASIC Pocket Computer - Dave Britten - 04-18-2014, 09:51 PM RE: What is the best BASIC Pocket Computer - Nick_S - 04-16-2014, 06:32 AM RE: What is the best BASIC Pocket Computer - Don Shepherd - 04-16-2014, 12:57 AM RE: What is the best BASIC Pocket Computer - Dave Britten - 04-16-2014, 03:45 AM RE: What is the best BASIC Pocket Computer - Dave Britten - 04-17-2014, 02:13 PM RE: What is the best BASIC Pocket Computer - Katie Wasserman - 04-17-2014, 04:07 PM RE: What is the best BASIC Pocket Computer - Bill (Smithville NJ) - 04-17-2014, 07:33 PM RE: What is the best BASIC Pocket Computer - Sylvain Cote - 04-17-2014, 10:18 PM RE: What is the best BASIC Pocket Computer - hp41cx - 04-17-2014, 10:36 PM RE: What is the best BASIC Pocket Computer - Guenter Schink - 04-18-2014, 06:19 PM RE: What is the best BASIC Pocket Computer - Paul Berger (Canada) - 05-07-2014, 02:44 AM RE: What is the best BASIC Pocket Computer - Csaba Tizedes - 01-04-2019, 04:52 PM RE: What is the best BASIC Pocket Computer - xerxes - 01-05-2019, 06:31 PM RE: What is the best BASIC Pocket Computer - Csaba Tizedes - 01-06-2019, 02:28 PM RE: What is the best BASIC Pocket Computer - damaltor - 01-09-2019, 01:04 PM RE: What is the best BASIC Pocket Computer - Jlouis - 02-25-2019, 12:05 AM RE: What is the best BASIC Pocket Computer - cdmackay - 02-25-2019, 12:06 AM RE: What is the best BASIC Pocket Computer - Jlouis - 02-25-2019, 12:26 AM RE: What is the best BASIC Pocket Computer - Sylvain Cote - 02-25-2019, 01:36 AM RE: What is the best BASIC Pocket Computer - Jlouis - 02-25-2019, 01:53 AM RE: What is the best BASIC Pocket Computer - Csaba Tizedes - 02-25-2019, 09:42 AM RE: What is the best BASIC Pocket Computer - Csaba Tizedes - 02-24-2019, 08:22 PM RE: What is the best BASIC Pocket Computer - xerxes - 02-26-2019, 02:08 PM RE: What is the best BASIC Pocket Computer - rprosperi - 02-26-2019, 03:37 PM RE: What is the best BASIC Pocket Computer - xerxes - 02-27-2019, 01:25 PM RE: What is the best BASIC Pocket Computer - rprosperi - 02-27-2019, 02:17 PM RE: What is the best BASIC Pocket Computer - Didier Lachieze - 02-24-2019, 08:41 PM RE: What is the best BASIC Pocket Computer - Csaba Tizedes - 02-25-2019, 09:24 AM RE: What is the best BASIC Pocket Computer - rprosperi - 02-24-2019, 11:13 PM RE: What is the best BASIC Pocket Computer - toml_12953 - 02-24-2019, 11:38 PM RE: What is the best BASIC Pocket Computer - Jlouis - 02-25-2019, 03:48 PM RE: What is the best BASIC Pocket Computer - Valentin Albillo - 02-27-2019, 12:12 AM RE: What is the best BASIC Pocket Computer - Csaba Tizedes - 02-27-2019, 09:21 AM RE: What is the best BASIC Pocket Computer - Valentin Albillo - 02-28-2019, 12:33 AM RE: What is the best BASIC Pocket Computer - xerxes - 02-27-2019, 07:26 PM RE: What is the best BASIC Pocket Computer - rprosperi - 02-27-2019, 10:37 PM

User(s) browsing this thread: 1 Guest(s)