Only Java to a sufficient degree of faith.
Also: Python, Visual Basic, PHP, SQL, QBasic (first language I knew, great it was too), MIPS, NetLogo, BBC BASIC, some C, enough C#.
Printable View
Only Java to a sufficient degree of faith.
Also: Python, Visual Basic, PHP, SQL, QBasic (first language I knew, great it was too), MIPS, NetLogo, BBC BASIC, some C, enough C#.
Because your compiler is not an ANSI C compilerQuote:
Lol how come ive compiled it and it works then?
[/b]
Good point. I'm used to Python in which there is no real ternary (although you can fake it and Python 2.5 introduced a pseudo-ternary operator iirc).
M-Cat, for your prime number checker, you could always compute an array of prime numbers up to the given integer and check to see if the array contains the integer. While this might not yield the best performance, it would test your ability to implement algorithms in C/C++. Here's an example of the sieve of Eratosthenes (an inefficient but easy-to-understand algorithm for computing a list of primes) in Python:
I once implemented that algorithm in Python. Then I tried to port it to C++ and was astonished how much more code had to be written. Python is amazingly productive.Code:def primes(n):
****A, B = range(2, n+1), []
****while A:
********B.append(A[0])
********A = [x for x in A if x % B[-1] != 0]
****return B
That's the name.Quote:
sieve of Eratosthenes[/b]
Indeed it is. :bigteeth: The Sieve of Atkin yields faster performance, but it is a little more complicated and I didn't feel like explaining it. I'm sure there's a Wikipedia article detailing it.
Edit: As much as I wanted to avoid chiming in, I feel compelled to do so. M-Cat, Kaniaz spent a half hour to an hour trying to teach you how not to code, and you are refusing to listen to him. You're the one who needs to learn the language. By the way, the language in question is C++ and not C. ANSI C doesn't have iostream nor does it have the STL. Oh and I hate to say this, but although Kaniaz's advice is correct, M-Cat's original code does compile somehow in GCC (g++), which is the de facto standard compiler. Go figure.
Eh, I'm confuzzled.
I can do very basic stuff with HTML...pretty much just make a link like this:
<a href=www.dreamviews.com>This</a>
But then again, I've picked up basically everything I know by fixing my friends' broken myspace codes. XD
Dude, respect++.
And in fact, even that is wrong ;) You always have to include http:// with <a> tags, or it will link to a directory named www.dreamviews.com. Let's say we're on a page named Link.html, in http://www.oursite.com/Content/Menu/Link.html, and we insert your code, we'd link to http://www.oursite.com/Content/Menu/wwww.dreamviews.com :) If we add http, we actually link to Dreamviews.
Should we re-name this to the programming language war thread? XD
Nah, it simply derailed, but it's back.. Sorta.
The ones that I know really well are PHP, QBasic, Lua. I'm learning C and LISP.
(I know XHTML and CSS too...)
I have used DrPython for a while now and really like it! Comes in Windows and Linux versions. It has clean displays and a minimum of quirks (does not like foreign characters). There are lots of configuration options. The results are displayed in an output window, and you can select and copy items from there. You can also install the code completion plugin from the internet from within the DrPython.
I have used HapDebugger, Boa, PyScripter, IDLE and PythonWin, I've even used SPE for quite a while. No, it's not the "Society of Petroleum Engineers", but "Stani's Python Editor". For some odd reason it has vanished on the net. I always come back to DrPython. I also use a more general editor/IDE called ConText. That one allows me to run C code and Python code in parallel.
Aiite, so when I was in fourth grade I used this scripting language called, uhm, frog? I don't remember, but it was used to control a little something. A frog I think. Anyway, my teacher CALLED it a programming language. Can I add that to my list? Probably not.
C, C++, Visual C++ (ew)
Visual Basic, QBasic, and Basic - Oh my!
Python, Perl, PHP - All with MySQL happiness.
Keep in mind I haven't really programmed since my junior year in college (3 years ago) so there's a good chance that I'm really bad at most of these now. We determined that last night ;)