Skip to content
View esponjosin's full-sized avatar
😋
Drinking a coffee
😋
Drinking a coffee

Block or report esponjosin

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Maximum 250 characters. Please don't include any personal information such as legal names or email addresses. Markdown supported. This note will be visible to only you.
Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse
esponjosin/README.md

Details

My Code:

import * as fs from 'fs';

import { Voice, Person, StyleCode, Postures, Posture } from './structures/Esponjosin';

import { FastFood } from './24Hours';
import { Food } from './supermarket';

export default class Esponjosin extends Person {

    private realname: string
    private internetname: string
    private age: number
    private sleeping: boolean

    constructor(realname: string, internetname: string, age: number) {
        
        this._realname = realname;
        this._internetname = internetname;
        this._age = age;
        this._sleeping = false;

    }

    public async Speak(text: string): Voice {
        return new Voice(text);
    }

    public async sleep(atHour: number): void {

        const isWeekend: boolean = ([0,6].indexOf(new Date().getDay()) != -1);

        if(this.isTimeToSleep(atHour, !isWeekend) && !this.sleeping) {

            this.sleeping = true;

            setTimeout(function () {
                this.sleepig = false;
                this.Speak('Good Morning!');
            }, 7200000)

        }

    }

    public async normalEat(food: Food): Voice {
        
        var belly: Food[] = [];
        
        belly.push(food);
        
        return this.Speak('Tabemono o arigatō');

    }

    public async fastEat(food: FastFood): Voice {
        
        var belly: FastFood[] = [];
        
        belly.push(food);
        
        return this.Speak('It was delicious!');

    }

    public async party(): boolean {

        if(this.sleeping) return false;

        const isWeekend: boolean = ([0,6].indexOf(new Date().getDay()) != -1);

        if(isWeekend && this.friendsNear.length > 5 && this.location == 'disco') {
            return this.startDance(Postures.random());
        }

    }

    private isTimeToSleep(atHour: number, atMorning: boolean): boolean {

        let argTime: string = new Date().toLocaleString("en-US", { timeZone: 'America/Argentina/Cordoba' });

        let hour: string = argTime.split(' ')[1].split(':')[0];

        let isMorning: boolean = argTime.includes('AM');

        return atMorning ? isMorning ? hour == atHour : false : !atMorning && !isMorning && hour == atHour;

    }

    private async code(inFile: string): string {
        
        let code = new StyleCode();

        fs.writeFileSync(inFile, code);
        
        return code;

    }

    public async die(atAge: number): void {
        console.log(`Esponjosin has died at ${atAge} years old`)
        return process.exit(0)
    }

}

Pinned Loading

  1. Prometeo Prometeo Public

    Prometeo is a versatile download manager library for Node.js that enables efficient parallel downloading of files, making it a valuable tool for tasks like batch downloading large sets of files. It…

    TypeScript 2 1