Score
0
Watch 25 Star 104 Fork 12

Gitee星球的小活动 / 第 0 届 代码编故事接力赛

Join us
Explore and code with more than 5 million developers,Free private repositories !:)
Sign up
This repository doesn't specify license. Without author's permission, this code is only for learning and cannot be used for other purposes.
让我们点燃程序员写作之魂,一人用代码写一段故事玩玩吧~ spread retract

Clone or download
js-小和尚和老师傅 2.28 KB
Copy Edit Web IDE Raw Blame History
谦哥 authored 2020-03-27 16:13 . 增加重要角色小尼姑
// 一个闲的淡疼的下午,小和尚和老师傅在寺庙里的谈话
class Temple {
little_monk:string;
old_monk:string;
date:string;
constructor(little_monk:string,old_monk:string,date:string) {
this.little_monk = little_monk
this.old_monk = old_monk
this.date = date
}
talk(){
let little_monk_say01 = `${this.little_monk}: 我可以念经的时候抽烟吗?`
let old_monk_say01 = `${this.old_monk}:不可以!大逆不道!!败寺玩意!!`
let little_monk_say02 = `${this.little_monk}: 我可以抽烟的的时候念经吗?`
let old_monk_say02 = `${this.little_monk}: 当然可以,么么哒!`
console.log(`在这个闲的淡疼的${this.date}...`)
console.log(little_monk_say01 + old_monk_say01)
console.log(little_monk_say02 + old_monk_say02)
}
yy(face){
let little_monk_say = `${this.little_monk}: 我可以念经的时候想她吗?`
if (face > 7.5) {
let old_monk_say = `${this.old_monk}:不可以!大逆不道!!败寺玩意!!`
} else {
let old_monk_say = `${this.old_monk}:你TM瞎啊!`
}
console.log(little_monk_say + old_monk_say)
}
}
const temple = new Temple('小和尚','老师傅','下午')
temple.talk()
const songs = ['思凡', '路边的野花', '两只老虎']
// 尼姑出场
class Nun {
constructor(ruName, face, song, skill) {
this.ruName = ruName // 乳名
this.face = face // 颜值
this.song = song // 歌曲
this.skill = skill // 技能
}
sing(){
let actions = ['扭着屁股', '一边笑一边挖鼻屎', '提着一篮苹果']
let action = actions[Math.floor(Math.random() * actions.length)]
console.log(`一天,${this.ruName}${action},唱着${song}经过寺庙`)
temple.yy(this.$face)
}
}
let song = songs[Math.floor(Math.random() * songs.length)]
let face = Math.floor(Math.random() * 10)
const nun = new Nun('王钢蛋', face, song, '')

Comment ( 0 )

Sign in for post a comment

1
https://gitee.com/Selected-Activities/Code-relay.git
git@gitee.com:Selected-Activities/Code-relay.git
Selected-Activities
Code-relay
第 0 届 代码编故事接力赛
master

Help Search

220309 7019f5b6 1899542 220318 4015cbb9 1899542