罪と罰++二律背反


	sub cdata_open{
	open (IN,"$cdatfile") || &error("国データファイルが開けませんでした",1);
	@cdat = <IN>;
	@cn= split(/\s+/, $cdat[1]);#国力
	@cg= split(/\s+/, $cdat[2]);#財政
	@cf= split(/\s+/, $cdat[3]);#蓄米
	@cs= split(/\s+/, $cdat[4]);#予備兵
	@ce= split(/\s+/, $cdat[5]);#状態
	@c = split(/\s+/, $cdat[6]);#参加人数
	@ca= split(/\s+/, $cdat[7]);#定員
	%CP = '';
	my @prats = split(/,/,$cdat[0]);
	foreach $prats (@prats){
		my($k,$v) = split(/;/,$prats);
		$CP{$k} = $v;
	}
	(他の国データ)
	close(IN)    or die "Can't close   : $!";
	}
	sub cdat_write{
	$cdat =その他の国データ;
	open (OUT,">$cdatfile") || &error("open error:$cdatfile",1);
	print OUT $cdat;
	print OUT "@cn\n";#国力
	print OUT "@cg\n";
	print OUT "@cf\n";
	print OUT "@cs\n";
	print OUT "@ce\n";
	print OUT "@c\n";
	print OUT "@ca\n";
	close(OUT)	or die "Can't close   : $!";
	}
  • 	my @cn = (0,int(rand(40))*100+2500,int(rand(40))*100+2500,int(rand(40))*100+2500,int(rand(40))*100+2500,int(rand(40))*100+2500); # 国力
    	my @cg = (0,int(rand(50))*20+200,int(rand(50))*20+200,int(rand(50))*20+200,int(rand(50))*20+200,int(rand(50))*20+200); # 国家予算
    	my @cf = (0,int(rand(60))*100+2500,int(rand(60))*100+2500,int(rand(60))*100+2500,int(rand(60))*100+2500,int(rand(60))*100+2500); # 総兵糧
    	my @cs = (0,int(rand(60))*50+2000,int(rand(60))*50+2000,int(rand(60))*50+2000,int(rand(60))*50+2000,int(rand(60))*50+2000); # 総兵士数


トップ   編集 凍結 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2012-06-08 (金) 00:32:59 (2985d)