[QUOTE=CarlBooth;20042624]For those saying "GOTO has no use!", I defy you to deny you have ever typed this into a BBC Model B:
[code]
10 PRINT "YOU ARE GAY"
20 GOTO 10
[/code][/QUOTE]
[QUOTE=CarlBooth;20042624]For those saying "GOTO has no use!", I defy you to deny you have ever typed this into a BBC Model B:
[code]
10 PRINT "YOU ARE GAY"
20 GOTO 10
[/code][/QUOTE]
Not like we are talking about C++ or something.
[QUOTE=h2ooooooo;20040495]It's very basic (I have no idea if you did it the same way) and it simply works by first creating all the main variables in the main scope (all the options of the controls), adding events to the button and having 3 arrays that the whole system is built on. One array for following of each: arrBranches, arrRoots and arrEndDots.
The program the executes the main function, generates the root (static, except the endX and endY, and then slightly random rotated), and then adds a random amount of branches that each call the same function (recursive). Every time a branch is added, it's added to the arrBranches array, and goes through a for loop where it creates branches by using the following code:
arrBranches.push(new Array(intLevel, intEndX, intEndY, intCurrentRotation));
for (var i:int = 0; i < intBranchesToCreate; i++) createBranch(intBranchID);
intBranchesToCreate is random, intLevel is the current level (0 is the main, 10 is the ends etc.), endX and endY is the ending x and y position of the current branch for use with the next branchs start positions, and intCurrentRotation is a matter of its rotation (instead of just a random 360 degrees, it works using a minimum and a maximum based on parent rotation). The intBranchID refers to the position in the arrBranches array, and can then be refered to when the function is called again.
The roots basically work the same way, except they don't have the staticness of the main piece.
After both roots and branches are added, it goes through the arrEndDots array and creates dots on every single of the end branches based on 3 parameters: level, endx and endy.
I'd be interested in knowing if you took the same approach of if you did it another way? :)[/QUOTE]
I haven't been programming for very long, so my method may seem messy!
Mine works in a very similar way, starts with a list of editable min and max variables, trunknumber, trunklength, branchstart, branchgap, branchlength, fruitsize, leafheight etc the values are randomised between the two.
First the initial trunk length is generated then at the end, each main trunk is generated and given a generated name. The trunks start evenly across the 200 degrees, to prevent crowding. x and y values are generated through using the previous x,y value plus a random number "xmin xmax or ymin, ymax". Each trunk has it's own array, where x and y co-ordinates are generated "trunknumber" times. Lines are then drawn through this array.
Then, using "branchlength" values, and x and y co-ordinates from the main trunk arrays, branches grow from them. The branches are spread through the generated "branchgap" values.
Fruit are added the end of the trees by using the "trunklength" x and y values. Leaves are done a similar way, but using "leafheight" values to determine at what trunk height to start generating leaves, leaves finish at "trunkheight"
Very interesting read - thanks for sharing! :smile:
[QUOTE=CarlBooth;20042624]For those saying "GOTO has no use!", I defy you to deny you have ever typed this into a BBC Model B:
[code]
10 PRINT "YOU ARE GAY"
20 GOTO 10
[/code][/QUOTE]
I can vouch for this guy, theres a BBC micro in my physics labs :D
It's actually quite useful for simple experiments, since you can just program for it specifically for what you're using and not have to worry about booting windows and all that junk :p
[QUOTE=GreyIOutcast;20036362][IMG]http://imgs.xkcd.com/comics/goto.png[/IMG]
I've never seen the reason for goto, ever. Perhaps my interpretation of how it works is wrong, but isn't it essentially the same as a loop?
Ah well, most things seem useless without experience, or a good example.
[editline]09:47PM[/editline]
Oh, and included obligatory XKCD comic. It always pops into my head when I hear "goto" anymore.[/QUOTE] That's the completely wrong way to use goto. Goto is a much more flexible way to loop in some cases where to do the same thing you'd have to combine multiple types of iterations.
Mantis is just a bit bloated. As evidenced by its 2000-line config file.
[QUOTE=CarlBooth;20042624]For those saying "GOTO has no use!", I defy you to deny you have ever typed this into a BBC Model B:
[code]
10 PRINT "YOU ARE GAY"
20 GOTO 10
[/code][/QUOTE]
Even better:
[code]
10 PRINT "LOOK AROUND YOU"
20 GOTO 10
RUN
[/code]
[media]http://www.youtube.com/watch?v=drE5cHe6c3s[/media]
[url]http://www.mkw.me.uk/beebem/[/url]
[img]http://i45.tinypic.com/33m2w6t.jpg[/img]
fuck yeah
Gonna dig out my old maths textbook and write a few programs.
[QUOTE=Shanethe13;20045564]Even better:
[code]
10 PRINT "LOOK AROUND YOU"
20 GOTO 10
RUN
[/code]
[media]http://www.youtube.com/watch?v=drE5cHe6c3s[/media][/QUOTE]
I laughed so hard, then it got creepy at the very end. :byodood:
[QUOTE=Shanethe13;20045564]Even better:
[code]
10 PRINT "LOOK AROUND YOU"
20 GOTO 10
RUN
[/code]
[media]http://www.youtube.com/watch?v=drE5cHe6c3s[/media][/QUOTE]
i watched that all and want to punch whoever owns that
Quick question, didn't think it was worth opening a thread:
I'm trying to make a simple mechanics simulator in c++ using SFML. I originally had one sf::Vector2f representing the force being applied on a body, but decided to go with multiple vectors instead, one for each of weight, friction, user-induced force, etc etc. So, I tried to make an array of sf::Vector2f as so
[cpp]sf::Vector2f force[4];[/cpp]
and the compiler says
[QUOTE]error: invalid use of template-name 'sf::Vector2' without an argument list[/QUOTE]
I am lost here, dunno what I did wrong and can't find any help on google. Any ideas?
Thanks in advance.
Updated my tree generation script because of boredom. Now has physics! (Box2D).
+ Added physics to the end dots as soon as you mouse over it. Mouse over one of the top ones, and watch it fall down and make the rest fall down (also added physics checkbox).
+ Added default button
[img]http://www.jalsoedesign.net/experiments/tree/treecreationphysics.png?uncacheold[/img]
What it looked like before:
[img]http://www.jalsoedesign.net/experiments/tree/treecreation.png[/img]
Same URL:
[url]http://www.jalsoedesign.net/experiments/tree/tree.html[/url]
[QUOTE=ZeekyHBomb;20039838][cpp]But I can't see where 'a' is saved to[/QUOTE]
As I said in a previous post, a is stored on the stack, however it seems to be more complex than that in C++ (as nullsquared said)
[QUOTE=grlira;20048244]Quick question, didn't think it was worth opening a thread:
I'm trying to make a simple mechanics simulator in c++ using SFML. I originally had one sf::Vector2f representing the force being applied on a body, but decided to go with multiple vectors instead, one for each of weight, friction, user-induced force, etc etc. So, I tried to make an array of sf::Vector2f as so
[cpp]sf::Vector2f force[4];[/cpp]
and the compiler says
I am lost here, dunno what I did wrong and can't find any help on google. Any ideas?
Thanks in advance.[/QUOTE]
From the compiler's message, it looks like you missed the trailing 'f' in your code.
[QUOTE=voodooattack;20048468]From the compiler's message, it looks like you missed the trailing 'f' in your code.[/QUOTE]
For Pete's sake... I did :X I must be blind or something.
Thanks.
[QUOTE=Shanethe13;20045564]Even better:
[code]
10 PRINT "LOOK AROUND YOU"
20 GOTO 10
RUN
[/code]
[media]http://www.youtube.com/watch?v=drE5cHe6c3s[/media][/QUOTE]
Oh my god.
Added APU control panels (F8 and F9) to my internal spacecraft systems simulator (basically it does physics simulation of all internal spacecraft systems, of a specific custom spacecraft, like for example it properly calculates voltage drops in all key electric buses, etc you get the idea):
[IMG]http://filesmelt.com/dl/tpanel.png[/IMG]
Yes all those switches work, well, APU ones will work once I finish APU simulation, but all others work and their behaviour is not hard-coded, it simply alters some simulation variables (like gives or doesn't give voltage to specific bus)
And working on APU simulation (APU is aux power unit, here it's a turbine spun by hot gas coming from extensive chemical reaction between two elements, it spins at 80000 rpm and using gearbox it transfers torque to hydraulic pump, fuel pump, oil pump.
Also I wrote tetris for computer system, so you don't get bored while on orbit:
[IMG]http://filesmelt.com/dl/tetrismfd.png[/IMG]
Of course there's downside, if tetris crashes, entire computer, which to say runs all life support on the vessel, also crashes. Good thing there's four of them.
[QUOTE=iPope;20041543]I wrote a python script that retrieves the latest blog post from a tumblr blog and parses it so it's ready to post to a forum. Except, I don't know how I would go about getting it to post to a forum, any ideas?[/QUOTE]
Depends on the infrastructure of the forum in question. You'd probably put the actual message in some POST request.
Made my tower defense menu a little prettier (Hardcoded vignettes, yay :D)
[IMG]http://img20.imageshack.us/img20/466/towerd.png[/IMG]
[QUOTE=honeybuns;20054115]you are so cool[/QUOTE]
sorry i cannot hear you over the sound of how awesome Detours 2.1 from Microsoft Research is.
what is detours
[QUOTE=Eleventeen;20054926]what is detours[/QUOTE]
function interception/hooking/whatever, i'm using it to dump stuff that steam sends over udp (which is useless since it's encrypted).
[QUOTE=majorlazer;20053992]detours 2.1 owns[/QUOTE]
Real men do it with punch-cards.
detours 1.5 was better. They fucked up 2.1 so badly.
[QUOTE=h2ooooooo;20048246]Updated my tree generation script because of boredom. Now has physics! (Box2D).
+ Added physics to the end dots as soon as you mouse over it. Mouse over one of the top ones, and watch it fall down and make the rest fall down (also added physics checkbox).
+ Added default button
Same URL:
[URL]http://www.jalsoedesign.net/experiments/tree/tree.html[/URL][/QUOTE]
[img]http://filesmelt.com/dl/borktree.png[/img]
I like the physics!
[editline]12:36PM[/editline]
And it won't even lag with that many ball thingys. My pc is [I][U]THAT[/U][/I] good. :c00lbert:
My editor for the game I'm making is coming along nicely.
[img]http://i49.tinypic.com/2m4t3eh.jpg[/img]
I made all of the icons on the buttons lol. It's programmer art but I don't think it's too bad (the open icon is a bit crappy)
The GUI on the right uses SFML and the 3D viewport uses irrlicht.
I'm doing input myself with the win32 message system for the mouse (WM_LMOUSEDOWN, WM_LMOUSEUP plus GetCursorPos with some magic done with GetWindowRect to get mouse position local to the window) and direct input for keys.
[media]http://www.youtube.com/watch?v=By1csIl3ZCI[/media]
I'm making a simple 2D physics engine. Collisions are next, then resting contact and then constraints.
Sorry, you need to Log In to post a reply to this thread.