Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
100 lines or less...
#1
An old skool challenge...I used to relish these in qbasic 4.5 days....

  1. Using libraries is encouraged...
  2. Games, features, Fibonacci sequences, GUI's...etc...there is no genre...
  3. NO use of : to concatenate thing is allowed!
  4. Collaborating is also encouraged....PM people, team up...etc..

For me 100 lines barely initiates things nowadays so id love to see what we can do under this limitation as for me, GAMES, GUIS's, etc were best when the developers were limited.

Thanks

Unseen
Reply
#2
My entry for the challenge to grammatically correct the thread title... Tongue
Code: (Select All)
10 PRINT "100 lines or fewer..."
Big Grin
Reply
#3
Smile Very good, Tantalus.  You must be the ancient Greek god of correct grammatical usage.  Big Grin
Reply
#4
With the ecouraged use of libraries I see no reason any program has to be longer than 3 lines:
Include the bi
call to mainProgram
Include the bm
  724  855  599  923  575  468  400  206  147  564  878  823  652  556 bxor cross forever
Reply
#5
(10-24-2025, 12:19 PM)bplus Wrote: With the ecouraged use of libraries I see no reason any program has to be longer than 3 lines:
Include the bi
call to mainProgram
Include the bm

One line.  Just have it include the helper BI which loads the other BI files, then the main, then the BM files.
Reply
#6
Oh wow didn't know you could do that!
  724  855  599  923  575  468  400  206  147  564  878  823  652  556 bxor cross forever
Reply
#7
Image this pseudocode is the program you were talking about in post #4 here.


Code: (Select All)

INCLUDE:'foo.bi'

MainLoop

INCLUDE:'foo.bm'

Save it as "My Sexy Program.bas"

Now, make another program:

Code: (Select All)

INCLUDE:'My Sexy Program.bas'

Run that second program.   One line, does it all.
Reply
#8
Oh come on guys! Wring a program and then converting it to a .bm is NOT what i was getting at! 

I will be doing mine using the fzxngn lib that i think JustSomeGuy made.

John
Reply
#9
I like that there are no multi-statement lines, but let's make this a real challenge - no libraries either!
Reply
#10
Here's my first thing...94 lines. Using my newest GDK - Has Sky Sphere, Terrain, a 3d model and controls to fly around. If people want the files i'll happily post em but i think the picture will suffice for now!

[Image: NewGDK.png]


Code: (Select All)
REM $INCLUDE:'UnseenGDK3\New_GDK.bi' '// GDK 3 Header File
DIM SHARED Terrain AS GDK_GL_Terrain, World~&, Viper AS GDK_GL_MODEL, Viper_Roll AS GDK_Range, Viper_RWD AS GDK_RWD, Viper_Pitch AS GDK_Range
GDK_System_Start "UnseenGDK3\World Demo\", 0, 0, 1024, 660, GDK_FALSE, "GDK Test - World Demo", GDK_GL_3D
GDK_GL_Set_Defaults '// If your using GL then you need to either set things up yourself of call this for a generic base
GDK_GL_Set_FOV 75
GDK_GL_Set_Clipping .1, 20000
Viper_Roll.Min = 315
Viper_Roll.Max = 405
Viper_Roll.Default = 360
Viper_Roll.Current = 360
Viper_Pitch.Min = -35
Viper_Pitch.Max = 35
Viper_RWD.Speed = 10
GDK_Allow_GL = GDK_TRUE
GDK_Init_GL = GDK_TRUE
DO
  GDK_System_Update
  IF _KEYDOWN(19200) THEN '// Left
    IF Viper_Roll.Current > Viper_Roll.Min THEN Viper_Roll.Current = Viper_Roll.Current - 2
    Viper_RWD.Rotation.Y = Viper_RWD.Rotation.Y + (1 / RAD_TO_DEG_RATIO)
  ELSEIF _KEYDOWN(19712) THEN '// Right
    IF Viper_Roll.Current < Viper_Roll.Max THEN Viper_Roll.Current = Viper_Roll.Current + 2
    Viper_RWD.Rotation.Y = Viper_RWD.Rotation.Y - (1 / RAD_TO_DEG_RATIO)
  ELSE
    IF Viper_Roll.Current < Viper_Roll.Default THEN Viper_Roll.Current = Viper_Roll.Current + 1 ELSE IF Viper_Roll.Current > Viper_Roll.Default THEN Viper_Roll.Current = Viper_Roll.Current - 1
  END IF
  IF Viper_RWD.Rotation.Y < 0 THEN Viper_RWD.Rotation.Y = Viper_RWD.Rotation.Y + TWO_Pi ELSE IF Viper_RWD.Rotation.Y > TWO_Pi THEN Viper_RWD.Rotation.Y = Viper_RWD.Rotation.Y - TWO_Pi
  IF _KEYDOWN(18432) THEN '// Up
    IF Viper_Pitch.Current < Viper_Pitch.Max THEN Viper_Pitch.Current = Viper_Pitch.Current + 1
  ELSEIF _KEYDOWN(20480) THEN '// down
    IF Viper_Pitch.Current > Viper_Pitch.Min THEN Viper_Pitch.Current = Viper_Pitch.Current - 1
  ELSE '// Return to default
    IF Viper_Pitch.Current < Viper_Pitch.Default THEN Viper_Pitch.Current = Viper_Pitch.Current + .5 ELSE IF Viper_Pitch.Current > Viper_Pitch.Default THEN Viper_Pitch.Current = Viper_Pitch.Current - .5
  END IF
  Viper_RWD.Rotation.X = Viper_Pitch.Current / RAD_TO_DEG_RATIO
  IF _KEYDOWN(ASC("A")) OR _KEYDOWN(ASC("a")) THEN
    IF Viper_RWD.Speed < 40 THEN Viper_RWD.Speed = Viper_RWD.Speed + .2
  ELSEIF _KEYDOWN(ASC("Z")) OR _KEYDOWN(ASC("z")) THEN
    IF Viper_RWD.Speed > 0 THEN Viper_RWD.Speed = Viper_RWD.Speed - .5 ELSE Viper_RWD.Speed = 0
  END IF
  GDK_RWD_Update Viper_RWD
