Page 1 of 1

zip/unzip code

Posted: Sun Aug 11, 2024 4:41 pm
by SPH
Hi,

Have any of you ever coded a zip/unzip program in purebasic?
If so, please post your answer here.

// Moved from "Applications - Feedback and Discussion" to "Coding Questions" (Kiffi)

Re: zip/unzip code

Posted: Sun Aug 11, 2024 11:26 pm
by Mr.L
yes, I have... :wink:

Code: Select all

InitSprite():OpenWindow(0,0,0,800,570,"Zip/Unzip - move mouse",#PB_Window_ScreenCentered|#PB_Window_SystemMenu):OpenWindowedScreen(WindowID(0),0,0,800,600):LoadFont(0,"Arial",100,#PB_Font_Bold)
CreateSprite(0,30,300):StartDrawing(SpriteOutput(0))
Box(0,0,30,280,RGB(64,80,200)):
For i=0 To 275 Step 10:Box(0,i,30,4,RGB(50,70,180)):Next:Box(2,275,26,14,1):Box(12,280,8,20,1):Box(10,292,12,8,1):StopDrawing()
CreateSprite(1,100,55):StartDrawing(SpriteOutput(1)):Box(0,0,100,55,#Gray):Box(2,2,96,51,1):Box(60,6,30,38,#Gray):Box(62,8,26,34,0):StopDrawing()
Repeat
	ClearScreen(#White)
	StartDrawing(ScreenOutput()):DrawingFont(FontID(0)):DrawText(200,210,"Zip/Unzip", #Red,#White):StopDrawing()
	mx=DesktopMouseX()-WindowX(0):If mx < -100:mx=-100:EndIf
	x.f=-5:y.f=-5:xd.f=14:yd.f=0:a.f=0
	For i = 0 To 80
		RotateSprite(0,a,#PB_Absolute):DisplayTransparentSprite(0,x,y)
		RotateSprite(0,180-a,#PB_Absolute):DisplayTransparentSprite(0,x-7,275-y)
		x + xd:If x > mx:a-3:xd-0.5:yd-Sqr((x-mx)*0.002):y+yd:EndIf
	Next
	DisplayTransparentSprite(1,mx-50,262):FlipBuffers()
	While WindowEvent():If Event()=#PB_Event_CloseWindow:End:EndIf:Delay(0):Wend
ForEver

Re: zip/unzip code

Posted: Mon Aug 12, 2024 1:28 am
by BarryG
:lol:

Re: zip/unzip code

Posted: Mon Aug 12, 2024 2:54 am
by idle
Mr.L wrote: Sun Aug 11, 2024 11:26 pm yes, I have... :wink:
That's a good one! :lol:

Re: zip/unzip code

Posted: Mon Aug 12, 2024 8:11 am
by SPH
@Monsieur L : hahahhahaa, lol :mrgreen:

Re: zip/unzip code

Posted: Mon Aug 12, 2024 6:37 pm
by boddhi
Mr.L wrote: yes, I have... :wink:
[...]
What a masterful demonstration! :lol: :lol: :lol: