Total Pageviews

Monday, 15 April 2013

themes-scr















θεματικές στο εργαστήριο
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------



speaking lanquages-  

Root Zone Database

The Root Zone Database represents the delegation details of top-level domains, including gTLDs such as.com, and country-code TLDs such as .uk. As the manager of the DNS root zone, IANA is responsible for coordinating these delegations in accordance with its policies and procedures.
Much of this data is also available via the WHOIS protocol at whois.iana.org.
DomainTypeSponsoring Organisation
.accountry-codeNetwork Information Center (AC Domain Registry) c/o Cable and Wireless (Ascension Island)
.adcountry-codeAndorra Telecom
.aecountry-codeTelecommunication Regulatory Authority (TRA)
.aerosponsoredSociete Internationale de Telecommunications Aeronautique (SITA INC USA)
.afcountry-codeMinistry of Communications and IT
.agcountry-codeUHSA School of Medicine
.aicountry-codeGovernment of Anguilla
.alcountry-codeElectronic and Postal Communications Authority - AKEP
.amcountry-codeInternet Society
.ancountry-codeUniversity of The Netherlands Antilles
.aocountry-codeFaculdade de Engenharia da Universidade Agostinho Neto
.aqcountry-codeMott and Associates
.arcountry-codePresidencia de la Nación – Secretaría Legal y Técnica
.arpainfrastructureInternet Assigned Numbers Authority
.ascountry-codeAS Domain Registry
.asiasponsoredDotAsia Organisation Ltd.
.atcountry-codenic.at GmbH
.aucountry-code.au Domain Administration (auDA)
.awcountry-codeSETAR
.axcountry-codeÅlands landskapsregering
.azcountry-codeIntraNS
.bacountry-codeUniverstiy Telinformatic Centre (UTIC)
.bbcountry-codeGovernment of Barbados Ministry of Economic Affairs and Development Telecommunications Unit
.bdcountry-codeMinistry of Post & Telecommunications Bangladesh Secretariat
.becountry-codeDNS BE vzw/asbl
.bfcountry-codeARCE-AutoritÈ de RÈgulation des Communications Electroniques
.bgcountry-codeRegister.BG
.bhcountry-codeTelecommunications Regulatory Authority (TRA)
.bicountry-codeCentre National de l'Informatique
.bizgeneric-restrictedNeuStar, Inc.
.bjcountry-codeBenin Telecoms S.A.
.blcountry-codeNot assigned
.bmcountry-codeRegistry General Ministry of Labour and Immigration
.bncountry-codeTelekom Brunei Berhad
.bocountry-codeAgencia para el Desarrollo de la Información de la Sociedad en Bolivia
.bqcountry-codeNot assigned
.brcountry-codeComite Gestor da Internet no Brasil
.bscountry-codeThe College of the Bahamas
.btcountry-codeMinistry of Information and Communications
.bvcountry-codeUNINETT Norid A/S
.bwcountry-codeUniversity of Botswana
.bycountry-codeReliable Software Inc.
.bzcountry-codeUniversity of Belize
.cacountry-codeCanadian Internet Registration Authority (CIRA) Autorite Canadienne pour les Enregistrements Internet (ACEI)
.catsponsoredFundacio puntCAT
.cccountry-codeeNIC Cocos (Keeling) Islands Pty. Ltd. d/b/a Island Internet Services
.cdcountry-codeOffice Congolais des Postes et Télécommunications - OCPT
.cfcountry-codeSociete Centrafricaine de Telecommunications (SOCATEL)
.cgcountry-codeONPT Congo and Interpoint Switzerland
.chcountry-codeSWITCH The Swiss Education & Research Network
.cicountry-codeINP-HB Institut National Polytechnique Felix Houphouet Boigny
.ckcountry-codeTelecom Cook Islands Ltd.
.clcountry-codeNIC Chile (University of Chile)
.cmcountry-codeCameroon Telecommunications (CAMTEL)
.cncountry-codeComputer Network Information Center, Chinese Academy of Sciences
.cocountry-code.CO Internet S.A.S.
.comgenericVeriSign Global Registry Services
.coopsponsoredDotCooperation LLC
.crcountry-codeNational Academy of Sciences Academia Nacional de Ciencias
.cucountry-codeCENIAInternet Industria y San Jose Capitolio Nacional
.cvcountry-codeAgência Nacional das Comunicações (ANAC)
.cwcountry-codeUniversity of the Netherlands Antilles
.cxcountry-codeChristmas Island Internet Administration Limited
.cycountry-codeUniversity of Cyprus
.czcountry-codeCZ.NIC, z.s.p.o
.decountry-codeDENIC eG
.djcountry-codeDjibouti Telecom S.A
.dkcountry-codeDansk Internet Forum
.dmcountry-codeDotDM Corporation
.docountry-codePontificia Universidad Catolica Madre y Maestra Recinto Santo Tomas de Aquino
.dzcountry-codeCERIST
.eccountry-codeNIC.EC (NICEC) S.A.
.edusponsoredEDUCAUSE
.eecountry-codeNational Institute of Chemical Physics and Biophysics
.egcountry-codeEgyptian Universities Network (EUN) Supreme Council of Universities
.ehcountry-codeNot assigned
.ercountry-codeEritrea Telecommunication Services Corporation (EriTel)
.escountry-codeRed.es
.etcountry-codeEthio telecom
.eucountry-codeEURid vzw/asbl
.ficountry-codeFinnish Communications Regulatory Authority
.fjcountry-codeThe University of the South Pacific IT Services
.fkcountry-codeFalkland Islands Government
.fmcountry-codeFSM Telecommunications Corporation
.focountry-codeFO Council
.frcountry-codeAFNIC (NIC France) - Immeuble International
.gacountry-codeGabon Telecom
.gbcountry-codeReserved Domain - IANA
.gdcountry-codeThe National Telecommunications Regulatory Commission (NTRC)
.gecountry-codeCaucasus Online
.gfcountry-codeNet Plus
.ggcountry-codeIsland Networks Ltd.
.ghcountry-codeNetwork Computer Systems Limited
.gicountry-codeSapphire Networks
.glcountry-codeTELE Greenland A/S
.gmcountry-codeGM-NIC
.gncountry-codeCentre National des Sciences Halieutiques de Boussoura
.govsponsoredGeneral Services Administration Attn: QTDC, 2E08 (.gov Domain Registration)
.gpcountry-codeNetworking Technologies Group
.gqcountry-codeGETESA
.grcountry-codeICS-FORTH GR
.gscountry-codeGovernment of South Georgia and South Sandwich Islands (GSGSSI)
.gtcountry-codeUniversidad del Valle de Guatemala
.gucountry-codeUniversity of Guam Computer Center
.gwcountry-codeFundação IT & MEDIA Universidade de Bissao
.gycountry-codeUniversity of Guyana
.hkcountry-codeHong Kong Internet Registration Corporation Ltd.
.hmcountry-codeHM Domain Registry
.hncountry-codeRed de Desarrollo Sostenible Honduras
.hrcountry-codeCARNet - Croatian Academic and Research Network
.htcountry-codeConsortium FDS/RDDH
.hucountry-codeCouncil of Hungarian Internet Providers (CHIP)
.idcountry-codeIDNIC-PPAU Mikroelektronika
.iecountry-codeUniversity College Dublin Computing Services Computer Centre
.ilcountry-codeInternet Society of Israel
.imcountry-codeIsle of Man Government
.incountry-codeNational Internet Exchange of India
.infogenericAfilias Limited
.intsponsoredInternet Assigned Numbers Authority
.iocountry-codeIO Top Level Domain Registry Cable and Wireless
.iqcountry-codeCommunications and Media Commission (CMC)
.ircountry-codeInstitute for Research in Fundamental Sciences
.iscountry-codeISNIC - Internet Iceland ltd.
.itcountry-codeIIT - CNR
.jecountry-codeIsland Networks (Jersey) Ltd.
.jmcountry-codeUniversity of West Indies
.jocountry-codeNational Information Technology Center (NITC)
.jobssponsoredEmploy Media LLC
.jpcountry-codeJapan Registry Services Co., Ltd.
.kecountry-codeKenya Network Information Center (KeNIC)
.kgcountry-codeAsiaInfo Telecommunication Enterprise
.khcountry-codeMinistry of Post and Telecommunications
.kicountry-codeMinistry of Communications, Transport, and Tourism Development
.kmcountry-codeComores Telecom
.kncountry-codeMinistry of Finance, Sustainable Development Information & Technology
.kpcountry-codeStar Joint Venture Company
.krcountry-codeKorea Internet & Security Agency (KISA)
.kwcountry-codeMinistry of Communications
.kycountry-codeThe Information and Communications Technology Authority
.kzcountry-codeAssociation of IT Companies of Kazakhstan
.lacountry-codeLao National Internet Committee (LANIC), Ministry of Posts and Telecommunications
.lbcountry-codeAmerican University of Beirut Computing and Networking Services
.lccountry-codeUniversity of Puerto Rico
.licountry-codeUniversitaet Liechtenstein
.lkcountry-codeCouncil for Information Technology LK Domain Registrar
.lrcountry-codeData Technology Solutions, Inc.
.lscountry-codeNational University of Lesotho
.ltcountry-codeKaunas University of Technology Information Technology Development Institute
.lucountry-codeRESTENA
.lvcountry-codeUniversity of Latvia Institute of Mathematics and Computer Science Department of Network Solutions (DNS)
.lycountry-codeGeneral Post and Telecommunication Company
.macountry-codeAgence Nationale de Réglementation des Télécommunications (ANRT)
.mccountry-codeGouvernement de Monaco Direction des Communications Electroniques
.mdcountry-codeMoldData S.E.
.mecountry-codeGovernment of Montenegro
.mfcountry-codeNot assigned
.mgcountry-codeNIC-MG (Network Information Center Madagascar)
.mhcountry-codeCabinet Office
.milsponsoredDoD Network Information Center
.mkcountry-codeMinistry of Foreign Affairs
.mlcountry-codeAgence des Technologies de l’Information et de la Communication
.mmcountry-codeMinistry of Communications, Posts & Telegraphs
.mncountry-codeDatacom Co., Ltd.
.mocountry-codeBureau of Telecommunications Regulation (DSRT)
.mobisponsoredAfilias Technologies Limited dba dotMobi
.mpcountry-codeSaipan Datacom, Inc.
.mqcountry-codeMEDIASERV
.mrcountry-codeUniversity of Nouakchott
.mscountry-codeMNI Networks Ltd.
.mtcountry-codeNIC (Malta)
.mucountry-codeInternet Direct Ltd
.museumsponsoredMuseum Domain Management Association
.mvcountry-codeDhiraagu Pvt. Ltd. (DHIVEHINET)
.mwcountry-codeMalawi Sustainable Development Network Programme (Malawi SDNP)
.mxcountry-codeNIC-Mexico ITESM - Campus Monterrey
.mycountry-codeMYNIC Berhad
.mzcountry-codeCentro de Informatica de Universidade Eduardo Mondlane
.nacountry-codeNamibian Network Information Center
.namegeneric-restrictedVeriSign Information Services, Inc.
.nccountry-codeOffice des Postes et Telecommunications
.necountry-codeSONITEL
.netgenericVeriSign Global Registry Services
.nfcountry-codeNorfolk Island Data Services
.ngcountry-codeNigeria Internet Registration Association
.nicountry-codeUniversidad Nacional del Ingernieria Centro de Computo
.nlcountry-codeSIDN (Stichting Internet Domeinregistratie Nederland)
.nocountry-codeUNINETT Norid A/S
.npcountry-codeMercantile Communications Pvt. Ltd.
.nrcountry-codeCENPAC NET
.nucountry-codeThe IUSN Foundation
.nzcountry-codeInternetNZ
.omcountry-codeTelecommunications Regulatory Authority (TRA)
.orggenericPublic Interest Registry (PIR)
.pacountry-codeUniversidad Tecnologica de Panama
.pecountry-codeRed Cientifica Peruana
.pfcountry-codeGouvernement de la Polynésie française
.pgcountry-codePNG DNS Administration Vice Chancellors Office The Papua New Guinea University of Technology
.phcountry-codePH Domain Foundation
.pkcountry-codePKNIC
.plcountry-codeResearch and Academic Computer Network
.pmcountry-codeAFNIC (NIC France) - Immeuble International
.pncountry-codePitcairn Island Administration
.postsponsoredUniversal Postal Union
.prcountry-codeGauss Research Laboratory Inc.
.progeneric-restrictedRegistry Services Corporation dba RegistryPro
.pscountry-codeMinistry Of Telecommunications & Information Technology, Government Computer Center.
.ptcountry-codeFundação para a Computação Científica Nacional
.pwcountry-codeMicronesia Investment and Development Corporation
.pycountry-codeNIC-PY
.qacountry-codeThe Supreme Council of Information and Communication Technology (ictQATAR)
.recountry-codeAFNIC (NIC France) - Immeuble International
.rocountry-codeNational Institute for R&D in Informatics
.rscountry-codeSerbian National Register of Internet Domain Names (RNIDS)
.rucountry-codeCoordination Center for TLD RU
.rwcountry-codeRwanda Information Communication and Technology Association (RICTA)
.sacountry-codeCommunications and Information Technology Commission
.sbcountry-codeSolomon Telekom Company Limited
.sccountry-codeVCS Pty Ltd
.sdcountry-codeSudan Internet Society
.secountry-codeThe Internet Infrastructure Foundation
.sgcountry-codeSingapore Network Information Centre (SGNIC) Pte Ltd
.shcountry-codeGovernment of St. Helena
.sicountry-codeAcademic and Research Network of Slovenia (ARNES)
.sjcountry-codeUNINETT Norid A/S
.skcountry-codeSK-NIC, a.s.
.slcountry-codeSierratel
.smcountry-codeTelecom Italia San Marino S.p.A.
.sncountry-codeUniversite Cheikh Anta Diop NIC Senegal
.socountry-codeMinistry of Post and Telecommunications
.srcountry-codeTelesur
.sscountry-codeNot assigned
.stcountry-codeTecnisys
.sucountry-codeRussian Institute for Development of Public Networks (ROSNIIROS)
.svcountry-codeSVNet
.sxcountry-codeSX Registry SA B.V.
.sycountry-codeNational Agency for Network Services (NANS)
.szcountry-codeUniversity of Swaziland Department of Computer Science
.tccountry-codeMelrex TC
.tdcountry-codeSociété des télécommunications du Tchad (SOTEL TCHAD)
.telsponsoredTelnic Ltd.
.tfcountry-codeAFNIC (NIC France) - Immeuble International
.tgcountry-codeCafe Informatique et Telecommunications
.thcountry-codeThai Network Information Center Foundation
.tjcountry-codeInformation Technology Center
.tkcountry-codeTelecommunication Tokelau Corporation (Teletok)
.tlcountry-codeMinistry of Infrastructure Information and Technology Division
.tmcountry-codeTM Domain Registry Ltd
.tncountry-codeAgence Tunisienne d'Internet
.tocountry-codeGovernment of the Kingdom of Tonga H.R.H. Crown Prince Tupouto'a c/o Consulate of Tonga
.tpcountry-code-
.trcountry-codeMiddle East Technical University Department of Computer Engineering
.travelsponsoredTralliance Registry Management Company, LLC.
.ttcountry-codeUniversity of the West Indies Faculty of Engineering
.tvcountry-codeMinistry of Finance and Tourism
.twcountry-codeTaiwan Network Information Center (TWNIC)
.tzcountry-codeTanzania Network Information Centre (tzNIC)
.uacountry-codeCommunication Systems Ltd
.ugcountry-codeUganda Online Ltd.
.ukcountry-codeNominet UK
.umcountry-codeNot assigned
.uscountry-codeNeuStar, Inc.
.uycountry-codeSeCIU - Universidad de la Republica
.uzcountry-codeComputerization and Information Technologies Developing Center UZINFOCOM
.vacountry-codeHoly See Secretariat of State Department of Telecommunications
.vccountry-codeMinistry of Telecommunications, Science, Technology and Industry
.vecountry-codeComisión Nacional de Telecomunicaciones (CONATEL)
.vgcountry-codePinebrook Developments Ltd
.vicountry-codeVirgin Islands Public Telcommunications System c/o COBEX Internet Services
.vncountry-codeMinistry of Information and Communications of Socialist Republic of Viet Nam
.vucountry-codeTelecom Vanuatu Limited
.wfcountry-codeAFNIC (NIC France) - Immeuble International
.wscountry-codeGovernment of Samoa Ministry of Foreign Affairs & Trade
.测试testInternet Assigned Numbers Authority
.परीक्षाtestInternet Assigned Numbers Authority
.한국country-codeKISA (Korea Internet & Security Agency)
.ভারতcountry-codeNational Internet Exchange of India
.বাংলাcountry-codeNot assigned
.испытаниеtestInternet Assigned Numbers Authority
.қазcountry-codeAssociation of IT Companies of Kazakhstan
.србcountry-codeSerbian National Register of Internet Domain Names (RNIDS)
.테스트testInternet Assigned Numbers Authority
.சிங்கப்பூர்country-codeSingapore Network Information Centre (SGNIC) Pte Ltd
.טעסטtestInternet Assigned Numbers Authority
.中国country-codeChina Internet Network Information Center
.中國country-codeChina Internet Network Information Center
.భారత్country-codeNational Internet Exchange of India
.ලංකාcountry-codeLK Domain Registry
.測試testInternet Assigned Numbers Authority
.ભારતcountry-codeNational Internet Exchange of India
.भारतcountry-codeNational Internet Exchange of India
.آزمایشیtestInternet Assigned Numbers Authority
.பரிட்சைtestInternet Assigned Numbers Authority
.укрcountry-codeUkrainian Network Information Centre (UANIC), Inc.
.香港country-codeHong Kong Internet Registration Corporation Ltd.
.δοκιμήtestInternet Assigned Numbers Authority
.إختبارtestInternet Assigned Numbers Authority
.台湾country-codeTaiwan Network Information Center (TWNIC)
.台灣country-codeTaiwan Network Information Center (TWNIC)
.монcountry-codeNot assigned
.الجزائرcountry-codeCERIST
.عمانcountry-codeTelecommunications Regulatory Authority (TRA)
.ایرانcountry-codeNot assigned
.اماراتcountry-codeTelecommunications Regulatory Authority (TRA)
.پاکستانcountry-codeNot assigned
.الاردنcountry-codeNational Information Technology Center (NITC)
.بھارتcountry-codeNational Internet Exchange of India
.المغربcountry-codeAgence Nationale de Réglementation des Télécommunications (ANRT)
.السعوديةcountry-codeCommunications and Information Technology Commission
.سودانcountry-codeNot assigned
.مليسياcountry-codeMYNIC Berhad
.გეcountry-codeNot assigned
.ไทยcountry-codeThai Network Information Center Foundation
.سوريةcountry-codeNational Agency for Network Services (NANS)
.рфcountry-codeCoordination Center for TLD RU
.تونسcountry-codeAgence Tunisienne d'Internet
.ਭਾਰਤcountry-codeNational Internet Exchange of India
.مصرcountry-codeNational Telecommunication Regulatory Authority - NTRA
.قطرcountry-codeSupreme Council for Communications and Information Technology (ictQATAR)
.இலங்கைcountry-codeLK Domain Registry
.இந்தியாcountry-codeNational Internet Exchange of India
.新加坡country-codeSingapore Network Information Centre (SGNIC) Pte Ltd
.فلسطينcountry-codeMinistry of Telecom & Information Technology (MTIT)
.テストtestInternet Assigned Numbers Authority
.xxxsponsoredICM Registry LLC
.yecountry-codeTeleYemen
.ytcountry-codeAFNIC (NIC France) - Immeuble International
.zacountry-codeZA Domain Name Authority
.zmcountry-codeZAMNET Communication Systems Ltd.
.zwcountry-codePostal and Telecommunications Regulatory Authority of Zimbabwe (POTRAZ)




