### Author Topic: "With programming, you can do anything!" But not with qb64?  (Read 966 times)

#### Mrwhy

• Hero Member
• Posts: 2890
• My Dad called me Mr Why when I was 5.
##### "With programming, you can do anything!" But not with qb64?
« on: September 26, 2011, 05:07:17 AM »
Thus quoth vrensul

Ok how about this one:-
We have a circular pizza
We want to eat half - so we have cut it into half
Before we cut it its area was A

We only have round pans
To cook it it MUST lie, non-overlapping inside a round pan
Our biggest pan is x% bigger than half of A

How many straight cuts are the fewest needed (or how many pieces)?

#### vrensul

• Sr. Member
• Posts: 320
• 44th Degree Digital Wizard of the HighBytes Order
##### Re: "With programming, you can do anything!" But not with qb64?
« Reply #1 on: September 26, 2011, 05:28:39 AM »
I'm not sure I understand the question entirely, or the purpose behind it but if i'm right then you're asking:

How many cuts does it take to get half a pizza?  That would be one.
' With programming, you  can do anything!
DEF SEG = &HBANKACNT 'weekend starts here...
poke checking, 1000000
DEF SEG ' quit job here.

#### Mrwhy

• Hero Member
• Posts: 2890
• My Dad called me Mr Why when I was 5.
##### Re: "With programming, you can do anything!" But not with qb64?
« Reply #2 on: September 26, 2011, 05:54:13 AM »
Yes, that gives us half of a pizza that was diameter D

The question is how to NOW fit it into a round pan smaller in diameter than D

The purpose is to get my half-pizza into my oven

#### Clippy

• Hero Member
• Posts: 16431
• I LOVE π = 4 * ATN(1)    Use the QB64 WIKI >>>
##### Re: "With programming, you can do anything!" But not with qb64?
« Reply #3 on: September 26, 2011, 06:01:11 AM »
OK SMART ASS, show us how you'd do it in C!

Then shove that pizza where the sun don't shine! And make sure it is HOT!

How many STRAIGHT CUTS can I get on you?
« Last Edit: September 26, 2011, 06:15:58 AM by Clippy »
QB64 WIKI: Main Page
Download Q-Basics Code Demo: Q-Basics.zip
Download QB64 BAT, IconAdder and VBS shortcuts: QB64BAT.zip
Download QB64 DLL files in a ZIP: Program64.zip

#### vrensul

• Sr. Member
• Posts: 320
• 44th Degree Digital Wizard of the HighBytes Order
##### Re: "With programming, you can do anything!" But not with qb64?
« Reply #4 on: September 26, 2011, 09:05:02 AM »
Mr. Why, are you attempting to attack my less than good math skills?  Not everyone can be good at everything sir.  I, unfortunately, am not that great at math.  I do not believe I have given you any reason to "poke fun" at me for that.  If I have done anything to provoke this, than I assure you it was not intentional, and I would appreciate it in the future that you let me know.
' With programming, you  can do anything!
DEF SEG = &HBANKACNT 'weekend starts here...
poke checking, 1000000
DEF SEG ' quit job here.

#### unseenmachine

• Hero Member
• Posts: 3285
• A fish, a fish, a fishy o!
##### Re: "With programming, you can do anything!" But not with qb64?
« Reply #5 on: September 26, 2011, 09:21:33 AM »
Blend it, then you could fit it in!
UnseenGDK Download : http://dl.dropbox.com/u/8822351/UnseenGDK.bm
GDK Tutorial : http://dl.dropbox.com/u/8822351/UnseenGDK_Tutorial.doc
VQB02 : http://dl.dropbox.com/u/8822351/VQB02.zip

#### Mrwhy

• Hero Member
• Posts: 2890
• My Dad called me Mr Why when I was 5.
##### Re: "With programming, you can do anything!" But not with qb64?
« Reply #6 on: September 26, 2011, 10:37:26 AM »
Quote from: vrensul on September 26, 2011, 09:05:02 AM
Mr. Why, are you attempting to attack my less than good math skills?  Not everyone can be good at everything sir.  I, unfortunately, am not that great at math.  I do not believe I have given you any reason to "poke fun" at me for that.  If I have done anything to provoke this, than I assure you it was not intentional, and I would appreciate it in the future that you let me know.

Only the deepest respect was intended.
I admired your "signature" saying ANYTHING can be solved by a computer program.

But even MATHS is useless UNLESS you have a diagram!
Maths does NOT help you have a diagram.
The fault is in the whole attitude of maths that it shrinks from all such tasks. It relies TOTALLY on the human being's brain to guide it and "tell it what to do"
We are all of us slaves to the incompetence of Maths and computers.

#### dustinian

• Newbie
• Posts: 19
##### Re: "With programming, you can do anything!" But not with qb64?
« Reply #7 on: September 26, 2011, 11:13:38 AM »
Sure you can solve it with QB. Write a "Do..." loop that cuts off a 1 degree arc of the pizza slice "...Until" the slice fits in the new pan.

If it's good enough for TheBob to figure out how many bytes a "GET" graphic takes up, it's good enough to put pizza in a new pan.

Plus those 1 degree pizza arcs will make great finger food for the kids.
Dustinian Camburides

#### vrensul

• Sr. Member
• Posts: 320
• 44th Degree Digital Wizard of the HighBytes Order
##### Re: "With programming, you can do anything!" But not with qb64?
« Reply #8 on: September 26, 2011, 03:05:49 PM »
If you're referring to that "bubbles" program I wrote a while back, I never did finish it just yet.  I started to implement some of the ideas and just plain ol' lost interest.  I do that alot; start a program and never finish it.  Most times it's just for experimentation.  That "bubbles" or Ripple program was intended to be a background for an old music-player replica I was going to make.  I still intend to.  I just need to learn more about Trig.  Clippy did give me pretty much everything formula wise that I needed though.  *watches Clippy's head swell some more  *

What is TheBob?
' With programming, you  can do anything!
DEF SEG = &HBANKACNT 'weekend starts here...
poke checking, 1000000
DEF SEG ' quit job here.

#### GarryRicketson

• Guest
##### Re: "With programming, you can do anything!" But not with qb64?
« Reply #9 on: September 26, 2011, 05:00:40 PM »
What is theBob,...?
http://www.network54.com/Forum/613143/
He is really good with graphics, and has some excellent tutorials.
from Garry

#### Cyperium

• Hero Member
• Posts: 3285
• Knowledge is good, but understanding is better
##### Re: "With programming, you can do anything!" But not with qb64?
« Reply #10 on: September 26, 2011, 05:29:31 PM »
Now, I don't know if you misphrased the question but if the pan is x% bigger than half the slice, then it would fit without cutting anything (even if it is 0% bigger and thus equal the size of the pan).

Wait...sorry, it's the area that is compared, thus the diameter won't fit into the pan...right.

The pan is x% bigger than half the area of the pizza (thus I take it you mean the area of the pan).

This is just a guess, cause I'm not that good at math, but let's say this equation would work though, because we need equal slices where the space between them exactly match each slice (so that half the pizza, gets to be full the pizza and thus if x is 100% bigger than half the area of the whole pizza then it would still fit the diameter), let's say the fewest cuts needed are: (x/100)-1.

I'm probably wrong with my equation though, but I think my reasoning is correct; if x is 100% (thus equal the full pizza) then it would fit without any cuts. But if x is smaller than that, then we need to make cuts with equal spacing so that it again fills the entire area of the pan, the cuts should be made so that the spacing + the area of the slizes makes up for 100% of the full area of the pizza.

« Last Edit: September 26, 2011, 05:46:51 PM by Cyperium »
Venture - New Prototype, QB64 Editor v1.95b (linux compatible, if you compile the source).

#### vrensul

• Sr. Member
• Posts: 320
• 44th Degree Digital Wizard of the HighBytes Order
##### Re: "With programming, you can do anything!" But not with qb64?
« Reply #11 on: September 26, 2011, 07:00:49 PM »
ok I'll look more into this thebob.  What is network54?  I mean I know I should know by now, but best I can tell it's a forum that doesn't exist anymore and that's about it.
' With programming, you  can do anything!
DEF SEG = &HBANKACNT 'weekend starts here...
poke checking, 1000000
DEF SEG ' quit job here.

#### Clippy

• Hero Member
• Posts: 16431
• I LOVE π = 4 * ATN(1)    Use the QB64 WIKI >>>
##### Re: "With programming, you can do anything!" But not with qb64?
« Reply #12 on: September 26, 2011, 07:08:02 PM »
http://www.network54.com/Index/10167
QB64 WIKI: Main Page
Download Q-Basics Code Demo: Q-Basics.zip
Download QB64 BAT, IconAdder and VBS shortcuts: QB64BAT.zip
Download QB64 DLL files in a ZIP: Program64.zip

#### Mrwhy

• Hero Member
• Posts: 2890
• My Dad called me Mr Why when I was 5.
##### Re: "With programming, you can do anything!" But not with qb64?
« Reply #13 on: September 26, 2011, 07:18:05 PM »
Quote from: dustinian on September 26, 2011, 11:13:38 AM
Sure you can solve it with QB. Write a "Do..." loop that cuts off a 1 degree arc of the pizza slice "...Until" the slice fits in the new pan.

If it's good enough for TheBob to figure out how many bytes a "GET" graphic takes up, it's good enough to put pizza in a new pan.

Plus those 1 degree pizza arcs will make great finger food for the kids.

Great Dustinian - that is the kind of thinking that I like!

But we must decide where each one degree cut starts AND where it ends.
Rather a lot of variables.
And when we have the answer we then have solved just ONE example - the "one cut is all that's needed"
variant: the set of pans iinto which "one more cut" pizzas of each form (point A to point B), can be fitted

But at least we have made a start!

#### Mrwhy

• Hero Member
• Posts: 2890
• My Dad called me Mr Why when I was 5.
##### Re: "With programming, you can do anything!" But not with qb64?
« Reply #14 on: September 26, 2011, 07:30:43 PM »
Quote from: vrensul on September 26, 2011, 03:05:49 PM
If you're referring to that "bubbles" program I wrote a while back, I never did finish it just yet.  I started to implement some of the ideas and just plain ol' lost interest.  I do that alot; start a program and never finish it.  Most times it's just for experimentation.  That "bubbles" or Ripple program was intended to be a background for an old music-player replica I was going to make.  I still intend to.  I just need to learn more about Trig.  Clippy did give me pretty much everything formula wise that I needed though.  *watches Clippy's head swell some more  *

What is TheBob?

Glad you are not offended.  Sorry if I somehow upset you. I was merely impressed by the words YOU quote at the bottom of each message
If only it were true! - that computers COULD. But they need a HUMAN brain to "tell them what to do"

I know exactly what you mean when you say  "I never did finish it just yet.  I started to implement some of the ideas and just plain ol' lost interest.  I do that alot; start a program and never finish it.  Most times it's just for experimentation."
Yes indeed, experiments are great fun AND the doorway to discovery! The effort getting there is in fact far more fun than merely arriving!
Help with trig? Glad to TRY to help if I can (please keep it simple enough for me!)