Skip to content

Instantly share code, notes, and snippets.

View gomesalexandre's full-sized avatar

gomes gomesalexandre

View GitHub Profile
var Calculator = {
average: function() {
var sum=0;
var resultArr=Array.prototype.slice.call(arguments).map(function(x){sum+=x; return x;})
return resultArr == 0 ? 0 : sum/arguments.length ;
}
var Calculator = {
average: function() {
var result=Array.prototype.slice.call(arguments);
return result==0 ? 0 : result.reduce(function(a,b){return a+b})/result.length
}
};
function hailCaesar(encryptedString) {
encryptedString=encryptedString.split(' ').map(function(x){
x=x.split('').map(function(y){
if (y.match(/[a-z]/i)) {
var tocheck=y.charCodeAt(0)+13;
if(tocheck<=90 )
{y=String.fromCharCode(y.charCodeAt(0)+13) ;
}
String.prototype.isAudio= function(){
console.log(this);
return (/^[a-zA-Z]+.(mp3|al?ac|flac)$/).test(this);
};
String.prototype.isImg= function(){
return (/^[a-zA-Z]+.(jpe?g|png|bmp|gif)$/).test(this);
};
groups $FT_USER | tr ' ' ','
void ft_putnbr(int nb)
{
if (nb < 0)
{
putchar('-');
nb = -nb;
}
if (nb >= 10)
{
#include <stdio.h>
#include "functions.h"
void ft_putnbr(int nb)
{
if (nb < 0)
{
if (nb > -2147483648)
{
putchar('-');
#include <stdio.h>
int ft_putchar(char c);
void ft_print_comb2(void)
{
char arr[4] = {0, 0, 0, 1};
/* Tant que les deux premiers char ne sont pas tous deux 9, on boucle */
while (((arr[0]+arr[1]<18)))
void ft_ft(int *nbr){
*nbr=42;
}