from wiki


List of programming languages

From Wikipedia, the free encyclopedia
The aim of this list of programming languages is to include all notable programming languages in existence, both those in current use and historical ones, in alphabetical order, except for dialects of BASIC and esoteric programming languages.
Note: Dialects of BASIC have been moved to the separate List of BASIC dialects.
Note: This page does not list esoteric programming languages.

[edit]A

[edit]B

[edit]C

[edit]D

  • D
  • DASL (Datapoint's Advanced Systems Language)
  • DASL (Distributed Application Specification Language)
  • Dart
  • DataFlex

[edit]E

[edit]F

[edit]G

[edit]H

[edit]I

[edit]J

[edit]K

[edit]L

[edit]M

[edit]N

[edit]O

[edit]P

[edit]Q

[edit]R

[edit]S

[edit]T

[edit]U

[edit]V


[edit]W

[edit]X

[edit]Y

[edit]Z






































JAVA SCRIPT(pro HTML SYNTAX)
web page external -conect with server-js examples provided on line
notes for lessons
(web page developer.moz.)
l01
java script is an object oriented language that is dynamic.
syntax related to C and Java
js does nt have classes - instead object prototypes

java script;s types are

A.numbers

- a js object -allowing numerical values- number object -Number() constructor
new Number(value)
the following example uses the Number object's properties to assign values to several numeric variables:
var biggestNum = Number.MAX_VALUE;
var smallestNum = Number.MIN_VALUE;
var infiniteNum = Number.POSITIVE_INFINITY;
var negInfiniteNum = Number.NEGATIVE_INFINITY;
var notANum = Number.NaN;



The following example converts the Date object to a numerical value using Number as a function:


var d = new Date("December 17, 1995 03:24:00");

print(Number(d));// print


This displays "819199440000".

*





MAX_VALUE
The largest positive representable number.  The largest negative representable number is -MAX_VALUE.
MIN_VALUE
The smallest positive representable number -- that is, the positive number closest to zero (without actually being zero).  The smallest negative representable number is -MIN_VALUE.
NaN
Special "not a number" value.
NEGATIVE_INFINITY
Special value representing negative infinity; returned on overflow.
POSITIVE_INFINITY
Special value representing infinity; returned on overflow.
prototype
Allows the addition of properties to a Number object.

strings

charAt method

1.

 return 'cat'.charAt(1)://returns "a"
return 'cat"[1]:// returns"a"



c-strcmp()fuctin *
var a= "a";
var b = "b" ;
if (a<b)
print (a+"is less than" +b);
else if (a>b)
print (a +"is greater than " +b);
else 
print (a + "and"+b+"are equal.");



string objects-string values

var s_prim=- "foo":
var s_obj = new String (s_prim);
console.log(typeof s_prim); // logs string
console.log(typeof s_obj);// Logs 'objects'









s1 = "2 + 2";               // creates a string primitive
s2 = new String("2 + 2");   // creates a String object
console.log(eval(s1));      // returns the number 4
console.log(eval(s2));      // returns the string "2 + 2"

valueOf method-convert a string object to its primitive counterpart
console.log(eval(s2.value)f())); // returns the number 4


