Programming, anyone?

<p>I would recommend starting off with Python. It’s really easy to learn but its logic is similar to C and C++ (and just about every other programming language). There’s a nice, short online tutorial on their website. :)</p>

<p>You’ll want something that teaches good programming habits though. It’s easy to learn the code without learning proper spacing or commenting.</p>

<p>C++


</p>

<h1>include<iostream></iostream></h1>

<p>using namespace std;</p>

<p>int main(int argc, char* argv[])
{
    cout<<"Hello World";
    return 0;
}


Python



print "Hello World"


</p>

<p>Hence C++ > Python</p>

<p>


#include<iostream>
using namespace std;</iostream></p>

<p>int main()
{
    cout << "Damn Straight";
    return 0;
}

</p>

<p>



cout<<"Java is stupid";
System.Console.WriteLine("Java is stupid");
printf("Java is stupid");
PRINT "Java is stupid"
print "Java is stupid"
Document.Write("Java is stupid");
echo "Java is stupid";


C++
Java
C which propagates to C++
Fortran or Basic, both are notorious for cap keywords
Perl/Python
Javascript within a browser (raw js does not implicitly initialize the document variable)
PHP/Shell</p>

<p>God I feel so accomplished :P</p>

<p>

</p>

<p>


</p>

<h1>include "Python.h"</h1>

<h1>include "re.h"</h1>

<h1>include "st.h"</h1>

<h1>include <string.h></string.h></h1>

<p>/*
gcc pyinpy.c -I"include" -I"PYTHONDEV" -L"libs" -lpython26 -opyinpy.pyd -w -shared
*/</p>

<p>PyObject* py2py(char* code)
{
    int ev = 1;</p>

<pre><code>PyObject* m = PyImport_AddModule("__main__");
PyObject* d = PyModule_GetDict(m);

PyCodeObject* c = Py_CompileString(code, "code.py",Py_eval_input);
if (!c){
  PyErr_Clear();
  ev = 0;
}
PyObject* eval = PyRun_String(code, ev ? Py_eval_input:Py_single_input, d, d);
if (!eval){
  PyErr_Print();
  PyErr_Clear();
  return Py_None;
}

return eval;
</code></pre>

<p>}</p>

<p>static PyObject *
py<em>evalpy(PyObject *self, PyObject *args)
{
    char *code;
    if (!PyArg</em>ParseTuple(args, "s", &code))
        return NULL;
    return py2py(code);
}</p>

<p>static PyMethodDef pyinpy<em>methods[] = {
    {"py", py</em>evalpy, METH_VARARGS, "Executes and Evaluates a given piece of Python code."},
    {NULL, NULL}
};</p>

<p>PyMODINIT<em>FUNC
initpyinpy(void)
{
    //Py</em>Initialize();
    py2py("import re");
    py2py("def pyprint(t): 
	print t
");
    (void)Py<em>InitModule("pyinpy", pyinpy</em>methods);
}</p>

<p>//import pyinpy
//pyinpy.py("pyinpy.py('print \"Hello World\"')")


</p>

<p>And, here’s a lib I recently wrote that allows you to evaluate and manipulate Ruby objects in python
[gist:</a> 391115 - GitHub](<a href=“http://gist.github.com/391115]gist:”>RubyInPython.c · GitHub)</p>

<p>Hence Python > C++ >= Ruby (:P)</p>

<p>^^Oh, so close to being perfect. Java would be System.out.println().</p>

<p>oops, I got blinded by the first namespace xD</p>

<p>most languages that is implemented via the .Net runtime (C#,VB.NET,IronPython, etc)</p>

<p>failboat.isEpicWin = true;</p>

<p>oh god a programming war</p>

<p>I just wrote a little tic-tac-toe game in Python. :D</p>

<p>



Game = True
players = {"1":"X", "2":"O"}
cells = [1,2,3,4,5,6,7,8,9]</p>

<p>def init():
    print("
", cells[0], cells[1], cells[2], "
", cells[3], cells[4], cells[5], "
", cells[6], cells[7], cells[8])</p>

<p>def end():
    playagain = input("Do you want to play again (type 'yes' or 'no')? ")
    if "y" in playagain:
        cells = [1,2,3,4,5,6,7,8,9]
        init()
    if "n" in playagain:
        Game == False
        exit()
    elif playagain != "yes" or "no":
        print("Please type 'yes' or 'no'.")
        end()</p>

<p>n, turn = "1", "1"
i = 2</p>

<p>init()
while Game == True:
    print("
Player " + str(turn) + "'s turn!
")
    place = input()
    temp = int(place)
    if temp in cells:
        cells[temp-1] = players[n]
    elif cells[temp-1] == "X" or "O":
        print("That square has already been taken!")
        i -= 1
    #check if player has won
    if cells[0] == cells[3] == cells[6] or cells[1] == cells[4] == cells[7] or cells[2] == cells[5] == cells[8] or cells[0] == cells[1] == cells[2] or cells[3] == cells[4] == cells[5] or cells[6] == cells[7] == cells[8] or cells[0] == cells[4] == cells[8] or cells [2] == cells[4] == cells[6]:
        init()
        print("
Player " +str(turn) + " has won!
")
        end()
    i+=1
    if i%2 == 0:
        n = "1"
        turn = "1"
    elif i%2 != 0:
        n = "2"
        turn = "2"
    init()


</p>

<p>I’m aware that it’s messy and that a lot of things could have been done more efficiently, but I’ll work on that later. Also, after the game ends, pressing “yes” doesn’t work. :(</p>

<p>public static void getReal()
{
System.out.println(“Java is the best”);
System.out.print(“Haters need to stop hating”);
}</p>

<p>^


class YouForgotThis
{
    public static void youFail()
    {
        System.out.println("And so does Java");
    }
    public static void Main(String[] args)
    {
        youFail();
    }
}

I’m sorry, it had to be done.</p>

<p>Rohiht, I’d recommend watching Stanford’s Programming Methodology classes on youtube, you can get the assignments and everything that’s what I’ve been doing and I’ve loved it!</p>

<p>class IDontCare
{</p>

<pre><code> public static void ThanksForCaring()
{
System.out.println(“If you’re using it, it must not suck.”);
}

public static void main(String args)
{
ThanksForCaring();
}
</code></pre>

<p>}</p>

<p>^Indentation, man, learn it! Learn it!</p>

<p>[noparse]Although it’s probably just the lack of




[/nopare]</p>

<p>print “I am learning Python! I haven’t gotten very far, though…”</p>

<p>MK Ultra programming</p>

<p>stef1a, I had to make a tic tac toe program this past year in school, except it was in java.</p>

<p>^ Same for me. My Adv Computer Math Class(Equivalent to AP Comp Sci but we don’t take the AP exam), that was our end of year program. I spent so much time on it, then did all the others.</p>