Re: Hey Dusty!!! Suck on this MF 2000 bytes ROFL 1936 bytes!! Pooh RULEZ!!!

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

Quoted text here. Click to load it

Utterly brilliant! Well done Pooh Cat.    :)

--  
Jax  

Re: Hey Dusty!!! Suck on this MF 2000 bytes ROFL 1936 bytes!! Pooh RULEZ!!!


Quoted text here. Click to load it

Really? I've got it down to 1920 bytes. [g]

print"Dusty Buster. Version 3"
print"Written by Pooh the cat April 25th, 2014"
print""
print"Enter filename: ";
input filename$;
a=varptr(filename$)
bload filename$ a 6
c=a
FOR s = 1 to 6
a=peek(c)
if s = 4 then
GOSUB m:
partialblock=c&
endif
if s < 6 then
b=a
endif
c=c+1
NEXT s
GOSUB m:
totalsize&=c&*512
partialblock=512-partialblock
totalsize&=totalsize&-partialblock
print" "
print"Totalsize ";
print totalsize&;
print" bytes"
end
m:
c&=256*a
c&=c&+b
RETURN  



--  
Take it easy... Don't let the sound of your own wheels drive you crazy.  
Lighten up while you still can. Don't even try to understand.  
Just find a place to make your stand and take it easy!


Re: Hey Dusty!!! Suck on this MF 2000 bytes ROFL 1936 bytes!! Pooh RULEZ!!!


Quoted text here. Click to load it

I've now provided you two source files that when compiled will be 1920  
bytes in length. One is an optimized version of yours, the other is a  
redone version of one of mine. I removed your three file commands and  
replaced them with a single command. I also removed your silly string to  
integer command, since you don't need it; you already have them as  
integers.  

As your using a string now to hold your data, I showed you an easier way to  
put data in it quickly and access it. [g] Thought you were getting crafty  
by removing two long integers with your gosub routine, did you? [g] I can  
tell you are paying attention to what I'm doing, even if you won't directly  
admit it. It's showing in your improved demos. hehe.

In my own way of doing the same thing you did (I figured you might try to  
whine about my optimizing your gosub based style), I too used gosub, but  
only to set multiple peek commands; since I didn't need a for/next loop in  
mine. I also used a string this time to hold my memory contents since I had  
to use one anyway to get the filename. And I didn't use any if/then's in  
the second version. [g]

Quoted text here. Click to load it

Two versions now, both doing it totally different, both compile to 1920  
bytes. Both btw still run in 6K of ram. [g]
  
Quoted text here. Click to load it

1920 bytes, both sources below:

print"Dusty Buster. Version 3"
print"Written by Pooh the cat April 25th, 2014"
print""
print"Enter filename: ";
input filename$;
ax=varptr(filename$)
bload filename$ ax 6
y=ax+3
gosub m:
partialblock=256*temp
y=ax+2
gosub m:
partialblock=partialblock+temp
y=ax+5
gosub m:
blocks&=256&*temp
y=ax+4
gosub m:
blocks&=blocks&+temp
totalsize&=blocks&*512
partialblock=512-partialblock
totalsize&=totalsize&-partialblock
print" "
print"Totalsize ";
print totalsize&;
print" bytes"

end
m:
temp=peek(y)
return

And here's my other one which is also 1920 bytes when compiled, that's an  
improved version of yours:

print"Dusty Buster. Version 3"
print"Written by Pooh the cat April 25th, 2014"
print""
print"Enter filename: ";
input filename$;
a=varptr(filename$)
bload filename$ a 6
c=a
FOR s = 1 to 6
a=peek(c)
if s = 4 then
GOSUB m:
partialblock=c&
endif
if s < 6 then
b=a
endif
c=c+1
NEXT s
GOSUB m:
totalsize&=c&*512
partialblock=512-partialblock
totalsize&=totalsize&-partialblock
print" "
print"Totalsize ";
print totalsize&;
print" bytes"
end
m:
c&=256*a
c&=c&+b
RETURN  

Let's see you do better... lol


--  
Take it easy... Don't let the sound of your own wheels drive you crazy.  
Lighten up while you still can. Don't even try to understand.  
Just find a place to make your stand and take it easy!


Re: Hey Dusty!!! Suck on this MF 2000 bytes ROFL 1936 bytes!! Pooh RULEZ!!!


Quoted text here. Click to load it


Atleast this version closes the file when your done with it. :) You *are  
still* losing, btw. I'm at 1888 bytes and 1872 bytes; and both of mine will  
close the file. [g] I thought we agreed we'd do the file functions properly?  
that was open the file, read the data, close the file... umm...


--  
Take it easy... Don't let the sound of your own wheels drive you crazy.  
Lighten up while you still can. Don't even try to understand.  
Just find a place to make your stand and take it easy!


Site Timeline