LOOP UNTIL INKEY$ = CHR$(27)
SUB _GL
  IF GDK_System.Render_Mode = GDK_GL_2D OR GDK_System.Render_Mode = GDK_GL_3D THEN
    IF GDK_Allow_GL = GDK_TRUE THEN
      GDK_GL_Init
      IF GDK_System.GL.Lighting = GDK_FALSE THEN GDK_GL_Enable_Lighting
      IF GDK_System.GL.Culling THEN GDK_GL_Disable_Culling
      IF GDK_Init_GL = GDK_TRUE THEN
        World~& = GDK_GL_Make_World_List~&
        GDK_GL_MODEL_LOAD Viper, "Viper\tris.md2", "viper\skin.pcx"
        GDK_Init_GL = GDK_FALSE
      ELSE
        GDK_GL_CLS
        gluLookAt 0, 165, 120, 0, 0, 0, 0, 1, 0
        _GLPUSHMATRIX
        _GLLOADIDENTITY
        _GLROTATEF -Viper_RWD.Rotation.Y * RAD_TO_DEG_RATIO, 0, 1, 0
        _GLTRANSLATEF Viper_RWD.Position.X, Viper_RWD.Position.Y, Viper_RWD.Position.Z
        _GLCALLLIST World~&
        _GLPOPMATRIX
        _GLPUSHMATRIX
        _GLLOADIDENTITY
        _GLTRANSLATEF 0, -65, -150
        _GLROTATEF -90, 1, 0, 0
        _GLROTATEF 90, 0, 0, 1
        _GLROTATEF Viper_Pitch.Current, 0, 1, 0
        _GLROTATEF Viper_Roll.Current, 1, 0, 0
        GDK_GL_MODEL_DRAW Viper, 0
        _GLPOPMATRIX
        _DISPLAY
      END IF
    END IF
  END IF
END SUB
FUNCTION GDK_GL_Make_World_List~&
  goodmap% = GDK_GL_Terrain_Load(Terrain, "Hill_HMap.png", "Hill_Texture.png", 90, 3900)
  Terrain.Position.Y = -4200 ' Adjust terrain base position
  TList~& = GDK_GL_Terrain_Make_List(Terrain)
  SkyList~& = GDK_GL_CreateSphereList(12000, 120, 120, GDK_GL_Load_Texture("Sky.png")) '// This is so cool, dont even have to load then pass the image!
  TmpList~& = _GLGENLISTS(1)
  _GLNEWLIST TmpList~&, _GL_COMPILE
  _GLPUSHMATRIX
  _GLTRANSLATEF 0, Terrain.Position.Y, 0
  _GLCALLLIST TList~&
  _GLPOPMATRIX
  _GLPUSHMATRIX
  _GLROTATEF 180, 1, 0, 0
  _GLCALLLIST SkyList~&
  _GLPOPMATRIX
  _GLENDLIST '// Finihsed everything so stop making the lists
  GDK_GL_Make_World_List~& = TmpList~&
END FUNCTION
REM $INCLUDE:'UnseenGDK3\New_GDK.bm' '// UnseenGDK 3 Lib file // change nothing but addint the pitch functionalaity

john
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Bouncing lines & boxes Dav 6 1,940 04-12-2025, 06:14 AM
Last Post: madscijr
  100 prisoners' problem TempodiBasic 9 2,660 04-17-2023, 07:30 PM
Last Post: bplus
  My masterpiece - 13,500+ lines - WIM-Tools, Windows Image Management Tools hanness 0 617 05-09-2022, 09:58 PM
Last Post: hanness

Forum Jump:


Users browsing this thread: