[Script] Magic Square

Locked
User avatar
! Manticore ♛
Membru
Membru
Posts: 1542
Joined: 8 years ago
Location: New York , SUA
Has thanked: 0
Been thanked: 0
Zodiac:
Age: 27
Status: Offline

7 years ago

Magic Square

Code: Select all

<title>Magic Square</title> 
<style type="text/css">
body,td,th {
    color: #000;
}
body {
    background-color: #FFF;
}
</style>
<body bgcolor="#CCCCCC"><P style="FONT-SIZE: 13px">
<STYLE type=text/css>.num {
    FONT-SIZE: 12px; WIDTH: 30px; COLOR: #000; FONT-FAMILY: verdana; TEXT-ALIGN: right
}
.symbols {
    FONT-SIZE: 30px; BACKGROUND: #000; COLOR: #f1f1f1; FONT-FAMILY: wingdings; TEXT-ALIGN: center
}
.viewsymbol {
    FONT-SIZE: 100px; BACKGROUND: #000; WIDTH: 150px; COLOR: #f1f1f1; FONT-FAMILY: wingdings; HEIGHT: 150px
}
</STYLE>

<SCRIPT language=javascript type=text/javascript>
<!--//
ax=0;

function viewtable() {
  ax=Math.round(Math.random()*26);
  alphaArray=new Array("a", "n", "b", "d", "f", "h", "{", "i", "l", "v", "x", "z", "I", "J", "M", "N", "o", "O", "R", "S", "T", "U", "m", "6", "^", "u", 

"_", "[", "]");
  table="<table align=\"center\" border=\"0\" cellspacing=\"5\" cellpadding=\"1\"><tr>";
  j=1;
  for ( i = 99 ; i >= 0 ; i-- ) {
     a=Math.round(Math.random()*26);
     if(i%9 == 0 &&  i < 89)
     a=ax;
     table+="<td class=\"num\">"+i+"</td><td class=\"symbols\">"+alphaArray[a]+"</td>";
     if(j%10 == 0) table+="</tr><tr>"; j++;
  } 
  table+="</table>";
  sym.innerHTML=table 
  sh.innerHTML=""
}

function show() {
  sh.innerHTML=alphaArray[ax]
  sym.innerHTML="<center>Here's what you have in mind. <a href=\"javascript:viewtable()\"><b>Repeat!</b></a></center>";
}
//-->
</SCRIPT>
 

<P style="FONT-SIZE: 13px">
<TABLE cellSpacing=0 width="100%" border=0>
  <TBODY>
  <TR>
    <TD vAlign=top bgcolor="#FFFFFF">
      <CENTER>
<H2>Magic Square - A.Tanase</H2>
<H2>&nbsp;</H2>
      </CENTER>
<DD> 1.&nbsp;Think of&nbsp;any&nbsp;two-digit number.<br>
        2.&nbsp;Subtract&nbsp;from it&nbsp;make up&nbsp;its&nbsp;numbers (for example, out of&nbsp;54&nbsp;we must subtract&nbsp;5 and 4, you 

get&nbsp;45).<br>
3.&nbsp;Find&nbsp;the number&nbsp;in the table&nbsp;and a symbol&nbsp;to which it corresponds.<br>
4.&nbsp;Imagine&nbsp;yourself&nbsp;mentally&nbsp;that character.<br>
5.&nbsp;Click on the&nbsp;square.
<TABLE style="CURSOR: hand" onclick=show() cellSpacing=10 align=center 
      border=0>
        <TBODY>
        <TR>
          <TD class=viewsymbol id=sh 
      align=middle>&nbsp;</TD></TR></TBODY></TABLE></TD></TR>
  <TR>
<TD height=300 vAlign=top bgcolor="#F0F0F0" id=sym></TD></TR></TBODY></TABLE>
<SCRIPT language=javascript type=text/javascript>
<!--//
  viewtable();
//-->
</SCRIPT>
Image Image

Image

© ! Manticore ♛

"Many things that seems threatening in the dark,become more welcoming when we shine a light on them."
"Maybe for the world you are just a person,but for a person you are the entire world."
"Nothing is impossible,the word itself says <<I'm Possible>>."
"If the pain will ever speak,then my pain will scream."
''The fastest way to happiness is to avoid the reality."

Image
Locked

Return to “Script-uri”