Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Google Sign In with OpenID

Categories

We have migrated to a new platform! Please note that you will need to reset your password to log in (your credentials are still in-tact though). Please contact lee@programmersheaven.com if you have questions.
Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

what flavour of Basic is this?

tulituli Posts: 6Member
Hello,

As a result of a google search I found this routine.
Can anybody tell me what language is this? Looks like a flavour of BASIC.

Thanks

PS Tried VB, GWBASIC, Liberty Basic. des not seem to be any of these.

DECLARE SUB SPRINKLE (NCIT!, NCITNEW!)
DECLARE SUB EVOLVE (NCIT!, NCITNEW)
DECLARE SUB BIRTH (CIT!, K!, BABY!)
DECLARE SUB MARRY (NCIT!, NCITNEW!, GEN!)
DECLARE SUB SWAPARRAYS (NMAX!, K!)
DECLARE SUB SORTRANKS (NCIT!)
DECLARE SUB MUTATE (NCIT, GEN)
DECLARE SUB MUTATEIFSAME (NCIT, GEN)
DECLARE SUB STOREOUTPUTDATA (GEN, NCITNEW)
DECLARE SUB SEEIFIMPROVED (MUTFLAG, GEN)
DECLARE SUB SHOWRESULTS (GEN)
DECLARE SUB MAKEAK2DINPUTFILE (NODE(), X(), Y(), NNODES)
DECLARE SUB GOAK2D ()
DECLARE SUB QUALITY (NPOINTS)
DECLARE SUB QUALITYHP (QHP)
DECLARE SUB QUALITYPATTERN (QPAT)
DECLARE SUB QUALITYRIPPLE (QRIPL)
DECLARE SUB HPBW (NPOINTS)
DECLARE SUB NORMALIZEDATA (NPOINTS)
DECLARE SUB READINPUTDATA (NPOINTS)
DECLARE SUB XMINMAX (CHOKENO, K, XGCOORD, YGCOORD, SIGHN, DELTAX)
DECLARE SUB REQUESTINPUTDATA ()
DECLARE SUB INITIALIZEARRAYS ()
DECLARE SUB INITIALIZERANKS (CITSTART, NCIT, GEN)
DECLARE SUB RUNAK2DROUTINES (GEN)

COMMON SHARED NNODES, NGEN, NCIT, QTOTH, QTOTE, NFREQS, AKERFLG
COMMON SHARED QHP, QPAT, QRIPL, QTOT, DELTAX, YCLIP, GENN
DIM SHARED MAGCO(5, 400), THMAXMAG(5), HP(5)
DIM SHARED X(200), Y(200), X1(200), Y1(200), NODE(200)
DIM SHARED QUAL(110), RANK(110), XG(120, 120), YG(120, 120), QTOTE(10), QTOTH(10)
DIM SHARED ETHCO(400), QTEST(10)

RANDOMIZE TIMER
CLS
'* PRINT HEADER
PRINT
PRINT "PROGRAM GEN1.BAS"
PRINT "PROGRAM USES GENETIC CONCEPTS TO FIND GOOD CHOKE CONFIGURATIONS"
PRINT
'*
FREQ = 30
FCOUNT = 1
DELTAX = .25
YCLIP = 3.2
'*
CALL REQUESTINPUTDATA
'*
CALL INITIALIZEARRAYS
'*
CITSTART = 1
CALL INITIALIZERANKS(CITSTART, NCIT, GEN)
PRINT "QTOTAL, QTOT = "; QTOT

'*
CALL SORTRANKS(NCIT)
'*
D$ = "H90TEMP2.TXT"
OPEN D$ FOR OUTPUT AS #1
FOR CITIZEN = 1 TO NCIT
PRINT #1, "CITIZEN NO. "; CITIZEN
PRINT #1, "X Y QUALITY= "; QUAL(CITIZEN)
FOR J = 1 TO NNODES
PRINT #1, XG(CITIZEN, J), YG(CITIZEN, J)
NEXT J
NEXT CITIZEN
CLOSE #1
'*

DO WHILE CONT$ <> "n" AND CONT$ <> "N"
CALL EVOLVE(NCIT, NCITNEW)
PRINT
INPUT " CONTINUE? ENTER N TO STOP "; CONT$
IF (CONT$ <> "N" AND CONT$ <> "n") THEN
INPUT " ENTER NEW NGEN, # OF GENERATIONS "; NGEN
END IF
LOOP
'*
CALL STOREOUTPUTDATA(NGEN, NCITNEW)

'PRINT
'PRINT "CITIZEN RANK(CITIZEN) ZG(CIT,2) PG(CIT,2)"
'FOR CITIZEN = 1 TO 5
' PRINT CITIZEN, RANK(CITIZEN), ZG(CITIZEN, 2), PG(CITIZEN, 2)
'NEXT CITIZEN
'

Comments

  • moneomoneo Posts: 39Member
    : Hello,
    :
    : As a result of a google search I found this routine.
    : Can anybody tell me what language is this? Looks like a flavour of BASIC.
    :
    : Thanks
    :
    : PS Tried VB, GWBASIC, Liberty Basic. des not seem to be any of these.
    :
    : DECLARE SUB SPRINKLE (NCIT!, NCITNEW!)
    : DECLARE SUB EVOLVE (NCIT!, NCITNEW)
    : DECLARE SUB BIRTH (CIT!, K!, BABY!)
    : DECLARE SUB MARRY (NCIT!, NCITNEW!, GEN!)
    : DECLARE SUB SWAPARRAYS (NMAX!, K!)
    : DECLARE SUB SORTRANKS (NCIT!)
    : DECLARE SUB MUTATE (NCIT, GEN)
    : DECLARE SUB MUTATEIFSAME (NCIT, GEN)
    : DECLARE SUB STOREOUTPUTDATA (GEN, NCITNEW)
    : DECLARE SUB SEEIFIMPROVED (MUTFLAG, GEN)
    : DECLARE SUB SHOWRESULTS (GEN)
    : DECLARE SUB MAKEAK2DINPUTFILE (NODE(), X(), Y(), NNODES)
    : DECLARE SUB GOAK2D ()
    : DECLARE SUB QUALITY (NPOINTS)
    : DECLARE SUB QUALITYHP (QHP)
    : DECLARE SUB QUALITYPATTERN (QPAT)
    : DECLARE SUB QUALITYRIPPLE (QRIPL)
    : DECLARE SUB HPBW (NPOINTS)
    : DECLARE SUB NORMALIZEDATA (NPOINTS)
    : DECLARE SUB READINPUTDATA (NPOINTS)
    : DECLARE SUB XMINMAX (CHOKENO, K, XGCOORD, YGCOORD, SIGHN, DELTAX)
    : DECLARE SUB REQUESTINPUTDATA ()
    : DECLARE SUB INITIALIZEARRAYS ()
    : DECLARE SUB INITIALIZERANKS (CITSTART, NCIT, GEN)
    : DECLARE SUB RUNAK2DROUTINES (GEN)
    :
    : COMMON SHARED NNODES, NGEN, NCIT, QTOTH, QTOTE, NFREQS, AKERFLG
    : COMMON SHARED QHP, QPAT, QRIPL, QTOT, DELTAX, YCLIP, GENN
    : DIM SHARED MAGCO(5, 400), THMAXMAG(5), HP(5)
    : DIM SHARED X(200), Y(200), X1(200), Y1(200), NODE(200)
    : DIM SHARED QUAL(110), RANK(110), XG(120, 120), YG(120, 120), QTOTE(10), QTOTH(10)
    : DIM SHARED ETHCO(400), QTEST(10)
    :
    : RANDOMIZE TIMER
    : CLS
    : '* PRINT HEADER
    : PRINT
    : PRINT "PROGRAM GEN1.BAS"
    : PRINT "PROGRAM USES GENETIC CONCEPTS TO FIND GOOD CHOKE CONFIGURATIONS"
    : PRINT
    : '*
    : FREQ = 30
    : FCOUNT = 1
    : DELTAX = .25
    : YCLIP = 3.2
    : '*
    : CALL REQUESTINPUTDATA
    : '*
    : CALL INITIALIZEARRAYS
    : '*
    : CITSTART = 1
    : CALL INITIALIZERANKS(CITSTART, NCIT, GEN)
    : PRINT "QTOTAL, QTOT = "; QTOT
    :
    : '*
    : CALL SORTRANKS(NCIT)
    : '*
    : D$ = "H90TEMP2.TXT"
    : OPEN D$ FOR OUTPUT AS #1
    : FOR CITIZEN = 1 TO NCIT
    : PRINT #1, "CITIZEN NO. "; CITIZEN
    : PRINT #1, "X Y QUALITY= "; QUAL(CITIZEN)
    : FOR J = 1 TO NNODES
    : PRINT #1, XG(CITIZEN, J), YG(CITIZEN, J)
    : NEXT J
    : NEXT CITIZEN
    : CLOSE #1
    : '*
    :
    : DO WHILE CONT$ <> "n" AND CONT$ <> "N"
    : CALL EVOLVE(NCIT, NCITNEW)
    : PRINT
    : INPUT " CONTINUE? ENTER N TO STOP "; CONT$
    : IF (CONT$ <> "N" AND CONT$ <> "n") THEN
    : INPUT " ENTER NEW NGEN, # OF GENERATIONS "; NGEN
    : END IF
    : LOOP
    : '*
    : CALL STOREOUTPUTDATA(NGEN, NCITNEW)
    :
    : 'PRINT
    : 'PRINT "CITIZEN RANK(CITIZEN) ZG(CIT,2) PG(CIT,2)"
    : 'FOR CITIZEN = 1 TO 5
    : ' PRINT CITIZEN, RANK(CITIZEN), ZG(CITIZEN, 2), PG(CITIZEN, 2)
    : 'NEXT CITIZEN
    : '
    :
    :
    : Hi Tuli,
    Because of the use of SUB's, as evidenced by the DECLARE's and the CALL's, the code looks like QuickBASIC or even QBasic, both by Microsoft, and almost the same.

    It definitely cannot be GWBasic, which does not support SUB's, and the same applies to BASICA. I don't know PowerBasic, so I can't say.

    Regards..... Moneo


  • melissa_may1melissa_may1 Posts: 937Member
    Hey!

    This looks like it'd work with VB or GW. Do you have the code for all those declared subs? Do you get error messages?

    : Hello,
    :
    : As a result of a google search I found this routine.
    : Can anybody tell me what language is this? Looks like a flavour of BASIC.
    :
    : Thanks
    :
    : PS Tried VB, GWBASIC, Liberty Basic. des not seem to be any of these.
    :
    : DECLARE SUB SPRINKLE (NCIT!, NCITNEW!)
    : DECLARE SUB EVOLVE (NCIT!, NCITNEW)
    : DECLARE SUB BIRTH (CIT!, K!, BABY!)
    : DECLARE SUB MARRY (NCIT!, NCITNEW!, GEN!)
    : DECLARE SUB SWAPARRAYS (NMAX!, K!)
    : DECLARE SUB SORTRANKS (NCIT!)
    : DECLARE SUB MUTATE (NCIT, GEN)
    : DECLARE SUB MUTATEIFSAME (NCIT, GEN)
    : DECLARE SUB STOREOUTPUTDATA (GEN, NCITNEW)
    : DECLARE SUB SEEIFIMPROVED (MUTFLAG, GEN)
    : DECLARE SUB SHOWRESULTS (GEN)
    : DECLARE SUB MAKEAK2DINPUTFILE (NODE(), X(), Y(), NNODES)
    : DECLARE SUB GOAK2D ()
    : DECLARE SUB QUALITY (NPOINTS)
    : DECLARE SUB QUALITYHP (QHP)
    : DECLARE SUB QUALITYPATTERN (QPAT)
    : DECLARE SUB QUALITYRIPPLE (QRIPL)
    : DECLARE SUB HPBW (NPOINTS)
    : DECLARE SUB NORMALIZEDATA (NPOINTS)
    : DECLARE SUB READINPUTDATA (NPOINTS)
    : DECLARE SUB XMINMAX (CHOKENO, K, XGCOORD, YGCOORD, SIGHN, DELTAX)
    : DECLARE SUB REQUESTINPUTDATA ()
    : DECLARE SUB INITIALIZEARRAYS ()
    : DECLARE SUB INITIALIZERANKS (CITSTART, NCIT, GEN)
    : DECLARE SUB RUNAK2DROUTINES (GEN)
    :
    : COMMON SHARED NNODES, NGEN, NCIT, QTOTH, QTOTE, NFREQS, AKERFLG
    : COMMON SHARED QHP, QPAT, QRIPL, QTOT, DELTAX, YCLIP, GENN
    : DIM SHARED MAGCO(5, 400), THMAXMAG(5), HP(5)
    : DIM SHARED X(200), Y(200), X1(200), Y1(200), NODE(200)
    : DIM SHARED QUAL(110), RANK(110), XG(120, 120), YG(120, 120), QTOTE(10), QTOTH(10)
    : DIM SHARED ETHCO(400), QTEST(10)
    :
    : RANDOMIZE TIMER
    : CLS
    : '* PRINT HEADER
    : PRINT
    : PRINT "PROGRAM GEN1.BAS"
    : PRINT "PROGRAM USES GENETIC CONCEPTS TO FIND GOOD CHOKE CONFIGURATIONS"
    : PRINT
    : '*
    : FREQ = 30
    : FCOUNT = 1
    : DELTAX = .25
    : YCLIP = 3.2
    : '*
    : CALL REQUESTINPUTDATA
    : '*
    : CALL INITIALIZEARRAYS
    : '*
    : CITSTART = 1
    : CALL INITIALIZERANKS(CITSTART, NCIT, GEN)
    : PRINT "QTOTAL, QTOT = "; QTOT
    :
    : '*
    : CALL SORTRANKS(NCIT)
    : '*
    : D$ = "H90TEMP2.TXT"
    : OPEN D$ FOR OUTPUT AS #1
    : FOR CITIZEN = 1 TO NCIT
    : PRINT #1, "CITIZEN NO. "; CITIZEN
    : PRINT #1, "X Y QUALITY= "; QUAL(CITIZEN)
    : FOR J = 1 TO NNODES
    : PRINT #1, XG(CITIZEN, J), YG(CITIZEN, J)
    : NEXT J
    : NEXT CITIZEN
    : CLOSE #1
    : '*
    :
    : DO WHILE CONT$ <> "n" AND CONT$ <> "N"
    : CALL EVOLVE(NCIT, NCITNEW)
    : PRINT
    : INPUT " CONTINUE? ENTER N TO STOP "; CONT$
    : IF (CONT$ <> "N" AND CONT$ <> "n") THEN
    : INPUT " ENTER NEW NGEN, # OF GENERATIONS "; NGEN
    : END IF
    : LOOP
    : '*
    : CALL STOREOUTPUTDATA(NGEN, NCITNEW)
    :
    : 'PRINT
    : 'PRINT "CITIZEN RANK(CITIZEN) ZG(CIT,2) PG(CIT,2)"
    : 'FOR CITIZEN = 1 TO 5
    : ' PRINT CITIZEN, RANK(CITIZEN), ZG(CITIZEN, 2), PG(CITIZEN, 2)
    : 'NEXT CITIZEN
    : '
    :
    :



    [purple]Melissa[/purple]

Sign In or Register to comment.