What is the best BASIC Pocket Computer
04-16-2014, 12:47 AM
Post: #70
 Dave Britten Senior Member Posts: 1,380 Joined: Dec 2013
RE: What is the best BASIC Pocket Computer
(04-15-2014 10:03 PM)Guenter Schink Wrote:  Your factors program would be interesting to compare.

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".

Code:
5 DEFDBL X,F,M 10 INPUT "X=";X 15 ST=TIMER 20 M=INT(SQR(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(SQR(X)) 540 PRINT F; 550 GOTO 510 900 ET=TIMER:PRINT 910 PRINT "Execution time: "; 920 PRINT USING "####.####";ET-ST;:PRINT "s" 930 END
 « 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 - Csaba Tizedes - 11-22-2019, 05:27 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 - foroplus - 04-03-2019, 10:45 AM RE: What is the best BASIC Pocket Computer - rprosperi - 04-03-2019, 01:28 PM RE: What is the best BASIC Pocket Computer - foroplus - 04-03-2019, 08:45 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 RE: What is the best BASIC Pocket Computer - EugeneNine - 04-03-2019, 05:36 PM RE: What is the best BASIC Pocket Computer - Androsynth - 05-07-2019, 08:24 PM RE: What is the best BASIC Pocket Computer - Dave Britten - 06-13-2019, 06:56 PM RE: What is the best BASIC Pocket Computer - cdmackay - 06-13-2019, 09:18 PM RE: What is the best BASIC Pocket Computer - Dave Britten - 06-13-2019, 09:26 PM RE: What is the best BASIC Pocket Computer - cdmackay - 06-14-2019, 12:12 AM RE: What is the best BASIC Pocket Computer - Dave Britten - 06-14-2019, 12:54 AM RE: What is the best BASIC Pocket Computer - thenozone - 06-13-2019, 10:10 PM RE: What is the best BASIC Pocket Computer - Dave Britten - 06-13-2019, 11:17 PM RE: What is the best BASIC Pocket Computer - Dave Britten - 06-14-2019, 12:29 PM RE: What is the best BASIC Pocket Computer - cdmackay - 07-05-2019, 04:16 PM RE: What is the best BASIC Pocket Computer - Leviset - 07-06-2019, 02:59 PM RE: What is the best BASIC Pocket Computer - Dave Britten - 07-06-2019, 03:50 PM RE: What is the best BASIC Pocket Computer - ijabbott - 11-23-2019, 07:22 PM RE: What is the best BASIC Pocket Computer - Dave Britten - 11-23-2019, 07:43 PM RE: What is the best BASIC Pocket Computer - ijabbott - 11-26-2019, 09:17 PM

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