properties of string instances ---methods ---methods of string instances

String generic methods

Generics are also available on Array methods.
var num = 15;
alert(String.replace(num, /5/, '2'));



/*globals define*/
// Assumes all supplied String instance methods already present (one may use shims for these if not available)
(function () {
    'use strict';
    var i,
        // We could also build the array of methods with the following, but the
        //   getOwnPropertyNames() method is non-shimable:
        // Object.getOwnPropertyNames(String).filter(function (methodName) {return typeof String[methodName] === 'function'});
        methods = [
            'quote', 'substring', 'toLowerCase', 'toUpperCase', 'charAt',
            'charCodeAt', 'indexOf', 'lastIndexOf', 'startsWith', 'endsWith',
            'trim', 'trimLeft', 'trimRight', 'toLocaleLowerCase',
            'toLocaleUpperCase', 'localeCompare', 'match', 'search',
            'replace', 'split', 'substr', 'concat', 'slice', 'fromCharCode'
        ],
        methodCount = methods.length,
        assignStringGeneric = function (methodName) {
            var method = String.prototype[methodName];
            String[methodName] = function (arg1) {
                return method.apply(arg1, Array.prototype.slice.call(arguments, 1));
            };
        };
    for (i = 0; i < methodCount; i++) {
        assignStringGeneric(methods[i]);
    }
}());



