From: Svjatoslav Agejenko Date: Wed, 23 Apr 2025 00:13:06 +0000 (+0300) Subject: Better page homepage layout X-Git-Url: http://www2.svjatoslav.eu/gitweb/?a=commitdiff_plain;h=04499aa8edd3e2bb3f52019a3d0eb6092d5cc012;p=qbasicapps.git Better page homepage layout --- diff --git a/Graphics/Spirals/index.html b/Graphics/Spirals/index.html deleted file mode 100644 index 36a3931..0000000 --- a/Graphics/Spirals/index.html +++ /dev/null @@ -1,897 +0,0 @@ - - - - - - - -Spiral series - - - - - -
-

Spiral series

- - -
-

1. Spiral with increasing density

-
- -
-

spiral.png -

-
- -

-From every point in the spiral, subdivided line is traced. Line -segments are connected between the neighbors. Line segment count -progressively increases towards the center. -

- -

-spiral.bas -

- -
-
DECLARE SUB DrawLine (startX AS DOUBLE, startY AS DOUBLE, endX AS DOUBLE, endY AS DOUBLE, col AS INTEGER)
-' Program to render fancy looking spiral.
-' By Svjatoslav Agejenko.
-' Email: svjatoslav@svjatoslav.eu
-' Homepage: http://www.svjatoslav.eu
-'
-' Changelog:
-' 2003.12, Initial version
-' 2024.08, Improved program readability using AI
-
-DIM SHARED lineVertexX(1 TO 100) AS DOUBLE
-DIM SHARED lineVertexY(1 TO 100) AS DOUBLE
-DIM SHARED depth AS INTEGER
-DIM SHARED tempDepth AS INTEGER
-SCREEN 12
-
-' Initialize the scale factor for the spiral
-spiralScaleFactor = 200
-depth = 0
-
-' Generate the spiral by iterating through angles and scaling appropriately
-FOR angle = 1 TO 30 STEP .1
-    ' Calculate the current scale based on the remaining distance to the center
-    spiralScaleFactor = (30 - angle) * 7
-    ' Convert polar coordinates to cartesian for the current point
-    xPosition = SIN(angle) * spiralScaleFactor + 200
-    yPosition = COS(angle) * spiralScaleFactor + 200
-    ' Store the current depth (z-axis value)
-    tempDepth = angle
-    ' Draw a line from the previous point to the current point with a color based on depth
-    DrawLine xPosition + (xPosition / 2) + (angle * 3), (yPosition - (xPosition / 3)) + (angle * 3), xPosition + 25, yPosition + 25 - (angle * 3), depth
-    ' Set the color for the next segment
-    depth = 15
-NEXT angle
-
-' Wait for user input to close the program
-userInput$ = INPUT$(1)
-
-SUB DrawLine (startX AS DOUBLE, startY AS DOUBLE, endX AS DOUBLE, endY AS DOUBLE, col AS INTEGER)
-    ' Calculate the step increments for x and y based on the depth
-    deltaX = (endX - startX) / tempDepth
-    deltaY = (endY - startY) / tempDepth
-
-    FOR segmentIndex = 1 TO tempDepth
-        ' If there is a previous vertex, draw a line to the new starting point
-        IF lineVertexX(segmentIndex) > 0 THEN LINE (lineVertexX(segmentIndex), lineVertexY(segmentIndex))-(startX, startY), col
-        ' Store the current starting point as the next vertex
-        lineVertexX(segmentIndex) = startX
-        lineVertexY(segmentIndex) = startY
-        ' Increment the starting point by the calculated deltas
-        startX = startX + deltaX
-        startY = startY + deltaY
-        ' Draw a line from the stored vertex to the new starting point
-        LINE (lineVertexX(segmentIndex), lineVertexY(segmentIndex))-(startX, startY), col
-    NEXT segmentIndex
-END SUB
-
-
-
-
- -
-

2. Spiral with varying height

-
- -
-

spiral, 2.png -

-
- -

-From every point in the spiral, subdivided line is traced. Line -segments are connected between the neighbors. This creates effect -where lines run from edges towards the center. Center is vertically -displaced by sinus function where input is the distance to the center. -

- -

-spiral, 2.bas -

