Sum Count of identical Rightmost digits

PAB

Member
Hi johnph77,

Out of Interest, was there Supposed to be QBasic Code Attached to the this?.


johnph77 said:
PAB -
I wrote this program code in QBasic ...
All the Best.
PAB
:wavey:
 

PAB

Member
Thanks for the Reply johnph77,


johnph77 said:
PAB -

No - sorry. Need the code?
I have a Macro that I Wrote in VBA that Produces ALL the Combinations for the Thunderball Lotto.
I was Just Curious what the Code looks like in QBasic, having Never Used it. Not to Worry.

All the Best.
PAB
:wavey:
 
Last edited:

johnph77

Member
PAB -

CLS
OPEN "THUNDER.TXT" FOR OUTPUT AS #1
FOR F% = 1 TO 14
FOR A% = 1 TO 30
FOR B% = A% + 1 TO 31
FOR C% = B% + 1 TO 32
FOR D% = C% + 1 TO 33
FOR E% = D% + 1 TO 34
N1& - N1& + 1
PRINT #1, USING "#######"; N1&;
PRINT #1, USING "##"; A%; B%; C%; D%; E%; F%
NEXT E%
NEXT D%
NEXT C%
NEXT B%
NEXT A%
NEXT F%
CLOSE
END

"THUNDER.TXT", of course, is the output file. The "PRINT #1" statement directs the program output to the file. The "USING" function formats the output into right-justified columns within the file. The "CLOSE" statement closes all open files if a particular file number isn't specified - I can have more than one output file open at the same time.

QBASIC was the only version of BASIC I am familiar with that didn't require line numbers. But if I wanted to direct the program to go to a certain point if a preordained condition existed (as in a GOSUB statement) I would have to use a line number in that line only to steer the program to that point.

Simple, short and sweet.

John
 

PAB

Member
Thanks for the Reply johnph77,

The Program is VERY Similar to the One I Wrote in VBA.
The Main Difference is that Your Program Loops through EACH Thunderball FIRST with EACH Combination, where as Mine Loops through EACH Combination FIRST with EACH Thunderball.

All the Best.
PAB
:wavey:
 

johnph77

Member
PAB -

And I did it that way with the specific purpose of setting up the output file to feed the spreadsheet with 14 pages, each with a different Thunderball, rather than to have to sort it later. I had it the other way originally, hence the designator "F%" for the Thunderball.

<g>

gl

j
 

PAB

Member
Thanks for the Reply johnph77.
Did you Manage to Link up with Sammy and Provide him with the Information he was After.

All the Best.
PAB
:wavey:
 

johnph77

Member
PAB -

As a matter of fact, sent a CD to him this very day. It has the Excel file and two text files for the entire lottery on it. Thanks for asking.

gl

John
 

Sammy

Member
Hi John,

Received CD - thank you.

johnph77 said:
PAB -

As a matter of fact, sent a CD to him this very day. It has the Excel file and two text files for the entire lottery on it. Thanks for asking.

gl
John
 

PAB

Member
Hi Sammy,


Sammy said:
Hi John,
Received CD - thank you.
How are you getting on with Analysing the Data on the CD that johnph77 Sent you?.
Have you had Any Luck Yet?.

All the Best.
PAB
:wavey:
 

Sammy

Member
Hi PAB, Johnph77

Just signed in today: been offline for quite a while and out of the Lotto Loop. I'm getting back into the Lotto Swing and hope to catch up on missed Threads.

No Luck as yet with johnph77 CD but that is probably more to do with my analysis. I'm optimistic!

Cheers,
Sammy
PAB said:
Hi Sammy,

How are you getting on with Analysing the Data on the CD that johnph77 Sent you?.
Have you had Any Luck Yet?.

All the Best.
PAB
:wavey:
 

PAB

Member
Welcome back Sammy,


Sammy said:
No Luck as yet with johnph77 CD but that is probably more to do with my analysis. I'm optimistic!.
If you are having Problems with Accessing the Data, I can Post the VB Code I Wrote to Generate ALL the Combinations.
Alternatively, if you tell us what the Problem is, I am Sure johnph77 will be Able to Point you in the Right Direction.

All the Best.
PAB
:wavey:
 

Sammy

Member
Hi PAB,

Thanks for the warm Greeting.

Sorry, when I said, "No Luck as yet with johnph77 CD." I meant that Jackpot is still eluding me. LOL!

No problem as such with accessing the data, just unfortunate time constraints at the moment.

Cheers,
Sammy

PAB said:
Welcome back Sammy,

If you are having Problems with Accessing the Data, I can Post the VB Code I Wrote to Generate ALL the Combinations.
Alternatively, if you tell us what the Problem is, I am Sure johnph77 will be Able to Point you in the Right Direction.

All the Best.
PAB
:wavey:
 

Sidebar

Top