.com.unity Forums

.com.unity Forums (http://forum.shrapnelgames.com/index.php)
-   Space Empires: IV & V (http://forum.shrapnelgames.com/forumdisplay.php?f=20)
-   -   OT: One-color Lava Lamp (http://forum.shrapnelgames.com/showthread.php?t=23277)

NullAshton March 25th, 2005 02:55 PM

OT: One-color Lava Lamp
 
1 Attachment(s)
With C++, I made this near thingie that slowly changes color in full-screen. It requires DirectX 8.1. Press any color to exit. Tell me what you think http://forum.shrapnelgames.com/image...es/biggrin.gif

PvK March 25th, 2005 05:34 PM

Re: OT: One-color Lava Lamp
 
It's glowy! A nice no-nonsense screen saver or night light. http://forum.shrapnelgames.com/images/smilies/happy.gif

PvK

Fyron March 25th, 2005 08:05 PM

Re: OT: One-color Lava Lamp
 
You might want to have it detect mouse clicks as well as key presses.

NullAshton March 25th, 2005 08:06 PM

Re: OT: One-color Lava Lamp
 
Tried that, but it kept closing right after it started up.

narf poit chez BOOM March 26th, 2005 02:41 AM

Re: OT: One-color Lava Lamp
 
I could never figure out how to do those plasma thingies.

Instar March 26th, 2005 02:53 AM

Re: OT: One-color Lava Lamp
 
Not bad at all... I need to learn DX9. I've done openGL, before, and I wasn't too impressed.
Is it on a time controlled loop to prevent going faster or slower on different computers?

atari_eric March 26th, 2005 04:00 AM

Re: OT: One-color Lava Lamp
 
Put a one-second delay before it tests for a mouse press.
That should work.

IF you're testing for a mouse move, test to see if it has moved MORE that x pixels (x about 5 or 10), and not just if it moved at all.

NullAshton March 26th, 2005 11:40 AM

Re: OT: One-color Lava Lamp
 
I just had it to where if the program was sent a WM_MOUSEMOVE event, it posted the quit message.

The program uses SetTimer() in order to keep it at a steady pace. SetTimer() calls TimerProc() every 25 milliseconds to change the global color values.

This isn't that advanced, it just clears the screen in a slowly shifting color.

On another note, I never knew that all these people on these fourms programmed in C++...

kerensky March 27th, 2005 06:24 PM

Re: OT: One-color Lava Lamp
 
nifty..

Instar March 29th, 2005 12:21 AM

Re: OT: One-color Lava Lamp
 
Quote:

NullAshton said:
I just had it to where if the program was sent a WM_MOUSEMOVE event, it posted the quit message.

The program uses SetTimer() in order to keep it at a steady pace. SetTimer() calls TimerProc() every 25 milliseconds to change the global color values.

This isn't that advanced, it just clears the screen in a slowly shifting color.

On another note, I never knew that all these people on these fourms programmed in C++...

C++ is an easy language to get started with, so I'm sure people here know a bit. Most people here probably don't do programming as a job, I'd bet.
I'm a Java programmer at the moment, but my favorite language is by far C#. I also do C/C++, COBOL, FORTRAN, Perl, SQL, JCL, and things like HTML, Javascript, databases, web programming, XML, etc..
Yay programming.

NullAshton March 29th, 2005 10:15 AM

Re: OT: One-color Lava Lamp
 
C++ is easy? It's a whole lot harder than Visual Basic.

Fyron March 29th, 2005 04:25 PM

Re: OT: One-color Lava Lamp
 
Compared to languages like COBOL, FORTRAN, LISP, etc., C++ is quite easy to work with. A huge number of modern languages (Java, Python, C#, PHP, Delphi, etc.) are based off of C++, so you get the advantage of getting a head start on them as well...

NullAshton March 29th, 2005 04:35 PM

Re: OT: One-color Lava Lamp
 
C++ in concept is very simple. You set varibles, then do various operations on them with functions. In practice, however, it can get complex. The hardest part I believe is remembering the functions, as well as 'thinking' in C++. There are many functions to interact with the user, and those can be difficult to work with at times. Also, programming forces you to think in other directions than you're used to. It took a bit of work to get that program to cycle the colors. I had a varible that told the program what colors it needs to decrease or increase.

geoschmo March 29th, 2005 05:23 PM

Re: OT: One-color Lava Lamp
 
I just started a C++ class. Had my first class Monday. Yay me. http://forum.shrapnelgames.com/images/smilies/happy.gif

NullAshton March 29th, 2005 05:30 PM

Re: OT: One-color Lava Lamp
 
I learn C++ by myself. No class for me http://forum.shrapnelgames.com/images/smilies/laugh.gif

Will March 29th, 2005 06:51 PM

Re: OT: One-color Lava Lamp
 
Quote:

geoschmo said:
I just started a C++ class. Had my first class Monday. Yay me. http://forum.shrapnelgames.com/images/smilies/happy.gif

I'm not sure if this is supposed to be a pun or not! http://forum.shrapnelgames.com/images/smilies/happy.gif

In general, there isn't really much of a difference between programming languages. Sure, some have some syntax that make it a little more difficult (think assembly, etc). Some come with built-in libraries to handle the more complicated stuff (think Visual BASIC, etc.). But in the end, just about every language is Turing-equivalent, which means anything you can do on a Turing Machine, you can do with the language. Just don't try to program a Turing Machine, that's a nightmare (think assembly is to Turing as VB is to assembly). In the end, the choice usually comes down to the factors of how much time you have, what platform the program is on, and the "expected lifespan" of the code.

narf poit chez BOOM March 29th, 2005 08:20 PM

Re: OT: One-color Lava Lamp
 
What's a Turing Machine?

I've heard of the Turing Test, but never a Turing Machine.

Will March 29th, 2005 09:52 PM

Re: OT: One-color Lava Lamp
 
Turing Machine is a theoretical computer. As far as I know, an actual Turing Machine does not exist, only machines that are equivalent to it (in the mathematical sense). I guess it would be possible to build one, but it would be highly inefficient. It's called a Turing Machine after Alan Turing, who thought it up while doing cryptography work for Britain in WWII.

The following should be sprinkled liberally with "IIRC"... it's been a while since I've looked at the specifics of Turing machines:
Basically, you have a set of "states", denoted by Q, and an "alphabet", denoted by a capital gamma. The alphabet has at least two "symbols", of which one is the "empty symbol", usually "0". The states are initialized to one of the symbols in the alphabet. A state "s" existing in Q is called the "start state", and a set of states F exists in Q denoting "final states". Finally, there is a function denoted by lowercase delta that maps actions to be taken with this Turing Machine. You start in s (the start state), and keep going until you get "stuck" in a state; if this state is a "final state", that's your answer, otherwise the answer is undefined. So, for example, you start in s, which holds the symbol "a". Delta maps s and "a" to 'change current state symbol to "b", move to state s3'. And you would keep going until you reach a point where you loop in a single state forever, or reach some condition, etc. It all depends on the specific definition you use.

The point of the whole thing is that anything your computer can do, or any computer, a Turing Machine can do. A corollary is that what any one computer can do (compute), any other computer can as well. So, the first electronic computer, ENIAC, could have done exactly the same calculations as the world's fastest supercomputer now. The only difference is it would be a bit harder to tell ENIAC to do the same thing as the supercomputer, and ENIAC would be a lot slower. But the idea is, it is theoretically possible for that to happen.

So, Turing-equivalence basically means that you can translate any program into pure mathematics, and vice versa, and thus any way of programming can accomplish exactly the same thing as any other way of programming. However, hardly anyone is insane enough to do the translation that way. It's like doing mathematics entirely within the space of Russel's conversion of arithmetic to logic, where proving that 2 + 2 = 4 takes 21969 steps, including all the subtheorems, etc. used to get there.

narf poit chez BOOM March 29th, 2005 11:33 PM

Re: OT: One-color Lava Lamp
 
Don't know what Russel's conversion is, but I get your point.

I can prove that 2 + 2 = 4 with 4 peas.

2 peas here.
2 peas here.
Put them together and get 4 peas. A pre-schooler can understand that, if their parents have been teaching them.

However, as I understand your point, to unravel all the impulses from start to finish would take a long time. (Read somewhere that it takes millions of calculations just to move your little finger - Don't know how true that is).

Instar March 30th, 2005 01:30 AM

Re: OT: One-color Lava Lamp
 
C++ is easy, believe me... wait till you try doing assembly (or even just the raw machine bytes...), or COBOL.
C++ is easy, because you can do easy C stuff. After some basic procedural stuff, moving on to simple objects is easy enough.
Pointers are easy enough, but for some reason people get them wrong...
Anyhow, starting C++ is easy. Understanding the high level ideas is harder.

atari_eric March 30th, 2005 02:17 AM

Re: OT: One-color Lava Lamp
 
Quote:

geoschmo said:
I just started a C++ class. Had my first class Monday. Yay me. http://forum.shrapnelgames.com/images/smilies/happy.gif

So, when are you going to re-write the PBW server? http://forum.shrapnelgames.com/images/smilies/wink.gif

(not that it needs it, or anything: just that you might be tempted to re-do it in something you inherently understand and have fresh in your mind...)

NullAshton March 30th, 2005 09:39 AM

Re: OT: One-color Lava Lamp
 
Pointers are simple, they simply point to something.

Ragnarok March 30th, 2005 03:14 PM

Re: OT: One-color Lava Lamp
 
Quote:

atari_eric said:
So, when are you going to re-write the PBW server? http://forum.shrapnelgames.com/images/smilies/wink.gif

that will commence sometime in the near future I imagine. I believe the main thing holding things right now is waiting for SEV to be released so we can build PBW2 around SEV & SEIV.

Link to the PBW2 Dev site. No posts have been made in along time and even when they were made there weren't many of them.

geoschmo March 30th, 2005 04:09 PM

Re: OT: One-color Lava Lamp
 
Quote:

atari_eric said:
So, when are you going to re-write the PBW server? http://forum.shrapnelgames.com/images/smilies/wink.gif


Well, I just had my second class today. We are up to adding constants and prompting users for inputs. So it might be a while. http://forum.shrapnelgames.com/images/smilies/laugh.gif

Strategia_In_Ultima March 30th, 2005 04:17 PM

Re: OT: One-color Lava Lamp
 
Quote:

Will said:
Turing Machine is a theoretical computer. As far as I know, an actual Turing Machine does not exist, only machines that are equivalent to it (in the mathematical sense). I guess it would be possible to build one, but it would be highly inefficient. It's called a Turing Machine after Alan Turing, who thought it up while doing cryptography work for Britain in WWII.


Neal Stephenson's "Cryptonomicon" points this out as well. I'm not saying that what it says is entirely true (though I believe the basics behind the Turing machine as explained in Cryptonomicon are), but it is still a good - no, make that excellent read.

but as for your 1-color lavalamp NA, that's really relaxing.

Slynky March 30th, 2005 06:47 PM

Re: OT: One-color Lava Lamp
 
Quote:

Imperator Fyron said:
Compared to languages like COBOL, FORTRAN, LISP, etc., C++ is quite easy to work with. A huge number of modern languages (Java, Python, C#, PHP, Delphi, etc.) are based off of C++, so you get the advantage of getting a head start on them as well...

I think I got ruined along the way somewhere. Started in Fortran IV, then Cobol, CICs Command level (MF stuff), JCL (and all that crap). Then began dabling in Basic on a Honeywell and then on an IBM PC. That evolved to Borland's Pascal and Clipper. Then, I got tired of languages and started messing with graphics. Now, all the object-oriented stuff confuses me. You know, old dog, new tricks (yada, yada, yada).


All times are GMT -4. The time now is 06:19 PM.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©1999 - 2025, Shrapnel Games, Inc. - All Rights Reserved.