Recent Posts

Pages: 1 ... 6 7 [8] 9 10
71
Games / TriQuad Remake
« Last post by B+ on July 21, 2019, 01:51:05 AM »
This is total overhaul of Rick's TriQuad clone done in Naalaa some time ago. This game allows user to choose from 3 to 9 square pieces per side, uses a different method to build the puzzle and uses a different method to detect/check solutions since it is possible by random luck to have multiple solutions to a puzzle.

QB64v1.3
Code: [Select]
OPTION _EXPLICIT
_TITLE "TriQuad Puzzle" 'B+ start 2019-07-17 trans to QB64 from:
' TriQuad.bas  SmallBASIC 0.12.8 [B+=MGA] 2017-03-26
' inspired by rick3137's recent post at Naalaa of cute puzzle
' 2019-07 Complete remake for N X N puzzles, not just 3 X 3's.

RANDOMIZE TIMER

CONST xmax = 1000, margin = 50 'screen size, margin that should allow a line above and below the puzzle display
CONST topLeftB1X = margin, topLeftB2X = xmax / 2 + .5 * margin, topY = margin

'these have to be decided from user input from Intro screen
DIM SHARED ymax, N, Nm1, NxNm1, sq, sq2, sq4
ymax = 500 'for starters in intro screen have resizing in pixels including ymax

REDIM SHARED B1(2, 2), B2(2, 2) ' B1() box container for scrambled pieces of C(), B2 box container to build solution
REDIM SHARED C(8, 3) '9 squares 4 colored triangles, C() contains the solution as created by code, may not be the only one!

DIM mx, my, mb, bx, by, holdF, ky AS STRING, again AS STRING

SCREEN _NEWIMAGE(xmax, ymax, 32)
_SCREENMOVE 300, 40
intro
restart:
assignColors
holdF = N * N
WHILE 1
    CLS
    showB (1)
    showB (2)
    WHILE _MOUSEINPUT: WEND
    mx = _MOUSEX: my = _MOUSEY: mb = _MOUSEBUTTON(1)
    IF mb THEN
        DO WHILE mb
            WHILE _MOUSEINPUT: WEND
            mx = _MOUSEX: my = _MOUSEY: mb = _MOUSEBUTTON(1)
        LOOP
        IF topY <= my AND my <= topY + N * sq THEN
            by = INT((my - topY) / sq)
            'LOCATE 1, 1: PRINT SPACE$(20)
            'LOCATE 1, 1: PRINT "bY = "; by
            IF topLeftB1X <= mx AND mx <= topLeftB1X + N * sq THEN 'mx in b1
                bx = INT((mx - topLeftB1X) / sq)
                'LOCATE 2, 1: PRINT SPACE$(20)
                'LOCATE 2, 1: PRINT "bX = "; bx
                IF holdF < N * N THEN 'trying to put the piece on hold here?
                    IF B1(bx, by) = N * N THEN
                        B1(bx, by) = holdF: holdF = N * N
                    END IF
                ELSEIF holdF = N * N THEN
                    IF B1(bx, by) < N * N THEN
                        holdF = B1(bx, by): B1(bx, by) = N * N
                    END IF
                END IF
            ELSEIF topLeftB2X <= mx AND mx <= topLeftB2X + N * sq THEN 'mx in b2
                bx = INT((mx - topLeftB2X) / sq)
                'LOCATE 2, 1: PRINT SPACE$(20)
                'LOCATE 2, 1: PRINT "bX = "; bx
                IF holdF < N * N THEN
                    IF B2(bx, by) = N * N THEN
                        B2(bx, by) = holdF: holdF = N * N
                    END IF
                ELSEIF holdF = N * N THEN
                    IF B2(bx, by) < N * N THEN
                        holdF = B2(bx, by): B2(bx, by) = N * N
                    END IF
                END IF 'my out of range
            END IF
        END IF
    END IF
    IF solved THEN
        COLOR hue(9)
        LOCATE 2, 1: centerPrint "Congratulations puzzle solved!"
        _DISPLAY
        _DELAY 3
        EXIT WHILE
    END IF
    ky = INKEY$
    IF LEN(ky) THEN
        IF ky = "q" THEN
            showSolution
            COLOR hue(9)
            LOCATE 2, 1: centerPrint "Here is solution (for 10 secs), Goodbye!"
            _DISPLAY
            _DELAY 10
            SYSTEM
        END IF
    END IF
    _DISPLAY
    _LIMIT 100