string instances-methods- non-native methods







3booleans




4fuctions




objects


number 



string



boolean



object





















example of a bounce game
analyze the code and underline the following 
fuctions
variables
objects







ex    game page

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<head>
<title>uowm2013-1lesson-javascript lanqauge code</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>

<body>

<div id="game">
<div id="square0"></div>
<div id="square1"></div>
<div id="notepad"></div>
<div id="pad"></div>
</div>

<script type="text/javascript">



<!-- This game runs best inside an iframe -->// explanations about i frme -examples 14years old Nyegen Phong, 

-change the gameHeight and gameWidth variables
-change the height and width attributes
 iframe.game class, in the style of the index page

<!-- gameHeight and gameWidth must be divisible by 40 evenly. -->
//asigning variables
var gameHeight = 320
var gameWidth = 360

var intervalOne,intervalTwo,timeoutOne,x
var angle = 2
var tempX = 0
var tempY = 0
var block = 1
var square = 0
var squareTop = 0
var squareLeft = 0
var squareMotion = 1
var speed = 80
var getPad = 0
var nextScore = 0
var score = 0
var count = 0
var collisionOne = 0
var collisionTwo = 0
var collisionThree = 0


document.body.style.margin = "0px"
document.body.style.padding = "0px"

function setupGame()                                                                                     // about fuctions, doc., pad L.T,R,...
{
document.getElementById("game").style.borderRight = "1px solid #aaa"
document.getElementById("game").style.borderRight = "1px solid #aaa"
document.getElementById("game").style.borderBottom = "1px solid #aaa"
document.getElementById("game").style.width = gameWidth+"px"
document.getElementById("game").style.height = gameHeight+"px"
document.getElementById("square0").style.position = "absolute"
document.getElementById("square0").style.width = "40px"
document.getElementById("square0").style.height = "40px"
document.getElementById("square0").style.backgroundColor = "#444"
document.getElementById("square0").style.display = "none"
document.getElementById("square1").style.position = "absolute"
document.getElementById("square1").style.width = "40px"
document.getElementById("square1").style.height = "40px"
document.getElementById("square1").style.backgroundColor = "#444"
document.getElementById("square1").style.display = "none"
document.getElementById("pad").style.position = "absolute"
document.getElementById("pad").style.width = "60px"
document.getElementById("pad").style.height = "30px"
document.getElementById("pad").style.paddingTop = "10px"
document.getElementById("pad").style.textAlign = "center"
document.getElementById("pad").style.font = "15px Verdana, sans-serif"
document.getElementById("pad").style.backgroundColor = "#000"
document.getElementById("pad").style.color = "#fff"
document.getElementById("pad").innerHTML = "<a id=\"play\" href=\"javascript:newGame()\">PLAY</a>"
document.getElementById("play").style.color = "#fff"
document.getElementById("play").style.textDecoration = "none"

padTop = Math.floor(gameHeight/2)-20
padLeft = Math.floor(gameWidth/2)-30

document.getElementById("pad").style.top = padTop+"px"
document.getElementById("pad").style.left = padLeft+"px"

document.getElementById("notepad").innerHTML = "BounceGame"
document.getElementById("notepad").style.padding = "10px"
document.getElementById("notepad").style.textAlign = "center"
document.getElementById("notepad").style.font = "2.0em Georgia, serif"
document.getElementById("notepad").style.fontWeight = "normal"
document.getElementById("notepad").style.color = "#222"

timeoutOne = setTimeout("intervalTwo = setInterval('demoGame()', speed)", 4000)
}

