C - SDL (Simple Directmedia Layer) - Creating a rectangle and moving it

We are going to see, with this tutorial, how to create a shape on a window and how to move it with keyboard arrows.

We need, for this example, three files that we are going to create to dispatch the code:

UNIX & GNU/Linux - System calls - Using semget()

Today a tutorial to learn how to use semget(), semctl() and semop() system calls.

C - Library functions - Using srand() and rand()

Today a tiny tutorial to see how using srand() and rand() from the libc.

We will generate a number in a range between 0 and 2.
For that, we will use the functions:

Eclipse - Errors - While coding

This section will gather all errors found when you were coding in Eclipse.
It is really hard sometimes to find what is the problem when you get an exception.

I will also give a solution of the problem.

C - Errors - Handling errors

In this tutorial we will how to easily manage errors in C programming language.

That is we will try to open a file and if this file doesn't exist we will trigger an error.
If the file exists, we will tell its name with a message to say that the file really exist.

OCaml - List - Iterating through a list and displaying all elements inside

As you already saw it, creating a list in OCaml is not so difficult.
But this time, we will see how to iterate through a list and display all elements inside.

We will create two arrays, one of ints, the other of strings.
Once done, we will display their elements.
Let's see it with this OCaml list tutorial.  

OCaml - List - Creating a list

As all programming languages, it is possible to create lists in OCaml.

So, let's see this, right now with new examples.
We will indeed create two functions, one of ints and another of strings.

For the ints:

OCaml - Function - Creating a getter to retrieve an element of a tuple

OK, this is not really a getter implementation like we can have it in other object-oriented programming, but it is close of it.

We have first to create an human variable with a tuple ("name", age).
Then we have to create two getter functions to retrieve the first and the second parameter of this human variable.

OCaml - Function - Using recursion

OCaml is a fully recursive language. So using recursion is completely natural.
We will see in this example how to create an easy recursion of a classic factorial. This in two different manners.
These two ways of using recursion are strictely the same, the type of the function and the result as well of course.

OCaml - Function - Creating an easy function

In this tutorial we will see how to create a function in OCaml language.
It will be an easy function to understand how it works.

We will create a function that returns an int + 1.
Here the code:

Pages

Subscribe to BadproG.com RSS