WEND
COLOR hue(9): LOCATE 2, 1: centerPrint SPACE$(50): LOCATE 2, 1
centerPrint "Press enter to play again, any + enter ends... "
_DISPLAY
again = INKEY$
WHILE LEN(again) = 0: again = INKEY$: _LIMIT 200: WEND
IF ASC(again) = 13 THEN GOTO restart ELSE SYSTEM

FUNCTION solved
    'since it is possible that a different tile combination could be a valid solution we have to check points
    DIM x, y
    'first check that there is a puzzle piece in every slot of b2
    FOR y = 0 TO Nm1
        FOR x = 0 TO Nm1
            IF B2(x, y) = N * N THEN EXIT FUNCTION
        NEXT
    NEXT
    'check left and right triangle matches in b2
    FOR y = 0 TO Nm1
        FOR x = 0 TO Nm1 - 1
            IF POINT(topLeftB2X + x * sq + sq2 + sq4, topY + y * sq + sq2) <> POINT(topLeftB2X + (x + 1) * sq + sq4, topY + y * sq + sq2) THEN EXIT FUNCTION
        NEXT
    NEXT
    'check to and bottom triangle matches in b2
    FOR y = 0 TO Nm1 - 1
        FOR x = 0 TO Nm1
            'the color of tri4 in piece below = color tri1 of piece above
            IF POINT(topLeftB2X + x * sq + sq2, topY + y * sq + sq2 + sq4) <> POINT(topLeftB2X + x * sq + sq2, topY + (y + 1) * sq + sq4) THEN EXIT FUNCTION
        NEXT
    NEXT
    'if made it this far then solved
    solved = -1
END FUNCTION

SUB showSolution
    DIM x, y, index
    FOR y = 0 TO Nm1
        FOR x = 0 TO Nm1
            drawSquare index, x * sq + topLeftB2X, y * sq + topY
            index = index + 1
        NEXT
    NEXT
END SUB

SUB showB (board)
    DIM x, y, index
    FOR y = 0 TO Nm1
        FOR x = 0 TO Nm1
            IF board = 1 THEN
                index = B1(x, y)
                drawSquare index, x * sq + topLeftB1X, y * sq + topY
            ELSE
                index = B2(x, y)
                drawSquare index, x * sq + topLeftB2X, y * sq + topY
            END IF
        NEXT
    NEXT
END SUB

SUB drawSquare (index, x, y)
    LINE (x, y)-STEP(sq, sq), &HFF000000, BF
    LINE (x, y)-STEP(sq, sq), &HFFFFFFFF, B
    IF index < N * N THEN
        LINE (x, y)-STEP(sq, sq), &HFFFFFFFF
        LINE (x + sq, y)-STEP(-sq, sq), &HFFFFFFFF
        PAINT (x + sq2 + sq4, y + sq2), hue(C(index, 0)), &HFFFFFFFF
        PAINT (x + sq2, y + sq2 + sq4), hue(C(index, 1)), &HFFFFFFFF
        PAINT (x + sq4, y + sq2), hue(C(index, 2)), &HFFFFFFFF
        PAINT (x + sq2, y + sq4), hue(C(index, 3)), &HFFFFFFFF
    END IF
END SUB

SUB assignColors ()
    'the pieces are indexed 0 to N X N -1  (NxNm1)
    ' y(index) = int(index/N) : x(index) = index mod N
    ' index(x, y) = (y - 1) * N + x

    DIM i, j, x, y
    'first assign a random color rc to every triangle
    FOR i = 0 TO NxNm1 'piece index
        FOR j = 0 TO 3 'tri color index for piece
            C(i, j) = rand(1, 9)
        NEXT
    NEXT
    'next match c0 to c3 of square to right
    FOR y = 0 TO Nm1
        FOR x = 0 TO Nm1 - 1
            'the color of tri3 of next square piece to right = color of tri0 to left of it
            C(y * N + x + 1, 2) = C(y * N + x, 0)
        NEXT
    NEXT
    FOR y = 0 TO Nm1 - 1
        FOR x = 0 TO Nm1
            'the color of tri4 in piece below = color tri1 of piece above
            C((y + 1) * N + x, 3) = C(y * N + x, 1)
        NEXT
    NEXT

    ' C() now contains one solution for puzzle, may not be the only one

    ' scramble pieces to box1
    DIM t(0 TO NxNm1), index 'temp array
    FOR i = 0 TO NxNm1: t(i) = i: NEXT
    FOR i = NxNm1 TO 1 STEP -1: SWAP t(i), t(rand(0, i)): NEXT
    FOR y = 0 TO Nm1
        FOR x = 0 TO Nm1
            B1(x, y) = t(index)
            index = index + 1
            B2(x, y) = N * N
            'PRINT B1(x, y), B2(x, y)
        NEXT
    NEXT
END SUB

FUNCTION hue~& (n)
    SELECT CASE n
        CASE 0: hue~& = &HFF000000
        CASE 1: hue~& = &HFFA80062
        CASE 2: hue~& = &HFF000050
        CASE 3: hue~& = &HFFE3333C
        CASE 4: hue~& = &HFFFF0000
        CASE 5: hue~& = &HFF008000
        CASE 6: hue~& = &HFF0000FF
        CASE 7: hue~& = &HFFFF64FF
        CASE 8: hue~& = &HFFFFFF00
        CASE 9: hue~& = &HFF00EEEE
        CASE 10: hue~& = &HFF663311
    END SELECT
END FUNCTION

FUNCTION rand% (n1, n2)
    DIM hi, lo
    IF n1 > n2 THEN hi = n1: lo = n2 ELSE hi = n2: lo = n1
    rand% = (RND * (hi - lo + 1)) \ 1 + lo
END FUNCTION

SUB intro 'use intro to select number of pieces
    DIM test AS INTEGER
    CLS: COLOR hue(8): LOCATE 3, 1
    centerPrint "TriQuad Instructions:": PRINT: COLOR hue(9)
    centerPrint "This puzzle has two boxes that contain up to N x N square pieces of 4 colored triangles."
    centerPrint "The object is to match up the triangle edges from left Box to fill the Box on the right.": PRINT
    centerPrint "You may move any square piece to an empty space on either board by:"
    centerPrint "1st clicking the piece to disappear it,"
    centerPrint "then clicking any empty space for it to reappear.": PRINT
    centerPrint "You may press q to quit and see the solution displayed.": PRINT
    centerPrint "Hint: the colors without matching"
    centerPrint "complement, are edge pieces.": PRINT
    centerPrint "Good luck!": COLOR hue(5)
    LOCATE CSRLIN + 2, 1: centerPrint "Press number key for square pieces per side (3 to 9, 1 to quit)..."
    WHILE test < 3 OR test > 9
        test = VAL(INKEY$)
        IF test = 1 THEN SYSTEM
    WEND
    N = test ' pieces per side of 2 boards
    Nm1 = N - 1 ' FOR loops
    NxNm1 = N * N - 1 ' FOR loop of piece index
    'sizing
    sq = (xmax / 2 - 1.5 * margin) / N 'square piece side size
    sq2 = sq / 2: sq4 = sq / 4
    ymax = sq * N + 2 * margin
    REDIM B1(Nm1, Nm1), B2(Nm1, Nm1), C(NxNm1, 3)
    SCREEN _NEWIMAGE(xmax, ymax, 32)
    '_SCREENMOVE 300, 40    'need again?
    'PRINT ymax
END SUB

SUB centerPrint (s$)
    LOCATE CSRLIN, (xmax / 8 - LEN(s$)) / 2: PRINT s$
END SUB
72
General questions and discussions / Re: Celtic Knot Challenge
« Last post by B+ on July 21, 2019, 12:13:48 AM »
No more eyeballing in the bridges, it's all done with code but it is very temperamental.
Code: [Select]
OPTION _EXPLICIT
_TITLE "Knot Function of Angle" ' B+ 2019-07-18
' another attempt to get intersect points by computer rather than eyeball

CONST xmax = 740, ymax = 740, pi = 3.14159265
SCREEN _NEWIMAGE(xmax, ymax, 32)
_SCREENMOVE 300, 0
DIM x0, y0, r0, rThick, rFill 'for knot  r is for equation, r1 is for thickness of rings, r2 is fill thicknes