function demoGame()
{
angle = 2
clearTimeout(timeoutOne)
document.getElementById("square0").style.display = "block"
document.getElementById("square1").style.display = "block"

if(square == 0)
{
x = document.getElementById("square0")
square = 1
}
else
{
x = document.getElementById("square1")
square = 0
}

bounceGame()
}

function newGame()
{
block = 0
angle = 2
tempX = 0
tempY = 0
square = 0
squareTop = 0
squareLeft = 0
squareMotion = 1
nextScore = 0
score = 0
count = 0
collisionOne = 0
collisionTwo = 0
collisionThree = 0

clearTimeout(timeoutOne)
clearInterval(intervalOne)
clearInterval(intervalTwo)
document.getElementById("square0").style.left = "0px"
document.getElementById("square0").style.top = "0px"
document.getElementById("square0").style.display = "block"
document.getElementById("square1").style.left = "0px"
document.getElementById("square1").style.top = "0px"
document.getElementById("square1").style.display = "block"
document.getElementById("pad").style.top = (gameHeight-40)+"px"
document.getElementById("pad").innerHTML = ""
document.getElementById("notepad").innerHTML = ""

intervalOne = setInterval("playGame()", speed) 
}

function playGame()
{
if(block)
{
return
}

if(square == 0)
{
x = document.getElementById("square0")
square = 1
}
else
{
x = document.getElementById("square1")
square = 0
}

bounceGame()
checkCollision()
}

