Matrix in CMD [Source][C++] - Printable Version +- Support Forums (https://www.supportforums.net) +-- Forum: Categories (https://www.supportforums.net/forumdisplay.php?fid=87) +--- Forum: Coding Support Forums (https://www.supportforums.net/forumdisplay.php?fid=18) +---- Forum: Programming with C++ (https://www.supportforums.net/forumdisplay.php?fid=20) +---- Thread: Matrix in CMD [Source][C++] (/showthread.php?tid=22187) |
Matrix in CMD [Source][C++] - devilishpsp - 09-15-2011 Thought I'd share this source with you guys, difficulty is... mediocre I guess, but it's very epic nonetheless . Code: #include <ctime> RE: Matrix in CMD [Source][C++] - RiXXoN - 09-15-2011 lol it's cool I guess, but there are way too many posts (not here necessarily but on HF OMG) about matrix programs. RE: Matrix in CMD [Source][C++] - devilishpsp - 09-15-2011 (09-15-2011, 04:59 AM)RiXXoN Wrote: lol it's cool I guess, but there are way too many posts (not here necessarily but on HF OMG) about matrix programs. There arn't over here, so I shared it here. There arn't "that" many posts on matrix programs =P, i've never seen any in my HF experience. =P RE: Matrix in CMD [Source][C++] - +Awesome - 09-20-2011 I made that when I was in 10th, So, yeah I know it. RE: Matrix in CMD [Source][C++] - AceInfinity - 09-20-2011 All you need to do is pipeline the output of %random% variables in batch and there you have it. RE: Matrix in CMD [Source][C++] - AceInfinity - 01-08-2012 Revisiting this with some new information to share now that I looked through this with more knowledge on C++. This post hopefully should help others too. 1) endl is bad as it uses more memory. I'd suggest using '\n' instead. 2) These lines are also pointless since they are never read:
3) You define going as a boolean value which is true, but it's never changed, so instead of doing that and creating a variable to store it in memory for no reason... That's completely pointless, just do this with the while loop
4) You already define checking as a bool which is true at the top in an outer scope
5) Why are you declaring this in the beginning of the loop, when it never comes back to this point and you redefine the variable anyways once the loop starts?
6) srand() isn't really needed here anyway really... One last thing, probably shouldn't use the namespace std. Try just declaring it explicitly when you need to use it. Example: Code: std::cout << "hello"; Here's a full revised code: Code: #include "stdafx.h" RE: Matrix in CMD [Source][C++] - AlbinoShadow - 01-10-2012 Thank you for this, I would rather use the memory efficient code though ^.^ Either way thank you for this release. RE: Matrix in CMD [Source][C++] - AceInfinity - 01-10-2012 (01-10-2012, 04:13 PM)AlbinoShadow Wrote: Thank you for this, I would rather use the memory efficient code though ^.^ Either way thank you for this release. What's bad about this one? It's not a very advanced application, you're only occupying a few bytes in memory with this anyway. |