x0 = xmax / 2: y0 = ymax / 2: r0 = 120: rThick = 4: rFill = 2
x0 = xmax / 2: y0 = ymax / 2: r0 = 100: rThick = 8: rFill = 4
knot xmax / 4, ymax / 4, 60, 15, 8, &HFF009900, &HFF0000FF, 1
knot 3 * xmax / 4, ymax / 4 + 35, 100, 8, 4, &HFFFFFF00, &HFFFF0000, 2
knot xmax / 4, ymax * 3 / 4, 98, 4, 1, &HFFFFFFFF, &HFF009900, 3
knot xmax * 3 / 4, ymax * 3 / 4, 90, 4, 2, &HFF0000FF, &HFF00BBBB, 4

SUB knot (xc, yc, r, r1, r2, border AS _UNSIGNED LONG, fill AS _UNSIGNED LONG, functionNum)

    DIM counts(_WIDTH, _HEIGHT) AS INTEGER, ang(_WIDTH, _HEIGHT) AS SINGLE
    DIM a, x AS INTEGER, y AS INTEGER, stepper 'for plotting

    stepper = 1 / (2 * pi * r) 'how close to step   'orig 2*pi
    'first pass draw in outline
    FOR a = 0 TO 2 * pi - 2 * stepper STEP stepper 'collect data
        SELECT CASE functionNum
            CASE 1: FofA xc, yc, r, a, x, y
            CASE 2: FofA2 xc, yc, r, a, x, y
            CASE 3: FofA3 xc, yc, r, a, x, y
            CASE 4: FofA4 xc, yc, r, a, x, y
        END SELECT
        IF counts(x, y) <> 0 THEN
            IF ABS(ang(x, y) - a) > pi / 12 THEN 'not too close   pi/12 orig
                counts(x, y) = counts(x, y) + 1 'hopefully
                ang(x, y) = a 'update xy position with latest angle
            END IF
        ELSE
            counts(x, y) = 1: ang(x, y) = a
            fcirc x, y, r1, border
        END IF
    NEXT

    DIM intersects(100, 1) AS INTEGER, ii AS INTEGER, i, flag
    'next pass draw in fill
    FOR y = 0 TO ymax
        FOR x = 0 TO xmax
            IF counts(x, y) THEN fcirc x, y, r2, fill
            IF counts(x, y) > 1 THEN
                IF ii > 0 THEN
                    flag = 0
                    FOR i = 0 TO ii
                        IF ((intersects(i, 0) - x) ^ 2 + (intersects(i, 1) - y) ^ 2) ^ .5 < 2 THEN flag = 1: EXIT FOR
                    NEXT
                    IF flag = 0 THEN
                        intersects(ii, 0) = x
                        intersects(ii, 1) = y
                        ii = ii + 1
                    END IF
                ELSE
                    intersects(ii, 0) = x
                    intersects(ii, 1) = y
                    ii = ii + 1
                END IF
            END IF
        NEXT
    NEXT

    'For each intersect there is am angle it goes over and an angle it goes under
    ' looking at figure from angle = 0, it alternates over, under, over, under....;
    ' its the over angles that need the bridges. How to find the over angles?

    DIM lasta, toggle, b, xx AS INTEGER, yy AS INTEGER
    FOR a = 0 TO 2 * pi - 2 * stepper STEP stepper 'collect data
        SELECT CASE functionNum
            CASE 1: FofA xc, yc, r, a, x, y
            CASE 2: FofA2 xc, yc, r, a, x, y
            CASE 3: FofA3 xc, yc, r, a, x, y
            CASE 4: FofA4 xc, yc, r, a, x, y
        END SELECT

        FOR i = 0 TO ii - 1
            IF x = intersects(i, 0) AND y = intersects(i, 1) AND ABS(a - lasta) > pi / 24 THEN
                toggle = (toggle + 1) MOD 2
                IF toggle THEN 'save every other angle as positive for the overpasses
                    'build a bridge
                    FOR b = a - 3 * pi / 96 TO a + 3 * pi / 96 STEP stepper
                        SELECT CASE functionNum
                            CASE 1: FofA xc, yc, r, b, xx, yy
                            CASE 2: FofA2 xc, yc, r, b, xx, yy
                            CASE 3: FofA3 xc, yc, r, b, xx, yy
                            CASE 4: FofA4 xc, yc, r, b, xx, yy
                        END SELECT
                        fcirc xx, yy, r1, border
                    NEXT
                    FOR b = a - 4 * pi / 96 TO a + 4 * pi / 96 STEP stepper
                        SELECT CASE functionNum
                            CASE 1: FofA xc, yc, r, b, xx, yy
                            CASE 2: FofA2 xc, yc, r, b, xx, yy
                            CASE 3: FofA3 xc, yc, r, b, xx, yy
                            CASE 4: FofA4 xc, yc, r, b, xx, yy
                        END SELECT
                        fcirc xx, yy, r2, fill
                    NEXT
                END IF
                lasta = a
                EXIT FOR
            END IF
        NEXT
    NEXT
END SUB

SUB FofA (xc, yc, r, a AS SINGLE, xReturn AS INTEGER, yReturn AS INTEGER)
    xReturn = INT(xc + r * (COS(a) + COS(4 * a) / .7 + SIN(2 * a) / 12))
    yReturn = INT(yc + r * (SIN(a) + SIN(4 * a) / .7 + COS(2 * a) / 12))
END SUB

SUB FofA2 (xc, yc, r, a AS SINGLE, xReturn AS INTEGER, yReturn AS INTEGER)
    xReturn = xc + r * (COS(a) + COS(5 * a) / 1.6 + SIN(2 * a) / 3)
    yReturn = yc + r * (SIN(a) + SIN(5 * a) / 1.6 + COS(2 * a) / 3)
END SUB

SUB FofA3 (xc, yc, r, a AS SINGLE, xReturn AS INTEGER, yReturn AS INTEGER)
    xReturn = xc + r * (COS(a) + COS(7 * a) / 2 + SIN(2 * a) / 3)
    yReturn = yc + r * (SIN(a) + SIN(7 * a) / 2 + COS(2 * a) / 3)
END SUB

'for function number 4, the following works best

SUB FofA4 (xc, yc, r, a AS SINGLE, xReturn AS INTEGER, yReturn AS INTEGER)
    xReturn = xc + r * (COS(a) + COS(4 * a) / 2.9 + SIN(6 * a) / 2.1) '2.6 2.1 works
    yReturn = yc + r * (SIN(a) + SIN(4 * a) / 2.9 + COS(6 * a) / 2.1) ' 2.7 2.2 better? 2.8 2.3 OK too  2.9 2.1 is it
END SUB

'''''' ================= failed: bridges too close or passes do not alternate , too many loops?
'''''  Toggle commented function blocks to see some fancy loops tried


'SUB FofA4 (xc, yc, r, a AS SINGLE, xReturn AS INTEGER, yReturn AS INTEGER)
'    xReturn = xc + r * (COS(a) + COS(9 * a) / 2.5 + SIN(3 * a) / 2.6)
'    yReturn = yc + r * (SIN(a) + SIN(9 * a) / 2.5 + COS(3 * a) / 2.6)
'END SUB

'SUB FofA4 (xc, yc, r, a AS SINGLE, xReturn AS INTEGER, yReturn AS INTEGER)
'    xReturn = xc + r * (COS(a) + COS(3 * a) / 2 + SIN(11 * a) / 2.7)
'    yReturn = yc + r * (SIN(a) + SIN(3 * a) / 2 + COS(11 * a) / 2.7)
'END SUB

'SUB FofA4 (xc, yc, r, a AS SINGLE, xReturn AS INTEGER, yReturn AS INTEGER)
'    xReturn = xc + r * (COS(a) + COS(9 * a) / 2 + SIN(5 * a) / 2.5)
'    yReturn = yc + r * (SIN(a) + SIN(9 * a) / 2 + COS(5 * a) / 2.5)
'END SUB

'SUB FofA4 (xc, yc, r, a AS SINGLE, xReturn AS INTEGER, yReturn AS INTEGER)
'    xReturn = xc + r * (COS(a) + COS(5 * a) / 2.7 + SIN(6 * a) / 2)
'    yReturn = yc + r * (SIN(a) + SIN(5 * a) / 2.7 + COS(6 * a) / 2)
'END SUB

SUB fcirc (CX AS INTEGER, CY AS INTEGER, R AS INTEGER, C AS _UNSIGNED LONG)
    DIM Radius AS INTEGER, RadiusError AS INTEGER
    DIM X AS INTEGER, Y AS INTEGER
    Radius = ABS(R): RadiusError = -Radius: X = Radius: Y = 0
    IF Radius = 0 THEN PSET (CX, CY), C: EXIT SUB
    LINE (CX - X, CY)-(CX + X, CY), C, BF
    WHILE X > Y
        RadiusError = RadiusError + Y * 2 + 1
        IF RadiusError >= 0 THEN
            IF X <> Y + 1 THEN
                LINE (CX - Y, CY - X)-(CX + Y, CY - X), C, BF
                LINE (CX - Y, CY + X)-(CX + Y, CY + X), C, BF
            END IF
            X = X - 1
            RadiusError = RadiusError - X * 2
        END IF
        Y = Y + 1
        LINE (CX - X, CY - Y)-(CX + X, CY - Y), C, BF
        LINE (CX - X, CY + Y)-(CX + X, CY + Y), C, BF
    WEND
END SUB

73
Code and examples / Dynamic arrays
« Last post by jj2007 on July 17, 2019, 10:40:00 PM »
This example reads a text file that has the format Country   Series    Value1  Value 2 into a numeric matrix, i.e. a two-dimensional numeric array - useful for working with spreadsheets and tables. Project attached, MasmBasic of 16 July 2019 or later is required.

include \masm32\MasmBasic\MasmBasic.inc
  Init                                ; *** read values from a text file into a numeric array ***
  Recall "UnderFiveMortalityRate.tab", L$(), tab        ; tab-delimited text -> two-dimensional string array
  Clr ecx, edi                                          ; we need two counters
  Print "Under 5 mortality rate", CrLf$, L$(0, 0)       ; Country
  Print At(22) "  ", L$(0, 2), Tb$, L$(0, 3)            ; 1990, 2013
  QSort L$(), 0, 2003h                ; sort string array numerically by column 3
  Delete L$(0)                        ; we don't want the captions
  Dim Under5() As double              ; create a dynamic numeric array
  Dim StringIndex() As DWORD          ; and another one to keep track of the names
  .Repeat
        xor esi, esi                  ; column counter
        .Repeat
                MovVal <Under5(edi, esi)>, L$(ecx, esi+2)    ; assign values to the numeric array
                inc esi
        .Until edx==-127 || esi>=99     ; MovVal returns -127 in edx if no valid number was found
        .if esi>2
                mov StringIndex(edi), ecx       ; remember the country
                inc edi         ; advance numeric array row index only if at least two values found
        .endif
        inc ecx
  .Until ecx>=L$(?)             ; loop until strings are finished
  For_ ct=0 To Under5(?rows)-1
                Print Str$("\n%i\t", ct), L$(StringIndex(ct), 0)
                Print At(22) " "
                For_ ecx=0 To Under5(?cols)-1
                                Print Tb$, Str$("%4f", Under5(ct, ecx))
                Next
  Next
  PrintLine CrLf$
  deb 4, "total strings", L$(?)
  deb 4, "total numbers", Under5(?)
  deb 4, "valid rows", Under5(?rows)
  deb 4, "valid columns", Under5(?cols)
  Inkey "--- hit any key ---"
EndOfCode


Output:
Code: [Select]
Under 5 mortality rate
Country                 1990    2013
0       Iceland         6.400   2.100
1       Finland         6.700   2.600
2       Singapore       7.700   2.800
3       Sweden          6.900   3.000
4       Italy           9.600   3.600
5       Austria         9.500   3.900
6       Germany         8.500   3.900
7       Australia       9.200   4.000
8       France          9.000   4.200
9       Switzerland     8.200   4.200
10      Belgium         10.000  4.400
11      United Kingdom  9.300   4.600
12      Cuba            13.30   6.200
13      United States   11.20   6.900
14      Yemen           124.8   51.30
15      Zambia          192.5   87.40
16      Zimbabwe        74.60   88.50
17      Afghanistan     179.1   97.30

total strings   eaX             23
total numbers   eax             36
valid rows      eax             18
valid columns   eax             2
74
General questions and discussions / Re: BBC BASIC for SDL 2.0
« Last post by Richly on July 16, 2019, 07:13:47 PM »
Wow, has GL like QB64:

B+

Did you know that Richard has developed a translator that translates Qbasic to BBC BASIC?

Might be useful if you are comparing / translating between the two dialects whilst you are exploring...

http://www.bbcbasic.co.uk/qb2bbc/index.html

75
General questions and discussions / Re: BBC BASIC for SDL 2.0
« Last post by Richly on July 16, 2019, 06:57:26 PM »
Richard lists some features for both BBC BASIC for Windows and BBC for SDL 2.0

http://www.bbcbasic.co.uk/bbcwin/bbcwin.html

http://www.bbcbasic.co.uk/bbcsdl/

I suppose he is presenting these features as advantages, although no doubt many (most) feature in other BASICs in some shape or form.

I'm still at the 'B' in BASIC level (not B+ yet  :))) because I don't have a lot of time to practice (at least that's my excuse  ;D) and I tend to divide my practice (playing?) time between different BASICs and other languages.

In other words, others are more qualified to judge than I am.

However, from a 'B' level perspective:

    Pros = I am familiar with BBC BASIC and I can use it (SDL version) on my Windows, Android and Mac machines.
    Con = GUI programming in BB4W and BBC SDL is complex; for me, at least.

In fact, I find Sinclair BASIC more accessible than BBC BASIC; but that could be because I owned a ZX Spectrum back in the day, which was much cheaper to buy than a BBC Micro, and so I spent more time with Sinclair BASIC at home and less time with BBC BASIC at school.
76
General questions and discussions / Re: BBC BASIC for SDL 2.0
« Last post by B+ on July 16, 2019, 06:42:31 PM »
Wow, has GL like QB64:
77
General questions and discussions / Re: BBC BASIC for SDL 2.0
« Last post by B+ on July 16, 2019, 06:38:36 PM »
OK
78
General questions and discussions / Re: BBC BASIC for SDL 2.0
« Last post by Richly on July 16, 2019, 06:33:22 PM »
Wow off to a grand start!

BBC BASIC is case sensitive _ is that a pro or con  :)
79
General questions and discussions / Re: BBC BASIC for SDL 2.0
« Last post by B+ on July 16, 2019, 06:30:44 PM »
Wow off to a grand start!
80
General questions and discussions / Re: BBC BASIC for SDL 2.0
« Last post by Richly on July 15, 2019, 10:13:22 PM »
Well, I've banging on about BBC BASIC for a while  :)

https://retrogamecoding.org/board/index.php?topic=365.0

BBC BASIC has a fine pedigree, first written by Sophie Wilson of ARM fame

https://en.wikipedia.org/wiki/Sophie_Wilson

This version culminated in BBC BASIC V, which you will find as part of the current versions of RISC OS.

Richard developed his own versions of BBC BASIC (Z80 and DOS) culminating in BBC BASIC for Windows and latterly the cross-platform BBC BASIC for SDL 2.0 - both of which are still largely compatible with the original BBC BASIC whilst benefiting from modern enhancements.

More on the history of BBC BASIC can be found here https://en.wikipedia.org/wiki/BBC_BASIC and here http://www.rtrussell.co.uk/bbcbasic/history.html

There are also the Brandy versions of BBC BASIC - Brandy BASIC, Napoleon Brandy BASIC and the more recent Matrix Brandy BASIC.

I don't know if it does or doesn't have much love here but I think that it is widely respected. I suspect that it has more popularity with British users since it is a British BASIC and most of us Brits (including me) first encountered it at school when learning to program using BBC Micros.

https://www.bbc.co.uk/taster/pilots/computer-literacy-project

Even today, BBC Micros and BBC BASIC are still being used in the UK (along with more popular and modern languages like Scratch and modern platforms, such as the BBC Microbit and Raspberry PI) to teach kids how to code...the hard way...  ;)

https://www.tnmoc.org/learning

If you want to have a go at the original BBC BASIC like it was on the BBC Micro (and don't want to buy a BBC Micro or install RISC OS) then you can have a go using this great emulator

http://www.mkw.me.uk/beebem/


Pages: 1 ... 6 7 [8] 9 10