function assignM(aM)
{
squareMotion = aM
}

function bounceGame()
{
if(squareMotion==1)

if(squareTop>=(gameHeight-40) && squareLeft>=(gameWidth-40))
{
assignM(3)
moveDR(-40)
}

if(squareTop>=(gameHeight-40)) 

assignM(2)
moveDL(-40)

else if(squareLeft>=(gameWidth-40))
{
assignM(4)
moveDL(40)
}
else {
moveDR(40)
}
}
else if(squareMotion==2)
{
if(squareTop<=0 && squareLeft>=(gameWidth-40))
{
assignM(4)
moveDL(40)
}

if(squareLeft>=(gameWidth-40))
{
assignM(3)
moveDR(-40)

else if(squareTop<=0)
{
assignM(1)
moveDR(40)
}
else
{
moveDL(-40)
}
}
else if(squareMotion==3)
{
if(squareTop<=0 && squareLeft<=0)
{
assignM(1)
moveDR(40)
}

if(squareTop<=0)
{
assignM(4)
moveDL(40)

else if(squareLeft<=0)
{
assignM(2)
moveDL(-40)
}
else
{
moveDR(-40)
}
}
else if(squareMotion==4)
{
if(squareTop>=(gameHeight-40) && squareLeft<=0)
{
assignM(2)
moveDL(-40)
}

if(squareLeft<=0)
{
assignM(1)
moveDR(40)

else if(squareTop>=(gameHeight-40))
{
assignM(3)
moveDR(-40)
}
else
{
moveDL(40)
}
}
}

function moveDR(amount)

save = amount
amount = Math.floor(amount/angle)

if(angle == 0)
{
amount = 0
}

squareLeft += amount 
x.style.left = squareLeft+"px"
squareTop += save 
x.style.top = squareTop+"px"
}

function moveDL(amount)
{
save = amount
amount = Math.floor(amount/angle)

if(angle == 0)
{
amount = 0
}

squareLeft -= amount 
x.style.left = squareLeft+"px"
squareTop += save 
x.style.top = squareTop+"px"
}

function assignAngle(aa)
{
if(aa==1)
{
angle = 0
nextScore = 1000
}
if(aa==2)
{
angle = 2
nextScore = 100
}

score += nextScore

document.getElementById("pad").innerHTML = nextScore
}

function flashScore()
{
if(score > 0)
{
if(nextScore == "BounceGame")
{
nextScore = score
}
else
{
nextScore = "BounceGame"
}

document.getElementById("notepad").innerHTML = nextScore
}
else
{
document.getElementById("notepad").innerHTML = "BounceGame"
}
}

function countUp()
{
if(count < (Math.floor(score/10)*8))
{
count += Math.floor(score/10)
}
else if(count >= (Math.floor(score/10)*8) && count <= (Math.floor(score/10)*9))
{
if((Math.floor(score/10)*9) > 200)
{
count += Math.floor(score/10)
}
else
{
count += 10
}
}
else
{
if(Math.floor(score/10) > 30)
{
count += 10
}
else
{
count += 1
}
}

if(count > score)
{
count = score
clearInterval(intervalOne)
intervalOne = setInterval("flashScore()", 2000) 
}

document.getElementById("notepad").innerHTML = count
}

function checkCollision()
{
var actualLeft = getPad-30

if(squareTop == 0)
{
document.getElementById("pad").innerHTML = ""
}

if((squareTop+40)==(gameHeight-40))
{
difference = Math.floor(squareLeft-actualLeft)

if(difference>=(-39)&&difference<4)
{
collisionOne++
collisionTwo = 0
collisionThree = 0

if(collisionOne > 3)
{
assignM(Math.floor(Math.random() * 2) + 2)
}
else
{
assignM(3)
}

assignAngle(2)
}
else if(difference>=5&&difference<15)
{
collisionOne = 0
collisionTwo++
collisionThree = 0

if(collisionTwo > 3)
{
assignM(Math.floor(Math.random() * 2) + 2)
assignAngle(2)
}
else
{
assignM(3)
assignAngle(1)
}
}
else if(difference>=15&&difference<59)
{
collisionOne = 0
collisionTwo = 0
collisionThree++

if(collisionThree > 3)
{
assignM(Math.floor(Math.random() * 2) + 2)                                      // examples by math creativity-flash creativity paul-
}
else
{
assignM(2)
}

assignAngle(2)
}
}
else if((squareTop+40)==gameHeight)
{
block = 1
clearInterval(intervalOne)
setupGame()
intervalOne = setInterval("countUp()", speed) 
}
}

function getMouseXY(e)
{
if(navigator.appName=="Netscape")
{  
tempX = e.pageX
tempY = e.pageY
}  
else

tempX = event.clientX + document.body.scrollLeft
tempY = event.clientY + document.body.scrollTop
}

if(tempX < 0)
{
tempX = 0


getPad = tempX

if(getPad <= 30)
{
getPad = 30
}

if((getPad-30) > Math.floor(gameWidth-60))
{
getPad = Math.floor(gameWidth-60)+30
}

if(!block)
{
document.getElementById("pad").style.left = (getPad-30)+"px"
}

}

document.onmousemove = getMouseXY

setupGame()

</script>


</body>
</html>



No comments:

Post a Comment