Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Python 

The A-Wave Simulator

Hello everyone,,,
It has been a while since I have made something with python (as well as it has since I last posted something here). So I've always enjoyed physics and so I did with programming. But doing these stuff together was really amazing. Ladies and gentlemen, I present:
The A-Wave Simulator

[img]http://i72.servimg.com/u/f72/16/27/78/35/screen10.png[/img]
[img]http://i72.servimg.com/u/f72/16/27/78/35/screen11.png[/img]

The simulator supports simulating both Longitudinal and Transverse waves. Two waves (A & B) can be simulated at the same time, and are both needed in order to allow the Interference. Reflection of the wave can be allowed too, and the Interference of the 2 waves (the original and the reflected one) produces a stationary wave and much more.

Download link: http://www.mediafire.com/?dbmec16hdbss6nj

Source code (Fully made with pygame): Well, before you take a look at it, I would like to say, BEWARE! The code sucks when at neatness perspective. No multiple files, no classes and the code isn't commented at all. You still want to see it? http://pastebin.com/9gjSQ4SS

Comments would be nice ;) !
If you really made this it looks awesome man. Great job!!
Thank you very much! It was actually trashed by my "computer teacher". I knew programming work wouldn't be appreciated at school... But whatever. They don't understand it anyways.. :D
I've also started working on another project, actually another simulator which simulates atoms according to Bhor's model of an atom. I didn't really finish it (I had no more motivation), but you can check it out if you're interested: http://pastebin.com/SQftbk6b
I can't believe your computer teacher trashed that...
what do u mean by "trashed"? lol

did he not appreciate it? or was it below par on an assignment?
Well, since you are interested about what happened, here is the story:
Spoiler (Click to View)
Very interesting and unique, what do you mean trashed?
Intensely underrated, looks down on, or you can say the vrey opposite of appreciated. More of crushed.
(May 3, 2013 11:47 PM)A-MAN Wrote:  Intensely underrated, looks down on, or you can say the vrey opposite of appreciated. More of crushed.

code is horrible, can see why the teacher was trashing it (I kid, I kid; but that code, ever heard of a class/OOP code?)

I mean a simple thing to add to readability/cut down loads of coding time would be:
Code
objects = [button1, button2, button3, someotherpygamesurface]
for item in objects:
  item.blit()

practice making some classes, don't worry about parenting/subclassing, maybe make a menu of some sort which changes screens.

The program itself is alright, serves its purpose, however, wave velocity is usually constant, and the wave length will vary based on the frequency, not velocity on the other two...

Personally I had a teacher just like that (dumb bitch couldn't even write a python program longer then 10 lines(said she prefered VB, yet couldn't write anything that worked in that either), and just hated on me for some reason, I wasn't even cocky towards her, just totally ignored everything she said, and even after topping the subject without study she said I was only dropping the course because I didn't understand it LMAO), I just dropped software, wasn't worth wasting my time drawing diagrams that will never be used after the HSC (words of a uni professor, not mine :P)

As a side; What country/year are you in?
Looks awesome! I don't like these dark colours but it's cool!
The thing that I like (and maybe one of the reasons that your teacher didn't like it) is the simplicity. I like some guis like that for some reason. Just the way that it is raw data, and that you focused on that instead of making a really pristine gui. Again, not sure why I like that, but simplicity appeals to me :)
(May 4, 2013 01:15 AM)Dmaster_773 Wrote:  code is horrible, can see why the teacher was trashing it (I kid, I kid; but that code, ever heard of a class/OOP code?)

I mean a simple thing to add to readability/cut down loads of coding time would be:
Code
objects = [button1, button2, button3, someotherpygamesurface]
for item in objects:
  item.blit()

practice making some classes, don't worry about parenting/subclassing, maybe make a menu of some sort which changes screens.
A-MAN Wrote:Source code (Fully made with pygame): Well, before you take a look at it, I would like to say, BEWARE! The code sucks when at neatness perspective. No multiple files, no classes and the code isn't commented at all. You still want to see it? http://pastebin.com/9gjSQ4SS
I am already aware of this. I was in an absolute hurry when I wrote that. And just to let you know, he (the teacher) didn't see the source code. All what he saw was the program on the projector screen. Plus, the code isn't really THAT bad. I've got a function that blits, a function that draws the buttons, a function which adds the plotting for the interfered wave, another for the Longitudinal and did all the logic in the "while True" loop. And about the lack of the classes, it is just that I am not used to classes (as I never really NEEDED them for something to work right). And so, I don't usually use them at all when I write code by default. There is also a dead project of mine (another simulator), at which I used these classes on, here: http://pastebin.com/SQftbk6b
Check it out if you liked the first one :)

(May 4, 2013 01:15 AM)Dmaster_773 Wrote:  The program itself is alright, serves its purpose, however, wave velocity is usually constant, and the wave length will vary based on the frequency, not velocity on the other two...
Well, yes you are right, but that only applies to the electromagnetic waves. Also, the more control you have for a simulator, the more "simulator-ish" the simulator is. And if the user still wants a constant velocity between the two waves, he still can do it manually.

(May 4, 2013 01:15 AM)Dmaster_773 Wrote:  Personally I had a teacher just like that (dumb bitch couldn't even write a python program longer then 10 lines(said she prefered VB, yet couldn't write anything that worked in that either), and just hated on me for some reason, I wasn't even cocky towards her, just totally ignored everything she said, and even after topping the subject without study she said I was only dropping the course because I didn't understand it LMAO), I just dropped software, wasn't worth wasting my time drawing diagrams that will never be used after the HSC (words of a uni professor, not mine :P)

As a side; What country/year are you in?
Lol, so they are everywhere..
Year 11 at Yemen (somewhere at Arabia)

Aɴᴛʜʀᴀx Wrote:The thing that I like (and maybe one of the reasons that your teacher didn't like it) is the simplicity. I like some guis like that for some reason. Just the way that it is raw data, and that you focused on that instead of making a really pristine gui. Again, not sure why I like that, but simplicity appeals to me :)
A fan of retro graphics, just like me B). Just wandering, did he (the teacher) really wanted to see HD effects and graphics in a scientific program? Meh... whatever..

Thanks for all of your comments guys! Appreciated!!


Possibly Related Threads...
Thread / Author Replies Views Last Post
[.NET] by BarretFeb 22, 2018 01:57 PM 5 385 Feb 22, 2018 01:57 PM
Last Post: Barret
[Python] by lolimsoasdApr 15, 2017 10:23 AM 0 123 Apr 15, 2017 10:23 AM
Last Post: lolimsoasd
[Shell] by BeigevenusApr 14, 2017 04:48 PM 10 486 Apr 14, 2017 04:48 PM
Last Post: Beigevenus