sahara agrasen Posted November 1, 2007 Report Share Posted November 1, 2007 One Challange for Everyone!!!!!! I have one random number...which i have to find that the number is prime or not.... suppose I have 125 number...now i need to check the number is prime or not..how can I know?.. can anybody send me a sample VI for that?.. One more request that plz dont send the repeated VI as in NI.. Also i know that Prime numbers are those which are only divisible by only two numbers: 1 and the number itself... Sahara Quote Link to comment
LAVA 1.0 Content Posted November 1, 2007 Report Share Posted November 1, 2007 QUOTE(sahara agrasen @ Oct 31 2007, 11:44 AM) ...One more request that plz dont send the repeated VI as in NI.. ... I don't understand that part of your request. Please clarify. Ben Quote Link to comment
AnalogKid2DigitalMan Posted November 1, 2007 Report Share Posted November 1, 2007 Maybe because it is homework related and they can't use exisiting examples that the prof knows about? Just speculation on my part. Quote Link to comment
jg69 Posted November 1, 2007 Report Share Posted November 1, 2007 How about: divide by 2, by 3, by 4, by 5, ... Jens Quote Link to comment
Justin Goeres Posted November 1, 2007 Report Share Posted November 1, 2007 Didn't we just cover this in another thread a few days ago? EDIT: Oh, look! We did! And the original topic starter was sahara that time, too. The problem wasn't exactly the same, but it was close enough that I'd think anybody who solved that problem (or used the pointers we provided) would be able to solve this one. Quote Link to comment
LAVA 1.0 Content Posted November 1, 2007 Report Share Posted November 1, 2007 QUOTE(Justin Goeres @ Oct 31 2007, 02:51 PM) Didn't we just cover this in another thread a few days ago?EDIT: Oh, look! http://forums.lavag.org/Need-to-Solve-Two-Problems-t9333.html' target="_blank">We did! And the original topic starter was sahara that time, too. The problem wasn't exactly the same, but it was close enough that I'd think anybody who solved that problem (or used the pointers we provided) would be able to solve this one. Well in that case I'll wait for a real challenge. Something like... Use the 3d Picture control to develop a robotic frame that can be outfit with user designed weapons and armor and who's motion and behaviour are offered as services that a user specified VI can utilize to control the motion and behaviour. That way we can have virtual robot wars and fight over who is the meanest LV developer. Bonus points awarded for tracking and animating parts that fall of durring battle. Ben Quote Link to comment
Justin Goeres Posted November 1, 2007 Report Share Posted November 1, 2007 QUOTE(neB @ Oct 31 2007, 01:09 PM) Use the 3d Picture control to develop a robotic frame that can be outfit with user designed weapons and armor and who's motion and behaviour are offered as services that a user specified VI can utilize to control the motion and behaviour. As long as we're brainstorming... I propose Scripting Fight. A reference to a blank VI is passed to two different VIs running in parallel. These two VIs (each written by a different individual) should compete to accomplish some block diagram goal while preventing the other VI from accomplishing the same goal. The "winner" is the VI that, after a certain time period or number of nodes, is closer to the goal by some metric (functionality, aesthetics, etc.). Quote Link to comment
TobyD Posted November 1, 2007 Report Share Posted November 1, 2007 QUOTE(sahara agrasen @ Oct 31 2007, 09:44 AM) can anybody send me a sample VI for that?.. Just look up an algorithm online and recreate it in LabVIEW. That is what I did in the code below. Consider it my contribution to support the plethora of braindead engineers coming out of universities with an ever increasing frequency. I would suggest you take the time to understand this code before you turn it in for a grade. http://lavag.org/old_files/post-8758-1193864673.vi'>Download File:post-8758-1193864673.vi Quote Link to comment
Tomi Maila Posted November 1, 2007 Report Share Posted November 1, 2007 QUOTE(Justin Goeres @ Oct 31 2007, 10:54 PM) I propose Scripting Fight. A reference to a blank VI is passed to two different VIs running in parallel. These two VIs (each written by a different individual) should compete to accomplish some block diagram goal while preventing the other VI from accomplishing the same goal. The "winner" is the VI that, after a certain time period or number of nodes, is closer to the goal by some metric (functionality, aesthetics, etc.). This Script Wars proposal of yours sounds interesting. How about making the fighting VIs evolve autonomously so that they constantly become better and better without human intervention. Perhaps LAVA should have a few script wars servers so that we could start fighting... Fact of the day: LabVIEW 8.5 scripting has 257 classes, 1118 method names and 3214 property names. Do already you know them all? Quote Link to comment
eaolson Posted November 1, 2007 Report Share Posted November 1, 2007 QUOTE(Justin Goeres @ Oct 31 2007, 03:54 PM) I propose Scripting Fight. A reference to a blank VI is passed to two different VIs running in parallel. These two VIs (each written by a different individual) should compete to accomplish some block diagram goal while preventing the other VI from accomplishing the same goal. The "winner" is the VI that, after a certain time period or number of nodes, is closer to the goal by some metric (functionality, aesthetics, etc.). I've never played it, but that really reminds me of http://en.wikipedia.org/wiki/Core_wars' target="_blank">Core Wars. Quote Link to comment
sahara agrasen Posted November 2, 2007 Author Report Share Posted November 2, 2007 QUOTE(eaolson @ Oct 31 2007, 10:30 PM) I've never played it, but that really reminds me of http://en.wikipedia.org/wiki/Core_wars' target="_blank">Core Wars. Yes, I am the same person and I had post the nearby problem before some day ago.. Though I m new one in LabVIEW, still i m searching of an answer..so plz can anybody tells me to check the number is prime or not..that will be enough for me at this stage..bz i have not reached at level that i can solved the challange which was given by some person here.. plz help me out to know the answer of prime number. Thanking you Sahara Quote Link to comment
jbrohan Posted November 2, 2007 Report Share Posted November 2, 2007 QUOTE(Justin Goeres @ Oct 31 2007, 03:54 PM) As long as we're brainstorming... This is really interesting. However, why not try to do better than just fighting, which seems to often get lots of people in trouble. Why not a vi which can find the capabilities required in the specification and add them in to a started-off-blank VI. For example if the specification called for a prime_number test on a particular wire then the "scripting cooperator" would locate our origianal poster's homework and slip it in. Quote Link to comment
LAVA 1.0 Content Posted November 2, 2007 Report Share Posted November 2, 2007 QUOTE(sahara agrasen @ Oct 31 2007, 09:19 PM) Yes, I am the same person and I had post the nearby problem before some day ago..Though I m new one in LabVIEW, still i m searching of an answer..so plz can anybody tells me to check the number is prime or not..that will be enough for me at this stage..bz i have not reached at level that i can solved the challange which was given by some person here.. plz help me out to know the answer of prime number. Thanking you Sahara Then I will start again. In reply #71 of the thread found at this URL http://forums.ni.com/ni/board/message?boar...=146233#M146233 I posted an example that finds prime numbers using the brute force approach of trial and error. It also takes into concideration that that largest number that is worth attempting to divide a number by is its square root. Other that that, it is straight forward. Please look at that code and then ask follow-up questions. BACK TO THE FIGHT! I am game to keep these battle ideas going but I'd like to make an observation. THese ideas are tending toward the complicated side and few of us are going to be able to do it all individually (Norm excluded). So what about turning these ideas into a multi-phase project and proceed using the Unified Process of breaking it down into simple steps that lead to our end goal. Just tossing out ideas, Ben Quote Link to comment
Justin Goeres Posted November 2, 2007 Report Share Posted November 2, 2007 QUOTE(eaolson @ Oct 31 2007, 03:30 PM) I've never played it, but that really reminds me of http://en.wikipedia.org/wiki/Core_wars' target="_blank">Core Wars. Exactly . Quote Link to comment
gb119 Posted November 2, 2007 Report Share Posted November 2, 2007 QUOTE(Justin Goeres @ Oct 31 2007, 09:54 PM) As long as we're brainstorming... Perhaps simpler code challenges for when we get asked 'homework' type questions: * The worst LabVIEW style solution - who can come up with the solution that whilst actually doing the correct thing without bugs like race conditions is executed in the worst possible style - I'm thinking multiple nested sequences and loops with sub-vis and wires that sit on top of each, wires that run right to left, daft connector pane patterns, the full works. * The most obfuscated solution - again, a solution that actually works and is bug free, this time written in technically good stlye, but with hardest to follow and least obvious algorithm. I'm thinking about solutions that will score a nice big zero mark but do actually work. Or am I just too evil Quote Link to comment
JDave Posted November 3, 2007 Report Share Posted November 3, 2007 QUOTE(Gavin Burnell @ Nov 1 2007, 03:30 PM) Perhaps simpler code challenges for when we get asked 'homework' type questions:* The worst LabVIEW style solution - who can come up with the solution that whilst actually doing the correct thing without bugs like race conditions is executed in the worst possible style - I'm thinking multiple nested sequences and loops with sub-vis and wires that sit on top of each, wires that run right to left, daft connector pane patterns, the full works. * The most obfuscated solution - again, a solution that actually works and is bug free, this time written in technically good stlye, but with hardest to follow and least obvious algorithm. I'm thinking about solutions that will score a nice big zero mark but do actually work. Or am I just too evil Or go for a more long term solution. Develop some hidden code and insert it into the solution (which can follow the above methods as well, if so desired ). This hidden code will display a popup window stating "If grading my homework, give me an 'F' please." However, this popup will only show up if the VI is modified by the teacher in a specified way. This could be easily done using VI Tags, for instance. The hard part would be getting the VI to do the modifying to the professors using LabVIEW, but it would be really cool nonetheless. Quote Link to comment
Yair Posted November 3, 2007 Report Share Posted November 3, 2007 QUOTE(Gavin Burnell @ Nov 2 2007, 12:30 AM) Perhaps simpler code challenges for when we get asked 'homework' type questions:* The most obfuscated solution - again, a solution that actually works and is bug free, this time written in technically good stlye, but with hardest to follow and least obvious algorithm. You mean like an http://forums.ni.com/ni/board/message?board.id=BreakPoint&message.id=5' target="_blank">obfuscated Hello World program? Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.