class 古代麻雀 {
    constructor(飜,符) {
        this.飜 = 飜;
        this.符 = 符;
    }
}
class 中国麻雀 extends 古代麻雀 {
    constructor(飜,符) {
        super(飜,符);
    } 
    ko_kasean(){
        if(飜 > 7){
            return (this.飜*this.符*3);
        }else{
            return null
        }
        
    }
    oya_kasean(){
        if(飜 > 7){
            return (this.飜*this.符*4);
        }else{
            return null
        }
    }
}
class 日本麻雀 extends 古代麻雀 {
    constructor(飜,符) {
        super(飜,符);
    } 
    ko_kasean(){
        return (2**(this.飜+2)*this.符*4);
    }
    oya_kasean(){
        return (2**(this.飜+2)*this.符*6);
    }
}
const mydog = new 中国麻雀(10,4);
console.log(mydog.oya_kasean());

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: