<!DOCTYPE html>
<html>
<head>
<title>トランプの練習</title>
<meta charset="UTF-8">
<link rel="stylesheet" href="https://storage.googleapis.com/code.getmdl.io/1.0.6/material.indigo-pink.min.css">
<script src="https://storage.googleapis.com/code.getmdl.io/1.0.6/material.min.js"></script>
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<script src="sample.js"></script>
<script src="jquery.js"></script>
<script src="svgpaint.js"></script>
<script src="app.js"></script>
</head>
<body onload="sample()">
<div class="mdl-layout mdl-js-layout mdl-layout--fixed-header">
<header class="mdl-layout__header">
<div class="mdl-layout__header-row">
<span class="mdl-layout-title">トランプの練習</span>
</div>
<div class="mdl-layout__tab-bar mdl-js-ripple-effect">
<a href="#s1" class="mdl-layout__tab is-active">メイン</a>
<a href="#s2" class="mdl-layout__tab">ルール</a>
</div>
</header>
<div class="mdl-layout__drawer">
<span class="mdl-layout-title">タイトル</span>
</div>
<main class="mdl-layout__content">
<section class="mdl-layout__tab-panel is-active" id="s1">
<div class="page-content">
<p id="memo"></p>
</div>
</section>
<section class="mdl-layout__tab-panel" id="s2">
<div class="page-content">練習</div>
</section>
</main>
<footer class="mdl-mini-footer">
<div class="mdl-mini-footer__left-section">
<div class="mdl-logo">トランプの練習</div>
<ul class="mdl-mini-footer__link-list">
<li><a href="http://osomatsusan.com/">コード</a></li>
<li><a href="http://osomatsusan.com/">ルール</a></li>
</ul>
</div>
</footer>
</div>
</body>
</html>
var x=new Array();
var y=new Array();
var imx=new Array();
var mark=new Array();
var num=new Array();
function sample(){
var sub=new trump();
sub.faststep();
num=sub.num;
mark=sub.mark;
imx=sub.imx;
str="";
for(s=1;s<6;s++){
n1=52*Math.random();
n2=Math.floor(n1)+1;
str=str+img(imx[n2]);
}
$("#memo").html(str);
}
function img(pp){
var str= "<img src=\""+pp+"\" width=100 height=100>";
return str;
}
class trump{
imx:String[]=new Array();
num:number[]=new Array();
mark:string[]=new Array();
faststep():void{
var s,sx,tx:number;
var n1,n2:string;
tx=0;
for(s=1;s<5;s++){
for(sx=1;sx<14;sx++){
n1=""+sx;
if(sx<10)n1="0"+sx;
n2="";
if(s==1)n2="h";
if(s==2)n2="d";
if(s==3)n2="c";
if(s==4)n2="s";
tx=tx+1;
this.num[tx]=sx;
this.mark[tx]=n2;
this.imx[tx]="http://javadsge.s17.xrea.com/card/"+n2+n1+".png\"";
}
}
}
}
最終更新:2016年11月18日 10:15