Author Topic: How big is yours?  (Read 13143 times)

0 Members and 1 Guest are viewing this topic.

Offline RonB

  • Newbie
  • Posts: 14
    • View Profile
Re: How big is yours?
« Reply #15 on: November 19, 2018, 10:36:49 pm »
On another note, I once REMOVED around 23K lines of code from a program without affecting any functionality - and it wasn't "dead" code, either. I merely changed thousands and thousands of very "similar" code blocks that used hard-coded values into just couple of dozen subroutines that used variables passed on the Calls instead. Even so, the resulting program still had over 40K lines of code left.

Offline Pete

  • Forum Resident
  • Posts: 2361
  • Cuz I sez so, varmint!
    • View Profile
Re: How big is yours?
« Reply #16 on: November 19, 2018, 10:38:17 pm »
That's a really big program. What was/is it used for?

Pete
Want to learn how to write code on cave walls? https://www.tapatalk.com/groups/qbasic/qbasic-f1/

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • View Profile
    • Steve’s QB64 Archive Forum
Re: How big is yours?
« Reply #17 on: November 19, 2018, 11:25:53 pm »
On another note, I once REMOVED around 23K lines of code from a program without affecting any functionality - and it wasn't "dead" code, either. I merely changed thousands and thousands of very "similar" code blocks that used hard-coded values into just couple of dozen subroutines that used variables passed on the Calls instead. Even so, the resulting program still had over 40K lines of code left.

And I once did the exact opposite of that.  I took a small routine and exploded it into thousands of lines of code in the QBDbase library.

My original sort routine started out like:

FOR I = 1 TO LIMIT
   FOR J = 1 TO LIMIT
     SELECT CASE MemType
         CASE INTEGER:  'set MEM compare size to 2 bytes
         CASE SINGLE: set MEM compare size to 4 bytes
         and so on for each type...
     END SELECT
     Compare values/ swap if needed...
    NEXT
NEXT

The only issue was the speed of the routine was unacceptable from doing the select case and signed/unsigned decision making and calculations, so the solution was to restructure:

SELECT CASE MemType
     CASE Integer
          FOR I =.....
                FOR J = ......
                   Compare/Swap Values
                NEXT
           NEXT
     CASE Single
           FOR....
                 FOR.....


The Select Case moved outside the 16? (I think 16) different sorting routines, and each case had its own sort process to it, which ended up exploding a crapload of lines into the routine. 

The plus side to the whole thing, however, was that by removing such decision making and computations to the OUTSIDE of the sort loop, the sort times dropped from hours/minutes to seconds/milliseconds.

In this case, smaller wasn't better, which I thought was worth pointing out since most programmers instantly seem to think, "few lines = better code", and that may not always be true.  ;)
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!

Offline RonB

  • Newbie
  • Posts: 14
    • View Profile
Re: How big is yours?
« Reply #18 on: November 20, 2018, 12:00:42 am »
That's a really big program. What was/is it used for?

Pete

It was a program that took in several demographic values and generated rate quotes based on the combination of those values.

Offline Pete

  • Forum Resident
  • Posts: 2361
  • Cuz I sez so, varmint!
    • View Profile
Re: How big is yours?
« Reply #19 on: November 20, 2018, 12:07:07 am »
I once tried to purchased moron insurance, but the agent told me I was self-insured.

Hey a business app, neat! Please tell me you wrote it in SCREEN 0.

Pete
Want to learn how to write code on cave walls? https://www.tapatalk.com/groups/qbasic/qbasic-f1/

Offline TempodiBasic

  • Forum Resident
  • Posts: 1792
    • View Profile
Re: How big is yours?
« Reply #20 on: November 20, 2018, 10:09:55 am »
Hi Pete

about the amount of line of effective code
I have riched 1400 lines and no more in QBASIC when I decide to make a copy of that tools very useful in DOS time like Norton commander and Disktool...
I'm just hobbist :-)

however there is a saying
no how big  it is but how  you use it that makes the difference
:P
Programming isn't difficult, only it's  consuming time and coffee

Offline Cobalt

  • QB64 Developer
  • Forum Resident
  • Posts: 878
  • At 60 I become highly radioactive!
    • View Profile
Re: How big is yours?
« Reply #21 on: November 20, 2018, 10:46:03 am »
That would have to be Tetris 64 for me, at 2524 lines(~2450 after comments/white space). Go over to programs and check it out if you haven't already. https://www.qb64.org/forum/index.php?topic=661.msg6027#msg6027
Granted after becoming radioactive I only have a half-life!

Offline Pete

  • Forum Resident
  • Posts: 2361
  • Cuz I sez so, varmint!
    • View Profile
Re: How big is yours?
« Reply #22 on: November 20, 2018, 11:07:26 am »
Hi Pete

about the amount of line of effective code
I have riched 1400 lines and no more in QBASIC when I decide to make a copy of that tools very useful in DOS time like Norton commander and Disktool...
I'm just hobbist :-)

however there is a saying
no how big  it is but how  you use it that makes the difference
:P

But if you use it well AND it's big...

I also like utility programs. Usually they don't get too large, so you can get sometime accomplished in less than a couple of lifetimes.

Pete
Want to learn how to write code on cave walls? https://www.tapatalk.com/groups/qbasic/qbasic-f1/

Offline Ashish

  • Forum Resident
  • Posts: 630
  • Never Give Up!
    • View Profile
