武侠java_如何把 Java 写出武侠的感觉

展开全部

//这是用面向对象的e68a843231313335323631343130323136353331333363373065思想写的古龙小说陆小凤传奇里的一小段

public class Droiyan {

public static void main(String[] args) {

Time t = new Time(9,15,"夜");

Heroes xi = new Heroes("西门吹雪");

Heroes ye = new Heroes("叶孤城");

xi.life = true;ye.life = true;

Sword xis = new Sword(3,7,"天下利器");

Sword yes = new Sword(4,6,"海外寒剑精英");

xi.sword = xis;

ye.sword = yes;

final String str1 = "是。",str2 = "";

t.showTime();

System.out.println("紫禁之巅。");

System.out.println("两个人都是白衣如雪,一尘不染,他们的人已经变得向他们的剑一样,冷酷锋利,已完全没有人的感情。");

System.out.println("两个人互相凝视着,眼睛里都在发光。");

System.out.println(" ——这种凌厉的剑气,本就是他们自己本身发出来的。");

System.out.println(" ——可怕的也是他们本身这个人,并不是他们手里的剑。");

ye.say("一别多年,别来无恙?","忽然");

xi.say("多蒙成全,侥幸安好。", str2);

ye.say("旧事何必重提,今日之战,你我必当各尽全力。", str2);

xi.say(str1, str2);

ye.say("很好。", str2);

System.out.println("他说话的声音本已显得中气不足,说了两句话后,竟似已在喘息。");

xi.say(xi.sword.decripe(), "却还是面无表情,视若不见,扬起手中剑,冷冷");

ye.say(ye.sword.decripe(), "也扬起手中剑,");

System.out.println("两人的剑虽已扬起,却仍未出鞘——拔剑的动作,也是剑法中不可缺少的一门,两人显然也要比个高下。");

}

}

class Time{

int month;

int day;

String time;

public Time(int month,int day,String time){

this.month = month;

this.day = day;

this.time = time;

}

public void showTime(){

System.out.println(month+"月"+day+","+time+"。");

}

}

class Heroes{

String name;

String nickname;

String appearance;

Sword sword;

Fencing fencing;

boolean life;

public Heroes(String name){

this.name = name;

}

public void say(String str,String str1){

System.out.println(name+str1+"说道:"+str);

}

}

class Sword{

String color;

String shape;

int weight;

int length;

String dec;

public Sword(int weight,int length,String dec){

this.weight = weight;

this.length = length;

this.dec = dec;

}

public String decripe(){

return("此剑乃"+dec+","+"剑锋"+length+"尺"+(length/2)+"寸"+","+"净重"+weight+"斤"+(weight+2)+"两。");

}

}

class Fencing{

String name;

}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值