- -
-
' Program to render fancy looking spiral.
-' By Svjatoslav Agejenko.
-' Email: svjatoslav@svjatoslav.eu
-' Homepage: http://www.svjatoslav.eu
-'
-' Changelog:
-' 2003.12, Initial version
-' 2024.08, Improved program readability using AI
-
-DIM SHARED spiralX(1 TO 10000) AS SINGLE ' X coordinates of the spiral points
-DIM SHARED spiralY(1 TO 10000) AS SINGLE ' Y coordinates of the spiral points
-DIM SHARED pointCount AS INTEGER ' Total number of points plotted
-SCREEN 12 ' Set screen resolution to 640x480 with 16 colors
-
-' Initialize the scale factor for the spiral
-scaleFactor = 200
-pointCount = 0
-
-' Calculate and plot each point on the spiral
-FOR angle = 1 TO 100 STEP .05
-    pointCount = pointCount + 1
-    scaleFactor = 100 - angle ' Update the scaling factor as the loop progresses
-
-    ' Calculate the X and Y coordinates based on the sine and cosine of the angle
-    spiralX(pointCount) = SIN(angle) * scaleFactor * 3 + 320
-    spiralY(pointCount) = COS(angle) * scaleFactor + 300
-
-    ' Apply a vertical displacement to create a more dynamic effect
-    spiralY(pointCount) = spiralY(pointCount) + (SIN((angle + 20) / 10) * angle)
-
-    ' Plot the point on the screen
-    PSET (spiralX(pointCount), spiralY(pointCount)), 15
-NEXT angle
-
-' Draw lines between points to create the spiral effect
-FOR segmentStart = 1 TO pointCount - 125
-    LINE (spiralX(segmentStart), spiralY(segmentStart)) - _
-         (spiralX(segmentStart + 125), spiralY(segmentStart + 125)), 15
-NEXT segmentStart
-
-' Wait for user input before exiting
-a$ = INPUT$(1)
-END ' Exit the program
-
-
-
-
- -
-

3. Shaded spiral

-
- -
-

spiral, 3.png -

-
- -

-Similar to previous spiral, Line segments are connected between the -neighbors and sinus from the center decides vertical -displacement. Attempt of shading is made where brighter areas have -more detail. -

- -

-spiral, 3.bas -

