Skip to content

Instantly share code, notes, and snippets.

View MartinsAlexandre's full-sized avatar

Martins Alexandre MartinsAlexandre

View GitHub Profile
@MartinsAlexandre
MartinsAlexandre / challenge.ts
Last active March 12, 2018 09:52
challenge typeScript 1
function hello(name : string) {
console.log("Hello " + name);
}
let firstName = "bob";
hello(firstName);
hello(firstName + " marley");
@MartinsAlexandre
MartinsAlexandre / noe.ts
Created March 12, 2018 17:05
TypeScript part2
class Animal {
}
class Chat extends Animal {
quatreP: boolean;
}
class Chien extends Animal {
quatreP: boolean;
}
const address = {
city: "Lyon",
state: "FR",
zip: 69001
};
const sportList = ['Football', 'BasketBall']
const ortherSportList = ['Boxe', 'Judo']
const address = {
city: "Lyon",
state: "FR",
zip: 69001
};
const sportList = ['Football', 'BasketBall']
const ortherSportList = ['Boxe', 'Judo']
class Monster {
constructor(options = {}){
this.health = 100;
this.name = options.name;
}
soigner () {
this.health = this.health + 10;
return this.health;
process.stdin.resume()
process.stdin.setEncoding('utf8')
console.log('What\'s your age ? ')
process.stdin.on('data', (number) => {
if (!isNaN(number) && number < 99) {
calcul(number);
}
function calcul(number) {
@MartinsAlexandre
MartinsAlexandre / cowsay
Last active April 17, 2018 15:36
quete node cowsay
var cowsay = require("cowsay");
console.log(cowsay.say({
text : "hello boy",
e : "oO",
T : "U "
}));
// or cowsay.think()