Ooops
March 05, 2021, 07:44:09 AM

Author Topic: [bb] Widescreen by ThePict [ 1+ years ago ]  (Read 532 times)

Offline BlitzBot

[bb] Widescreen by ThePict [ 1+ years ago ]
« on: June 29, 2017, 12:28:42 AM »
Title : Widescreen
Author : ThePict
Posted : 1+ years ago

Description : While deciding which television to buy, my currently betrothed asked me how wide or high some screens would actually be. So I did some maths but it flew over her head, then I thought I'd write a small app to demonstrate.

Code :
Code: BlitzBasic
  1. Graphics 800,600,16,2
  2. ClsColor 0,0,255
  3. Color 255,255,0
  4. Oval 100,100,10,10,1
  5. Oval 700,100,10,10,1
  6. Oval 100,437,10,10,1
  7. Oval 700,437,10,10,1
  8. Rect 105,105,600,337,1
  9. Rect 105,100,600,5,1
  10. Rect 100,105,5,337,1
  11. Rect 105,442,600,5,1
  12. Rect 705,105,5,337,1
  13. d#=Input("Enter the stated (diagonal) size of your widescreen TV.")
  14. x#=d#*(Cos(29.35775354279))
  15. y#=d#*(Sin(29.35775354279))
  16. diag$=Left$(Str$(d#),Instr(Str$(d#),".")+1)
  17. width$=Left$(Str$(x#),Instr(Str$(x#),".")+1)
  18. height$=Left$(Str$(y#),Instr(Str$(y#),".")+1)
  19. Color 255,0,0
  20. Line 103,103,707,444
  21. Line 103,103,110,101
  22. Line 103,103,106,110
  23. Line 707,444,700,446
  24. Line 707,444,704,437
  25. Line 100,460,710,460
  26. Line 100,460,108,457
  27. Line 100,460,108,463
  28. Line 710,460,702,457
  29. Line 710,460,702,463
  30. Line 750,100,750,447
  31. Line 750,100,747,108
  32. Line 750,100,753,108
  33. Line 750,447,747,439
  34. Line 750,447,753,439
  35. Color 255,255,0
  36. Rect 350,260,100,20,1
  37. Color 0,0,0
  38. Rect 350,458,100,4,1
  39. Rect 748,263,4,20,1
  40. Color 0,0,255
  41. Text 400,270,diag$,1,1
  42. Text 400,460,width$,1,1
  43. Text 750,273,height$,1,1
  44. FlushKeys
  45. WaitKey()
  46. End


Comments : none...

 

SimplePortal 2.3.6 © 2008-2014, SimplePortal