- -
-
' Program to render fancy looking spiral with shaded surface.
-' By Svjatoslav Agejenko.
-' Email: svjatoslav@svjatoslav.eu
-' Homepage: http://www.svjatoslav.eu
-'
-' Changelog:
-' 2003.12, Initial version
-' 2024.08, Improved program readability using AI
-
-' Declare shared arrays for storing coordinates and sine values
-DIM SHARED spiralX(1 TO 10000)
-DIM SHARED spiralY(1 TO 10000)
-DIM SHARED sineValue1(1 TO 10000)
-DIM SHARED sineValue2(1 TO 10000)
-
-
-' Set the screen mode to 640x480 with 16 colors
-SCREEN 12
-
-' Initialize the spiral rotation parameter
-DIM spiralRotation AS SINGLE
-spiralRotation = 0
-
-' Generate and draw the spiral points
-FOR angle = 0 TO 150 STEP .05
-    spiralRotation = spiralRotation + 1
-    scaleFactor = 150 - angle
-
-    ' Calculate the X and Y coordinates for the current point
-    spiralX(spiralRotation) = SIN(angle) * scaleFactor * 3 + 320
-    spiralY(spiralRotation) = COS(angle) * scaleFactor + 300
-
-    ' Apply additional vertical displacement based on a secondary sine function
-    spiralY(spiralRotation) = spiralY(spiralRotation) + (SIN((angle + 20) / 10) * (angle / 5 + 1))
-
-    ' Store the current sine values for later use
-    sineValue1(spiralRotation) = SIN(angle)
-    sineValue2(spiralRotation) = SIN((angle + 20) / 10)
-
-    ' Draw the current point on the screen
-    PSET (spiralX(spiralRotation), spiralY(spiralRotation)), 15
-NEXT angle
-
-' Connect the points to form a continuous line
-FOR index = 1 TO spiralRotation - 127
-    ' Draw a line segment between points 126 steps apart
-    LINE (spiralX(index), spiralY(index))-(spiralX(index + 126), spiralY(index + 126)), 15
-
-    ' Initialize the line drawing flag
-    DIM drawLine AS INTEGER
-    drawLine = 1
-
-    ' Check conditions to determine if a line segment should be drawn
-    IF sineValue1(index) > .8 AND sineValue2(index) < sineValue2(index + 125) THEN drawLine = 0
-    IF sineValue1(index) < -.2 AND (sineValue2(index) - .4) > sineValue2(index + 125) THEN drawLine = 0
-
-    ' Draw a line segment if the conditions are met
-    IF drawLine = 1 THEN LINE (spiralX(index), spiralY(index))-(spiralX(index + 1), spiralY(index + 1)), 15
-
-    ' Reset the line drawing flag and check for different conditions
-    drawLine = 0
-    IF sineValue1(index) > .8 AND sineValue2(index) > sineValue2(index + 125) THEN drawLine = 1
-    IF sineValue1(index) < -.2 AND sineValue2(index) < sineValue2(index + 125) THEN drawLine = 1
-
-    ' Draw a line segment if the conditions are met
-    IF drawLine = 1 THEN LINE (spiralX(index), spiralY(index))-(spiralX(index + 127), spiralY(index + 127)), 15
-
-    ' Reset the line drawing flag and check for another set of conditions
-    drawLine = 0
-    IF sineValue1(index) > .9 AND sineValue2(index) > sineValue2(index + 125) THEN drawLine = 1
-    IF sineValue1(index) < -.5 AND sineValue2(index) < sineValue2(index + 125) THEN drawLine = 1
-
-    ' Draw a line segment if the conditions are met
-    IF drawLine = 1 THEN LINE (spiralX(index), spiralY(index))-(spiralX(index + 125), spiralY(index + 125)), 15
-NEXT index
-
-' Wait for a key press before exiting
-a$ = INPUT$(1)
-
-
-
-
- - -
-

4. Sphere forming spiral

-
-

-Similar to previous spiral, Line segments are connected between the -neighbors. Spiral height and width are calculated such that they form -multiple linked spherical shapes. Initially point cloud in shown: -

- - -
-

spiral, 4, 1.png -

-
- -

-In the next step, points are connected using lines: -

- - -
-

spiral, 4, 2.png -

-
- - -

-spiral, 4.bas -

- -
-
' Program to render fancy looking spiral.
-' By Svjatoslav Agejenko.
-' Email: svjatoslav@svjatoslav.eu
-' Homepage: http://www.svjatoslav.eu
-'
-' Changelog:
-' 2003.12, Initial version
-' 2024.08, Improved program readability using AI
-
-' Declare shared arrays to hold the x and y coordinates of the spiral
-DIM SHARED spiralX(1 TO 10000)
-DIM SHARED spiralY(1 TO 10000)
-
-' Initialize the screen to a graphics mode with 640x480 resolution and 16 colors
-SCREEN 12
-
-' Constants for the initial size and the starting value of the index
-CONST InitialSize = 100
-CONST StartIndex = 0
-
-' Variable to keep track of the current position in the spiral arrays
-DIM torusIndex AS DOUBLE
-torusIndex = StartIndex
-
-' Loop parameters
-DIM angle AS DOUBLE
-DIM scaleFactor AS DOUBLE
-
-' Generate the first arm of the spiral
-FOR angle = 0 TO 97.35 STEP .15
-    torusIndex = torusIndex + 1
-    scaleFactor = SIN(angle / 31) * InitialSize
-    spiralX(torusIndex) = SIN(angle) * scaleFactor * 3 + 320
-    spiralY(torusIndex) = COS(angle) * scaleFactor + 250
-    spiralY(torusIndex) = spiralY(torusIndex) - (COS(angle / 31) * 200)
-    PSET (spiralX(torusIndex), spiralY(torusIndex)), 15
-NEXT angle
-
-' Generate the second arm of the spiral
-FOR angle = 97.35 TO 0 STEP -.15
-    torusIndex = torusIndex + 1
-    scaleFactor = SIN(angle / 31) * (InitialSize / 2)
-    spiralX(torusIndex) = SIN(angle) * scaleFactor * 3 + 320
-    spiralY(torusIndex) = COS(angle) * scaleFactor + 350
-    spiralY(torusIndex) = spiralY(torusIndex) - (COS(angle / 31) * 100)
-    PSET (spiralX(torusIndex), spiralY(torusIndex)), 15
-NEXT angle
-
-' Generate the third arm of the spiral
-FOR angle = 0 TO 97.35 STEP .15
-    torusIndex = torusIndex + 1
-    scaleFactor = SIN(angle / 31) * (InitialSize / 4)
-    spiralX(torusIndex) = SIN(angle) * scaleFactor * 3 + 320
-    spiralY(torusIndex) = COS(angle) * scaleFactor + 300
-    spiralY(torusIndex) = spiralY(torusIndex) - (COS(angle / 31) * 50)
-    PSET (spiralX(torusIndex), spiralY(torusIndex)), 15
-NEXT angle
-
-' Generate the fourth arm of the spiral
-FOR angle = 97.35 TO 0 STEP -.15
-    torusIndex = torusIndex + 1
-    scaleFactor = SIN(angle / 31) * (InitialSize / 8)
-    spiralX(torusIndex) = SIN(angle) * scaleFactor * 3 + 320
-    spiralY(torusIndex) = COS(angle) * scaleFactor + 325
-    spiralY(torusIndex) = spiralY(torusIndex) - (COS(angle / 31) * 25)
-    PSET (spiralX(torusIndex), spiralY(torusIndex)), 15
-NEXT angle
-
-' Calculate the number of lines to draw based on the current index
-DIM totalSegments AS DOUBLE
-totalSegments = (torusIndex - 42) / 4
-
-a$ = INPUT$(1)
-' Clear the screen before drawing the lines
-CLS
-
-' Draw the lines between points in the spiral
-FOR angle = 1 TO totalSegments * 4
-    LINE (spiralX(angle), spiralY(angle))-(spiralX(angle + 42), spiralY(angle + 42)), 15
-    LINE (spiralX(angle), spiralY(angle))-(spiralX(angle + 1), spiralY(angle + 1)), 15
-NEXT angle
-
-' Wait for the user to press a key before exiting
-a$ = INPUT$(1)
-
-' End of program
-SYSTEM
-
-
-
-
- - -
-

5. Textured spherical spiral

-
- -
-

spiral, 5.png -

-
- -

-Similar to previous spiral, Line segments are connected between the -neighbors. Spiral height and width are calculated such that sphere is -formed. Sphere is textured. Texture is loaded from file: -texture.dat .Invisible surface detection and removal is -attempted. -

- -

-spiral, 5.bas -

- -
-
' Program to render fancy looking spiral.
-' By Svjatoslav Agejenko.
-' Email: svjatoslav@svjatoslav.eu
-' Homepage: http://www.svjatoslav.eu
-'
-' Changelog:
-' 2003.12, Initial version
-' 2024.08, Improved program readability using AI
-
-DECLARE SUB FillSegment (x1, y1, x2, y2, xx1, yy1, xx2, yy2)
-DIM SHARED spiralX(1 TO 10000)
-DIM SHARED spiralY(1 TO 10000)
-DIM SHARED angles(1 TO 10000)
-DIM SHARED phaseAngles(1 TO 10000)
-DIM SHARED spiralLength
-SCREEN 12
-stepUnit = 200
-spiralLength = 0
-
-' Generate the spiral points
-FOR angleIndex = 1 TO 97 STEP .15
-    spiralLength = spiralLength + 1
-    stepUnit = SIN(angleIndex / 31) * 100
-    xPos = SIN(angleIndex) * stepUnit * 3 + 320
-    yPos = COS(angleIndex) * stepUnit + 250
-    yPos = yPos - (COS(angleIndex / 31) * 200)
-    angles(spiralLength) = angleIndex
-    phaseAngles(spiralLength) = angleIndex / 31
-    spiralX(spiralLength) = xPos
-    spiralY(spiralLength) = yPos
-    PSET (xPos, yPos), 15
-NEXT angleIndex
-
-' Load texture data from file
-OPEN "texture.dat" FOR INPUT AS #1
-DIM SHARED textureData$(1 TO 1000)
-textureIndex = 0
-1
-    LINE INPUT #1, textureLine$
-    IF LEFT$(textureLine$, 3) = "END" THEN GOTO 2
-    textureIndex = textureIndex + 1
-    textureData$(textureIndex) = textureLine$
-GOTO 1
-2
-CLS
-
-' Apply texture to the spiral
-textureIndex = 1
-FOR charIndex = 1 TO 20
-    FOR textCharIndex = 1 TO LEN(textureData$(charIndex))
-        textureChar$ = RIGHT$(LEFT$(textureData$(charIndex), textCharIndex), 1)
-        textureIndex = textureIndex + 1
-        IF textureIndex > spiralLength - 43 THEN GOTO DONE
-        teeVal = SIN(angles(textureIndex + 32)) - COS(phaseAngles(textureIndex))
-
-        ' Draw lines if the condition is met
-        IF teeVal <= 0 THEN
-            LINE (spiralX(textureIndex), spiralY(textureIndex))-(spiralX(textureIndex + 1), spiralY(textureIndex + 1)), 15
-            LINE (spiralX(textureIndex), spiralY(textureIndex))-(spiralX(textureIndex + 42), spiralY(textureIndex + 42)), 15
-            ' Fill the segment if the character matches
-            IF textureChar$ = "M" THEN
-                CALL FillSegment(spiralX(textureIndex), spiralY(textureIndex), spiralX(textureIndex + 1), spiralY(textureIndex + 1), spiralX(textureIndex + 42), spiralY(textureIndex + 42), spiralX(textureIndex + 43), spiralY(textureIndex + 43))
-            END IF
-        END IF
-    NEXT textCharIndex
-NEXT charIndex
-DONE:
-a$ = INPUT$(1)
-SYSTEM
-
-' Subroutine to fill a segment with lines
-SUB FillSegment (x1, y1, x2, y2, xx1, yy1, xx2, yy2)
-    ' Assign input parameters to local variables
-    xStart = x1
-    yStart = y1
-    xEnd = x2
-    yEnd = y2
-    xxStart = xx1
-    yyStart = yy1
-    xxEnd = xx2
-    yyEnd = yy2
-
-    ' Calculate step increments
-    j = 10
-    xStep = (xEnd - xStart) / j
-    yStep = (yEnd - yStart) / j
-    xxStep = (xxEnd - xxStart) / j
-    yyStep = (yyEnd - yyStart) / j
-
-    ' Draw lines between the points
-    FOR a = 1 TO j
-        xStart = xStart + xStep
-        yStart = yStart + yStep
-        xxStart = xxStart + xxStep
-        yyStart = yyStart + yyStep
-        LINE (xStart, yStart)-(xxStart, yyStart), 15
-    NEXT a
-END SUB
-
-
-
-
- -
-

6. Textured and shaded spherical spiral

-
- -
-

spiral, 6.png -

-
- -

-Similar to previous spiral, Line segments are connected between the -neighbors. Spiral height and width are calculated such that sphere is -formed. Sphere is textured. Texture is loaded from file: -texture1.dat . Invisible surface detection and removal is -attempted. Sphere is shaded. -

- -

-spiral, 6.bas -

