Skip to content

Instantly share code, notes, and snippets.

@FateEvent
FateEvent / main.cpp
Created October 16, 2021 09:20
is_palindrome() is a function allowing to analyse whether a string is a palindrome (i.e. a word that reads the same backwards as forwards).
#include <iostream>
bool is_palindrome(std::string text);
int main() {
std::cout << is_palindrome("madam") << "\n";
std::cout << is_palindrome("Ada") << "\n";
std::cout << is_palindrome("lovelace") << "\n";
std::cout << is_palindrome("Anna") << "\n";
@FateEvent
FateEvent / leap_year.cpp
Last active October 16, 2021 09:16
Leap Years
// My rendering of a Codecademy project on C++
// The code determines if a 4-digit year is a leap year.
#include <iostream>
#include <string>
int countDigits(int num);
int main() {
@FateEvent
FateEvent / main.c
Last active October 11, 2021 23:03
initials_machine() prints the letters of your message. Written in collaboration with JohnDowland <https://github.com/JohnDowland>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
void initial_machine(char message[]);
int main()
{
char message[51] = {0};
@FateEvent
FateEvent / main.c
Last active October 2, 2021 17:17
La fonction number_to_string() devrait me rendre une string.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
const char* number_to_string(int number);
int main()
{
char* result = number_to_string(556);
@FateEvent
FateEvent / maximumTableau.c
Last active September 25, 2021 19:36
Une fonction don't la tache est de remettre à 0 toutes les cases d'un tableau ayant une valeur supérieure à un maximum. En C toujours.
#include <stdio.h>
#include <stdlib.h>
void maximumTableau(int tableau[], int tailleTableau, int valeurMax);
int main()
{
int tableau[4] = { 15, 81, 46, 45 }, i;
maximumTableau(tableau, 4, 45);
@FateEvent
FateEvent / copieTableau().c
Created September 25, 2021 19:23
Une opération de copie de tableaux en C (avec annexe initialisation parce que c'est cool).
#include <stdio.h>
#include <stdlib.h>
void copie(int tableauOriginal[], int tableauCopie[], int tailleTableau);
int main()
{
int tableau_1[2] = { 1, 2, 5 }, tableau_2[100] = { 0, 0, 0 }, i;
// Initialisation du tableau
@FateEvent
FateEvent / moyenneTableau().c
Last active September 25, 2021 08:46
Une opération de moyenne dans un tableau en C
#include <stdio.h>
#include <stdlib.h>
double moyenneTableau(int tableau[], int tailleTableau);
double main()
{
int tableau[4] = { 7, 7, 8, 1 };
printf("moyenne = %f\n", moyenneTableau(tableau, 4));
@FateEvent
FateEvent / ReadMe.md
Last active September 25, 2021 19:37
Plus ou Moins, A Number Guesser Game

Plus ou Moins, a project of number guesser game in C developed for an OpenClassrooms class.

A random number from 0 to 100 is generated by the machine (if the difficulty level is easy), and the player has to guess it, helped by the clues of the computer which tells if the suggested number is greater or smaller than the mysterious number.

My rendering of a Codecademy project with Python.

@FateEvent
FateEvent / ReadMe.md
Created September 11, 2021 20:56
A game of Rock, Paper, Scissors, Lizard, Spock developed with JavaScript

The part in JavaScript of a project of Rock, Paper, Scissors, Lizard, Spock developed on the basis of a Codecademy project.