Re: How big is yours?
« Reply #23 on: November 20, 2018, 11:13:35 am »
I have coded about 2658 lines of code for my game!
It is beautiful game - https://www.qb64.org/forum/index.php?topic=345.msg2322#msg2322

 [ You are not allowed to view this attachment ]  
Screenshot of the gameplay
« Last Edit: November 20, 2018, 11:20:18 am by Ashish »
if (Me.success) {Me.improve()} else {Me.tryAgain()}


My Projects - https://github.com/AshishKingdom?tab=repositories
OpenGL tutorials - https://ashishkingdom.github.io/OpenGL-Tutorials

Offline Pete

  • Forum Resident
  • Posts: 2361
  • Cuz I sez so, varmint!
    • View Profile
Re: How big is yours?
« Reply #24 on: November 20, 2018, 11:17:15 am »
That would have to be Tetris 64 for me, at 2524 lines(~2450 after comments/white space). Go over to programs and check it out if you haven't already. https://www.qb64.org/forum/index.php?topic=661.msg6027#msg6027

I'm not a gamer, but I did follow the link and tried it. Apparently we have that in common, as you made the game and only hold 2nd place in the top scores? What the hell is that about???

Very professionally done, great looking skin, too, but I wouldn't be able to say if it is a dup of the Nintendo, because I never played it on a N64 or whatever it was called. Your game supports my wish that QB64 could upload and rn these types of apps on Android or other mobile devices. Still, that is just for personal use, as when you put something like this iin an app, I would imagine you have to have an original game. In 1980, I made Wheel of Fortune, Password, Card Sharks, and Monopoly for the Atari 2600 and thought, I could make a fortune off of this stuff, except... Anyway, all of those came out on CD's a few years later, with better graphics than I could produce at the time.

Anyway, great job and from what I can see, some pretty efficient code... which supports Temp's call.

Pete
Want to learn how to write code on cave walls? https://www.tapatalk.com/groups/qbasic/qbasic-f1/

Offline TempodiBasic

  • Forum Resident
  • Posts: 1792
    • View Profile
Re: How big is yours?
« Reply #25 on: November 21, 2018, 09:14:41 am »
@Ashish
thanks to remark it! I have loosen it when you have post... because I have to spend little time in this forum and so I let me drive in prevalene  by discussion part of forum.
Cool, fine shooter, you have got the animalists against you :-)


@Pete

Quote
But if you use it well AND it's big...
I absolutely agree! ;-)
Programming isn't difficult, only it's  consuming time and coffee

Offline Pete

  • Forum Resident
  • Posts: 2361
  • Cuz I sez so, varmint!
    • View Profile
Re: How big is yours?
« Reply #26 on: November 21, 2018, 11:41:09 am »
I have coded about 2658 lines of code for my game!
It is beautiful game - https://www.qb64.org/forum/index.php?topic=345.msg2322#msg2322

So I take it you made that game shortly before the app, "Angry Birds" came out?

Pete :D
Want to learn how to write code on cave walls? https://www.tapatalk.com/groups/qbasic/qbasic-f1/

Offline Ashish

  • Forum Resident
  • Posts: 630
  • Never Give Up!
    • View Profile
Re: How big is yours?
« Reply #27 on: November 21, 2018, 12:01:42 pm »
I have coded about 2658 lines of code for my game!
It is beautiful game - https://www.qb64.org/forum/index.php?topic=345.msg2322#msg2322

So I take it you made that game shortly before the app, "Angry Birds" came out?

Pete :D
Yeah! But how do you know!?
if (Me.success) {Me.improve()} else {Me.tryAgain()}


My Projects - https://github.com/AshishKingdom?tab=repositories
OpenGL tutorials - https://ashishkingdom.github.io/OpenGL-Tutorials

Offline Pete

  • Forum Resident
  • Posts: 2361
  • Cuz I sez so, varmint!
    • View Profile
Re: How big is yours?
« Reply #28 on: November 21, 2018, 12:07:32 pm »
Well in the screen sot, the bird on the right, with the target affixed to it, is pretty much toast, but it's also pretty evident the bird on the left is flying off to tell all his red-breasted friends what you did!

Pete :D
Want to learn how to write code on cave walls? https://www.tapatalk.com/groups/qbasic/qbasic-f1/

Offline OldMoses

  • Seasoned Forum Regular
  • Posts: 469
    • View Profile
Re: How big is yours?
« Reply #29 on: November 27, 2018, 06:48:39 pm »
I'm pretty small fry, I do believe the biggest (or at least the most ambitious) I've ever done is the most recent project, my Runequest player character handler, which I dubbed PC Minder. A sort of gamemaster utility that keeps track of the number crunching for multiple PCs in that game system. Every time a new edition of the game comes out I code a character generator for it, but this one is a fairly radical departure from earlier attempts, incorporating in game PC management functions. The most recent working version is zipped with executable, source code, images, sample characters and PDF user guide at:

http://www.plainviewfarms.com/software/

At this point it comes in at just over 3600 lines of code, which includes DATA and comments. I have yet to try striping out the comments, but that would possibly cut that nearly in half as I put a lot of copious comments in their own lines to aid in finding stuff. Many SUBs have more comment than code as each SUB gets a descriptive header so I can tell what the hell I was thinking later on. I don't exclude DATA because I laboriously typed that crap in from printed reference materials. To my mind that qualifies as code.