- -
-
' Program to render fancy looking textured and shaded spiral. Texture is loaded from file.
-' By Svjatoslav Agejenko.
-' Email: svjatoslav@svjatoslav.eu
-' Homepage: http://www.svjatoslav.eu
-'
-' Changelog:
-' 2003.12, Initial version
-' 2024.10, Improved program readability using AI
-
-DECLARE SUB fill(x1, y1, x2, y2, xx1, yy1, xx2, yy2, hel)
-DIM SHARED torux(1 TO 10000)
-DIM SHARED toruy(1 TO 10000)
-DIM SHARED sin1(1 TO 10000)
-DIM SHARED cos1(1 TO 10000)
-DIM SHARED tor
-
-' Set the screen mode to 12
-SCREEN 12
-su = 200
-tor = 0
-
-' Calculate points for the spiral
-FOR a = 1 TO 97 STEP .15
-    tor = tor + 1
-    su = SIN(a / 31) * 100
-    x = SIN(a) * su * 3 + 320
-    y = COS(a) * su + 250
-    y = y - (COS(a / 31) * 200)
-    sin1(tor) = a
-    cos1(tor) = a / 31
-    torux(tor) = x
-    toruy(tor) = y
-    ' Set the pixel at (x, y) to color 15
-    PSET (x, y), 15
-NEXT a
-
-' Open the text file for input
-OPEN "texture1.dat" FOR INPUT AS #1
-DIM SHARED text$(1 TO 1000)
-
-a = 0
-1
-' Read a line from the file
-LINE INPUT #1, a$
-' Check if the line is the end marker
-IF LEFT$(a$, 3) = "END" THEN GOTO 2
-
-' Increment the counter and store the line in the text array
-a = a + 1
-text$(a) = a$
-GOTO 1
-2
-' Close the file
-CLOSE #1
-
-' Clear the screen
-CLS
-a = 1
-' Loop through each character in the text
-FOR c = 1 TO 20
-    FOR b = 1 TO LEN(text$(c))
-        ' Get the current character
-        a$ = RIGHT$(LEFT$(text$(c), b), 1)
-
-        ' Increment the counter
-        a = a + 1
-        ' Check if we have reached the end of the points array
-        IF a > tor - 43 THEN GOTO 3
-
-        ' Calculate the angle for the current point
-        tee = SIN(sin1(a + 32))
-        tee = tee - COS(cos1(a))
-
-        ' Draw lines based on the calculated angle
-        IF tee <= 0 THEN
-            LINE (torux(a), toruy(a))-(torux(a + 1), toruy(a + 1)), 15
-            LINE (torux(a), toruy(a))-(torux(a + 42), toruy(a + 42)), 15
-            hel = 10
-            hel1 = COS(cos1(a) - 1) + .5
-            hel2 = SIN(sin1(a) + 1) + 1
-            ' Adjust brightness based on the angles
-            IF hel2 > 1 AND hel1 > 1 THEN
-                hel3 = (hel2 - 1) * (hel1 - 1) * 8
-                hel = hel / (hel3 + 1)
-            END IF
-
-            ' Adjust brightness if the character is "M"
-            IF a$ = "M" THEN hel = hel / 3
-
-            ' Fill the shape with the calculated brightness
-            fill torux(a), toruy(a), torux(a + 1), toruy(a + 1), torux(a + 42), toruy(a + 42), torux(a + 43), toruy(a + 43), hel
-        END IF
-    NEXT b
-NEXT c
-
-' Wait for user input
-3
-a$ = INPUT$(1)
-SYSTEM
-
-SUB fill(zx1, zy1, zx2, zy2, zxx1, zyy1, zxx2, zyy2, hel)
-
-' This subroutine fills a shape defined by four points with a specified brightness
-' x1,y1  ----------------   xx1,yy1         hel - brightness
-'        |              |
-'        |              |
-'        |              |
-'  x2,y2 ----------------   xx2,yy2
-
-' Assign local variables for clarity
-x1 = zx1
-y1 = zy1
-x2 = zx2
-y2 = zy2
-xx1 = zxx1
-yy1 = zyy1
-xx2 = zxx2
-yy2 = zyy2
-
-' Calculate the differences and distances between points
-j1 = x1 - x2
-j2 = y1 - y2
-j3 = SQR((j1 * j1) + (j2 * j2))
-
-j4 = xx1 - xx2
-j5 = yy1 - yy2
-j6 = SQR((j4 * j4) + (j5 * j5))
-
-' Calculate the average distance and adjust for brightness
-j7 = (j3 + j6) / 2
-j = j7 / hel
-
-' Calculate the step sizes for each axis
-x3 = (x2 - x1) / j
-y3 = (y2 - y1) / j
-xx3 = (xx2 - xx1) / j
-yy3 = (yy2 - yy1) / j
-
-' Draw lines between the points with the specified brightness
-FOR a = 1 TO j
-    x1 = x1 + x3
-    y1 = y1 + y3
-    xx1 = xx1 + xx3
-    yy1 = yy1 + yy3
-    LINE (x1, y1)-(xx1, yy1), 15
-NEXT a
-END SUB
-
-
-
-
-
-
-

Created: 2024-11-16 la 20:26

-

Validate

-
- - diff --git a/Graphics/Spirals/index.org b/Graphics/Spirals/index.org index 53e660f..21cd241 100644 --- a/Graphics/Spirals/index.org +++ b/Graphics/Spirals/index.org @@ -8,8 +8,8 @@ #+OPTIONS: author:nil * Spiral with increasing density -#+attr_html: :width 800px -#+attr_latex: :width 800px +#+attr_html: :width 1000px +#+attr_latex: :width 1000px [[file:spiral.png]] From every point in the spiral, subdivided line is traced. Line @@ -21,8 +21,8 @@ progressively increases towards the center. #+INCLUDE: "spiral.bas" src basic-qb45 * Spiral with varying height -#+attr_html: :width 800px -#+attr_latex: :width 800px +#+attr_html: :width 1000px +#+attr_latex: :width 1000px [[file:spiral, 2.png]] From every point in the spiral, subdivided line is traced. Line @@ -55,14 +55,14 @@ Similar to previous spiral, Line segments are connected between the neighbors. Spiral height and width are calculated such that they form multiple linked spherical shapes. Initially point cloud in shown: -#+attr_html: :width 800px -#+attr_latex: :width 800px +#+attr_html: :width 1000px +#+attr_latex: :width 1000px [[file:spiral, 4, 1.png]] In the next step, points are connected using lines: -#+attr_html: :width 800px -#+attr_latex: :width 800px +#+attr_html: :width 1000px +#+attr_latex: :width 1000px [[file:spiral, 4, 2.png]] @@ -72,8 +72,8 @@ In the next step, points are connected using lines: * Textured spherical spiral -#+attr_html: :width 800px -#+attr_latex: :width 800px +#+attr_html: :width 1000px +#+attr_latex: :width 1000px [[file:spiral, 5.png]] Similar to previous spiral, Line segments are connected between the @@ -88,8 +88,8 @@ attempted. * Textured and shaded spherical spiral -#+attr_html: :width 800px -#+attr_latex: :width 800px +#+attr_html: :width 1000px +#+attr_latex: :width 1000px [[file:spiral, 6.png]] Similar to previous spiral, Line segments are connected between the diff --git a/index.org b/index.org index 2902d06..1d652c9 100644 --- a/index.org +++ b/index.org @@ -8,6 +8,16 @@ #+OPTIONS: H:20 num:20 #+OPTIONS: author:nil +#+begin_export html + +#+end_export + + * Applications This collection contains lots of toy applications: @@ -34,8 +44,8 @@ with many caps or big thinking depth, for reasonable responce time. [[file:Games/Checkers 2/checkers2.bas][Source code]] -#+attr_html: :width 600px -#+attr_latex: :width 600px +#+attr_html: :width 1000px +#+attr_latex: :width 1000px [[file:Games/Checkers 2/checkers2.bas][file:Games/Checkers%202/screenshot.png]] ** 2D graphics demos and animations @@ -44,8 +54,8 @@ Collection of various 2D animations. Good for demonstrating various algorithms and getting fun looking results quite easily. #+begin_export html - - + @@ -63,10 +73,12 @@ limited amount of lives. When worm runs into the wall or another worm, it loses one life. #+begin_export html - +
+ +
#+end_export [[file:Games/Worm/worm.bas][Source code]] @@ -78,8 +90,8 @@ editor. *Fractal of circles* -#+attr_html: :width 600px -#+attr_latex: :width 600px +#+attr_html: :width 1000px +#+attr_latex: :width 1000px [[file:Fractals/fractal circles.bas][file:Fractals/fractal%20circles.png]] [[file:Fractals/fractal circles.bas][Source code]] @@ -87,10 +99,12 @@ editor. *Fractal of squares* #+begin_export html - +
+ +
#+end_export [[file:Fractals/fractal squares.bas][Source code]] @@ -98,10 +112,12 @@ editor. *Fractal of trees* #+begin_export html - +
+ +
#+end_export [[file:Fractals/fractal trees.bas][Source code]] @@ -115,12 +131,12 @@ visualized using external renderer. See directory: : graphics/3D/3D Synthezier -#+attr_html: :width 600px -#+attr_latex: :width 600px +#+attr_html: :width 1000px +#+attr_latex: :width 1000px [[file:Graphics/3D/3D Synthezier/doc/index.html][file:Graphics/3D/3D%20Synthezier/doc/hexagonal%20city,%202.jpeg]] -#+attr_html: :width 600px -#+attr_latex: :width 600px +#+attr_html: :width 1000px +#+attr_latex: :width 1000px [[file:Graphics/3D/3D Synthezier/doc/index.html][file:Graphics/3D/3D%20Synthezier/doc/rectangular%20city,%203.jpeg]] [[file:Graphics/3D/3D Synthezier/doc/index.html][Read more]] @@ -131,8 +147,8 @@ Small collection of programs that are result of exploratory programming, for fun. It started out from drawing spiral on the screen. Every iteration built upon previous result. -#+attr_html: :width 600px -#+attr_latex: :width 600px +#+attr_html: :width 1000px +#+attr_latex: :width 1000px [[file:Graphics/Spirals/index.html][file:Graphics/Spirals/logo.png]] [[file:Graphics/Spirals/index.html][Read more]] @@ -156,16 +172,16 @@ Zero (CC0) license.* There are various ways to run legacy QBasic applications under Debian GNU/Linux: -- Full system virtualization :: One way would be to use full system - virtualization with [[https://www.qemu.org/][QEMU]], [[https://www.virtualbox.org/][VirtualBox]] or [[https://www.vmware.com/products/desktop-hypervisor.html][VMware Workstation or - Player]]. After creating virtual machine, you need to obtain and - install some distribution of DOS like [[https://en.wikipedia.org/wiki/MS-DOS][MS-DOS]] or [[https://www.freedos.org/][FreeDOS]]. Within DOS - you can then use either Microsoft *QBasic* or Microsoft - *QuickBasic*. QBasic is already included in Microsoft DOS by - default. QuickBasic is more capable but must be obtained separately. ++ Full system virtualization :: One way would be to use full system +virtualization with [[https://www.qemu.org/][QEMU]], [[https://www.virtualbox.org/][VirtualBox]] or [[https://www.vmware.com/products/desktop-hypervisor.html][VMware Workstation or +Player]]. After creating virtual machine, you need to obtain and +install some distribution of DOS like [[https://en.wikipedia.org/wiki/MS-DOS][MS-DOS]] or [[https://www.freedos.org/][FreeDOS]]. Within DOS +you can then use either Microsoft *QBasic* or Microsoft +*QuickBasic*. QBasic is already included in Microsoft DOS by +default. QuickBasic is more capable but must be obtained separately. - QB64 :: [[https://qb64.com][QB64]] is mostly compatible with Microsoft BASIC variants and - can be used too. + can be used too. - [[id:97ea6094-ade6-4c7d-aea9-9874acf9dc86][DOSBox + MS BASIC]] :: Easy to install and good compatibility. @@ -287,3 +303,12 @@ This is how I accomplished it in DOSBox: 3. Save the changes and restart DOSBox for the configuration to take effect. +* See also + +- Programs found in the March 1975 3rd printing of David Ahl's 101 + BASIC Computer Games, published by Digital Equipment Corp: + https://github.com/maurymarkowitz/101-BASIC-Computer-Games + +- QB64 is a modern extended BASIC programming language that retains + QBasic/QuickBASIC 4.5 compatibility and compiles native binaries for + Windows, Linux, and macOS: https://qb64.com/ diff --git a/tools/update web site b/tools/update web site index 214164e..cfbb583 100755 --- a/tools/update web site +++ b/tools/update web site @@ -14,6 +14,12 @@ cd "${0%/*}"; if [ "$1" != "T" ]; then gnome-terminal -e "'$0' T"; exit; fi; emacs --batch -l ~/.emacs --visit=index.org --funcall=org-html-export-to-html --kill ) + ( + cd "cd Graphics/Spirals" + rm -f index.html + emacs --batch -l ~/.emacs --visit=index.org --funcall=org-html-export-to-html --kill + ) + # Upload project homepage to the server. rsync -avz --delete -e 'ssh -p 10006' ./ \ --include="*/" \