Kaynağa Gözat

rmFew files

Ponomarenko.Oleg 6 yıl önce
ebeveyn
işleme
01412d78e9
10 değiştirilmiş dosya ile 0 ekleme ve 1305 silme
  1. 0 109
      chat.html
  2. 0 59
      examp1.md
  3. BIN
      fonts.css
  4. 0 160
      form.html
  5. 0 37
      lesson1.md
  6. 0 155
      new.html
  7. 0 680
      new.js
  8. 0 82
      new.php
  9. 0 0
      new2.js
  10. 0 23
      style.css

+ 0 - 109
chat.html

@@ -1,109 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
-	<meta charset="UTF-8">
-	<meta name="viewport" content="width=device-width, initial-scale=1">
-	<link rel="stylesheet" href="style.css">
-	<title>Table for JS</title>
-</head>
-<body>
-        
-
-    <input type="nick" id = "nick" placeholder="Nick">
-    <input type="text" id = "message" placeholder="Message">
-    <input type="submit" value="send" id = "button">
-    <div id= "chat" style="padding-top:30px; padding-left: 20px; margin-top:40px; ">  </div>
-  
-        
-
-<script>
-var nick=document.getElementById('nick')
-var message=document.getElementById('message')
-var button=document.getElementById('button')
-var chat=document.getElementById('chat')
-
-button.onclick=function(elem){
-    function jsonPost(url, data)
-    {
-        return new Promise((resolve, reject) => {
-            var x = new XMLHttpRequest();   
-            x.onerror = () => reject(new Error('jsonPost failed'))
-            //x.setRequestHeader('Content-Type', 'application/json');
-            x.open("POST", url, true);
-            x.send(JSON.stringify(data))
-
-            x.onreadystatechange = () => {
-                if (x.readyState == XMLHttpRequest.DONE && x.status == 200){
-                    resolve(JSON.parse(x.responseText))
-                }
-                else if (x.status != 200){
-                    reject(new Error('status is not 200'))
-                }
-            }
-        })
-    }
-    jsonPost("http://students.a-level.com.ua:10012", {
-      func:"addMessage",
-      nick:nick.value,
-      message:message.value,
-    })
-
-
-
-    var mess = function(){
-    var messages = {};
-    messages = jsonPost("http://students.a-level.com.ua:10012", {
-        func: "getMessages",
-        messageid: messages.length
-    }).then(a => {
-        console.log(a)
-        for (q = 0; q < a.data.length; q++) {
-            var y = document.getElementById("chat")
-            var ссс = document.createElement("p")
-            
-            ссс.innerHTML = a.data[q].nick + "----" + a.data[q].message
-            ссс.style.backgroundColor = "blue";
-            y.appendChild(ссс)
-            
-
-        }
-    var qqq = a.nextMessageId
-        console.log(qqq + "a111")
-        console.log(a.data.length)
-        setInterval(function() {
-            var messages = jsonPost("http://students.a-level.com.ua:10012", {
-                func: "getMessages",
-                messageid: qqq
-            }).then(www => {
-                for (q = a.data.length; q < www.data.length; q++) {
-                    var y = document.getElementById("chat")
-                    var ссс = document.createElement("p")
-                    ссс.innerHTML = www.data[q].nick + "----" + www.data[q].message
-                    y.appendChild(ссс)
-
-                }
-                qqq = www.nextMessageId
-                console.log(qqq + "a222")
-                console.log(www.data.length)
-            })
-
-
-        }, 2000);
-    })
-}
-mess()
-}
-
-
-
- 
- 
-
-</script>
-	
-	<script src="main.js"></script>
-	
-	</script>
-</body>
-</html>
-

+ 0 - 59
examp1.md

@@ -1,59 +0,0 @@
-##
-```javascript
-
-}
-```
-
-["0", 5, 3, "string", null].reduce((a,b) =>(console.log(a,b), +a*(+b)))
-присвоить 1 если NAN
-
-var key ="age";
-//(var key="name")
-var persons = [
-    {name: "Иван", age: 17},
-    {name: "Мария", age: 35},
-    {name: "Алексей", age: 73},
-    {name: "Яков", age: 12},
-]
-persons.sort(function(a,b){ //сортируем по возрасту
-    if (a[key] > b[key]){
-        return 1;
-    }
-    return -1;
-});
-persons.sort((a,b) => a.name > b.name ? 1 : -1)
-
-
-var total = ["0", 5, 3, "string", null].reduce(function(a, b) {
-	var number = parseInt(a);
-  return isNaN(number)? number : a;
-  return number + b;
-});
-// total == 6
-
-var arr = ["0", 5, 3, "string", null]
-var result = arr.reduce(function(previousValue, currentValue, index, array) {
-	var number = currentValue;
-  	isNaN(number)? null : currentValue;
-  return previousValue * currentValue;
-});
-
-alert( result ); // 15
-
-var animals = ["0", 5, 3, "string", null];
-var total = animals.reduce(function(sum, item) {
-	var number = 0;
-  	isNaN(number)? item : null;
-  return sum * number;
-}, 0);
-console.log(total);
-
-
-for(let i=5; i>0; i--){
-setTimeout(() => console.log(5-i), 1000*i)
-}
-
-for(i=5; i>0; i--){
-(function(j)
-setTimeout(() => console.log(5-i), 1000*i)
-}(i)

BIN
fonts.css


+ 0 - 160
form.html

@@ -1,160 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
-    <meta charset="UTF-8">
-    <meta name="viewport" content="width=device-width, initial-scale=1.0">
-    <meta http-equiv="X-UA-Compatible" content="ie=edge">
-    <title>Document</title>
-</head>
-<body>
-    
-    <div id="form"></div>
-    <script>
-    //    function Form(container, config){
-    //        var inputs={};
-
-    //     var buttonOk =document.createElement('BUTTON');
-    //     buttonOk.innerText = 'OK'
-
-    //     var buttonCancel =document.createElement('BUTTON');
-    //     buttonCancel.innerText = 'Cancel'
-
-    //     buttonCancel.onclick = function(){
-    //         for(let inputId in config){
-    //             let inputConfig = config[inputId];
-    //             inputs[inputId].value = inputConfig.value;
-    //         }
-    //     }
-        
-    //     for(let inputId in config){
-    //         let inputConfig = config[inputId];
-    //         let input = document.createElement('INPUT');
-    //         input.placeholder = inputConfig.title;
-    //         input.title = inputConfig.title;
-    //         input.value = inputConfig.value;
-    //         input.type = inputConfig.type;
-    //         container.appendChild(input)
-    //         container.appendChild(document.createElement('BR'))
-    //         inputs[inputId] = input
-    //        }
-    //        container.appendChild(buttonOk);
-    //        container.appendChild(buttonCancel);
-    //    } 
-    //    new Form(form, {
-    //     login: {
-    //        title: 'Login',
-    //        value:'12',
-    //        type:'password'
-    //        },
-    //     password:{
-    //         title: 'Password',
-    //        value:'',
-    //        type:'password'
-    //     }
-
-
-    //    }) (http://form.asmer.fe.a-level.com.ua/)
-
-       function Form(container, config){
-    var inputs       = {};
-
-    var buttonOk     = document.createElement('BUTTON');
-    buttonOk.innerText = 'OK'
-
-    buttonOk.onclick = () => {
-        var values = {};
-        var success = true;
-        for (let inputId in inputs){
-            values[inputId] = inputs[inputId].value;
-        }
-
-        for (let inputId in config){
-            let inputConfig = config[inputId];
-            if (inputConfig.validator){
-                if (inputConfig.validator(values)){
-                    inputs[inputId].style.backgroundColor = '';
-                }
-                else {
-                    success = false;
-                    inputs[inputId].style.backgroundColor = 'red';
-                }
-            }
-        }
-
-        if (success && this.onOk){
-            this.onOk(values);
-        }
-
-
-        //console.log(values);
-    }
-
-    var buttonCancel = document.createElement('BUTTON');
-    buttonCancel.innerText = 'Cancel';
-
-    buttonCancel.onclick = () => {
-        if (this.onCancel){
-            this.onCancel();
-        }
-
-        for (let inputId in config){
-            let inputConfig = config[inputId];
-            inputs[inputId].value = inputConfig.value;
-        }
-    }
-
-
-
-    for (let inputId in config){
-        let inputConfig = config[inputId];
-
-        let input = document.createElement('INPUT');
-        input.placeholder = inputConfig.title;
-        input.title       = inputConfig.title;
-        input.value       = inputConfig.value;
-        input.type        = inputConfig.type;
-
-        container.appendChild(input)
-        container.appendChild(document.createElement('BR'))
-
-        inputs[inputId]   = input
-    }
-
-    container.appendChild(buttonOk)
-    container.appendChild(buttonCancel)
-
-    this.onOk     = null;
-    this.onCancel = null;
-
-    this.destroy  = function(){
-        container.innerHTML = '';
-    }
-}
-
-var formObj = new Form(form,{login: {title: 'Login',
-                        value: 'user@example.com',
-                        type: 'email',
-                        validator: values => values.login.length > 5},
-               password1: {title: 'Password 1',
-                        value: '',
-                        type: 'password',
-                        validator: values => (values.password1 == values.password2) && values.password1},
-               password2: {title: 'Password 2',
-                        value: '',
-                        type: 'password',
-                        validator: values => (values.password1 == values.password2) && values.password1},
-               })
-
-formObj.onCancel = function(){
-    alert('Canceeeeeeeel');
-}
-
-
-formObj.onOk = function(data){
-    console.log(data);
-    formObj.destroy();
-}
-
-    </script>
-</body>
-</html>

+ 0 - 37
lesson1.md

@@ -1,37 +0,0 @@
-Math.floor(Math.random()*3)
- var name=['paper', 'stone', 'scissors',];
- name[Math.floor(Math.random()*3)];
- var name=['paper', 'stone', 'scissors', 'colod'];
- name[Math.floor(Math.random()*name.length)];
- 
- var myIndex=Math.floor(Math.random()*name.length)
- var userWord=prompt();
- var userIndex=name.Indexof(userWord);
- var iWin=(((userIndex+1)%name.length)==userIndex);
- var draw=myIndex==userIndex;
- 
-
-//Обменка в обьектах
-
-rates={
-	usd: {
-        buy:26.15,
-        sell:26.51
-    },
-    eur: {
-        buy:31.98,
-        sell:32.62
-    },
-};
-{usd: {…}, eur: {…}}
-rates[prompt()]
-
-rates[prompt()][confirm('sell') ? 'sell' : 'buy']*(+prompt())
-
-
-
-function add(a,b)
-{
-    return a + b; 
-}
-alert(add(3,4))

+ 0 - 155
new.html

@@ -1,155 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
-	<meta charset="UTF-8">
-	<meta name="viewport" content="width=device-width, initial-scale=1">
-	<link rel="stylesheet" href="style.css">
-	<title>Table for JS</title>
-</head>
-<body>
-        
-
-        <select name="" id="country"></select>
-        <select name="" id="city"></select>
-        <!-- <select name="" id="weather"></select>
-        <select name="" id="temperature"></select> -->
-        <div id="weather" style="padding-top:30px; padding-left: 20px; margin-top:40px; background-color:yellow; width:250px;"></div>
-
-<script>
-    var request = new XMLHttpRequest() 
-
-request.open('GET', 'https://raw.githubusercontent.com/David-Haim/CountriesToCitiesJSON/master/countriesToCities.json', true) // последний параметр указывает на синхронность или асинхронность запроса. В данном случае запрос асинхронный
-
-
-request.onreadystatechange = function(){ //обработчик изменения статуса запроса. Статус == 4 сигнализирует о том, что запрос окончен.
-    if (request.readyState != 4){
-        return;
-    }
-
-    var mass = JSON.parse(request.responseText);
-        console.log(mass)
-
-    var country=document.getElementById('country')
-    var city=document.getElementById('city')
-    var weather=document.getElementById('weather')
-    var weather=document.getElementById('temperature')
-
-    if (request.status == 200){
-        alert('all ok')
-    
-       
-        for(key in mass){
-            var option = document.createElement('option')
-            option.innerText = key;
-            country.appendChild(option);
-            
-        }
-        
-
-        country.onchange = function(){
-            city.innerText ='';
-
-            for(i=0; i<mass[country.value].length; i++){
-            var option2 = document.createElement('option');
-            option2.innerText = mass[country.value][i];
-            city.appendChild(option2);
-            console.log(country.value); 
-
-        city.onchange = function(){
-            var reqW = "select * from weather.forecast where woeid in (select woeid from geo.places(1) where text='" + city.value +"') and u='c'"
-            var requestW = new XMLHttpRequest();
-            requestW.open('GET', "https://query.yahooapis.com/v1/public/yql?" + "q=" + encodeURIComponent(reqW) + "&format=json", true);
-            requestW.onreadystatechange = function(){
-                if(requestW.readyState !=4){
-                    return;
-                }
-                if(requestW.status == 200){
-                    alert('all ok2')
-                    var weatherCity = JSON.parse(requestW.responseText);
-                    console.log(weatherCity);
-
-                    // let weatherCity = JSON.parse(response),
-                var weatherParam=document.getElementById('weather');
-                dayWeather = weatherCity.query.results.channel.item.forecast;
-                var day = " ";
-                console.log(weatherCity.query.results.channel.item.condition.text)
-                for(i = 0; i < dayWeather.length; i++){
-                    day += "<b>"+ dayWeather[i].day +" "+ dayWeather[i].date +"</b></br>" 
-                        + "Temperature from " + dayWeather[i].low + " to " + dayWeather[i].high + "</br></br>";                
-                } 
-                weatherParam.style.border="2px solid red"
-                weatherParam.innerHTML ="восход " +  weatherCity.query.results.channel.astronomy.sunrise
-                                    + "; закат " + weatherCity.query.results.channel.astronomy.sunset+ "</br></br>"
-                                    + day;
-
-
-                // for(key in forecast){
-                //     var option3 = document.createElement('option')
-                //     option3.innerHTML = query[results];
-                //     weather.appendChild(option3);
-                //     console.log(weather.value)
-            
-                // }
-                // weather.onchange = function(){
-                //     temperature.innerText = '';
-
-                //     for(i=0; i<forecast[weather.value].length; i++){
-                //         var option4 = document.createElement('option'); 
-                    
-                //         option4.innerHTML = forecast[weather.value][i];
-                //         temperature.appendChild(option4);
-                //         }
-                //     }
-                }   
-                else {
-                    alert('shit happens: ' +  requestW.status + ', ' + requestW.statusText );
-                }
-            }
-            requestW.send();
-        }
-    }
-          
-            
-        }
-    }
-  else {
-        alert('shit happens: ' +  request.status + ', ' + request.statusText );
-    }
-}
-
-request.send() 
-
-
-</script>
-	
-	<script src="main.js"></script>
-	
-	</script>
-</body>
-</html>
-
-
-<!-- https://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20weather.forecast%20where%20woeid%20in%20(select%20woeid%20from%20geo.places(1)%20where%20text%3D%22kharkiv%22)%20and%20u%3D'c'&format=json&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys -->
-
-<!-- https://query.yahooapis.com/v1/public/yql?" + "q=" + encodeURIComponent(reqW) + "&format=json -->
-
-<!-- <input id="f" type="submit" onclick="myFunc()" value='0'>
-        <input id="d" type="submit" onclick="myFunc()" value='0'> -->
-
-
-<!-- // function myFunc() {
-    // var elem = document.getElementById('f');
-    // var x = parseInt(elem.value, 10);
-    // elem.value = x + 1;
-        
-    // }
-
-//     function clickCounter(elem){
-//         var a=0;
-//         elem.onclick=function(){
-//             a++
-//             elem.innerText=a
-//         }
-//     }
-//     clickCounter(document.getElementById('f')) 
-// clickCounter(document.getElementById('d')) -->

+ 0 - 680
new.js

@@ -1,680 +0,0 @@
-// var login = prompt("Input login");
-// var password = prompt("Input password");
-// if (login == null && login == ""){
-//     alert("Input login,please")}
-//     else if (login === "admin" && password === "qwerty"){
-//         alert('You lucky')
-//     }
-//     else {
-//         alert('Try again')
-//         }
-
-
-
-
-
-// var game = ['stone', 'paper','scissors'];
-// var myIndex = Math.floor(Math.random()*game.length);
-// var userWorld = prompt("Ведите выбор: stone, scissors, paper");
-// var userIndex = game.indexOf(userWorld);
-// var iWin = (((userIndex+1)% game.length) == myIndex);
-// var draw = myIndex == userIndex;
-// if (iWin == false && draw == false){alert('You loser')}
-//     else if (draw == true){alert('equal')}
-//         else {alert('You are winner')}
-
-
-// if(iWin==true){
-//     alert("Comp is winner")
-//     }
-//     else if(iWin==false){
-//         alert("you are winner")
-//         }
-//         else if(draw==true){
-//             alert("equal")
-//             }
-//             else{
-//                 alert("non correct")
-//                 }
-
-// var root={
-//     tag:'body',
-//     paired: 'true',
-//     subTags:[
-//         {
-//             tag:'div',
-//             subTags: [
-//                 {
-//                     tag:'span',
-//                     text:'Enter a data please:',
-//                     tag:'br',
-//                     paired:'false'
-//                 }
-//             ],
-//             subTags: [
-//                 {
-//                     tag:'input',
-//                     paired:'false',
-//                     attrs: {
-//                         type: 'text',
-//                     },
-//                     attrs: {
-//                         id: 'name',
-//                     }
-//                 }
-//             ],
-//             subTags: [
-//                 {
-//                     tag:'input',
-//                     paired:'false',
-//                     attrs: {
-//                         type: 'text',
-//                     },
-//                     attrs: {
-//                         id: 'surname',
-//                     }
-//                 }
-//             ],
-//             tag:'div',
-//             subTags: [
-//                 {
-//                     tag:'button',
-//                     attrs: {
-//                         id: 'ok',
-//                     },
-//                     text:'Ok'
-//                 }
-//             ],
-//             subTags: [
-//                 {
-//                     tag:'button',
-//                     attrs: {
-//                         id: 'cancel',
-//                     },
-//                     text:'Cancel'
-//                 }
-//             ]
-//         }
-//     ]
-// }
-
-var person = {
-    name: prompt("Enter a name"),
-    surname: prompt("Enter a surname"),
-}
-
-person.smartphone = "owner";
-person["laptop"] = "owner";
-
-
-var test = []; 
-
-test.one = prompt("name");
-test.two = +prompt("age");
-test.three = +prompt("height");
-
-
-
-function ar2() {
-    var a = "";
-    while (a != true) {
-        a = confirm("while confirm");
-    }
-
-    for(var i=""; i!=true;){
-        i=confirm("while confirm");
-    }
-
-
-    var i='1234567890';
-    var str=""
-    for(var j=0; j<10; j++){
-
-    }
-
-var test=[];
-    for(var i=""; i!=null;){
-       i=prompt('few words');
-       test.push(i);
-       if(i==null){
-           break;
-       }
-    }
-
-
-    var test=[];
-    for(var i=""; i!=null;){
-       i=prompt('few words');
-       obj[i] = i;
-       if(i==null){
-           break;
-       }
-    }
-var a=0;
-for(var i=0;;i++){
-    a=Math.random();
-    if(a>0.9){
-        break;
-    }
-}
-console.log(i);
-
-for(var i=""; ;){
-    i=prompt('few words');
-    if(i==null){
-        break;
-    }
- }
-
-
- var sum=0;
- 
- var n=+prompt('number');
- for(var i=1; i<n; i+3){
-     
-     sum=sum+i;
- }
-
- console.log(sum);
-
-
-
-
-
- arr[i]=3*(i+1)
-
-
- var sum=0;
- var n=+prompt('number');
- for(var i=1; i<n; i+=3){ 
-    sum=sum+i;
- }
- alert(sum);
-
-
- var a="#";
- var b="";
- var res="";
- for(var i=0; i<10; i++){
-    res=a+b;
- }
- console.log(res);
-
-
- var str="";
-var i=0;
-for (i;i<10;i++){
-	str +="\n";
-	for (var j=0;j<10;j++){
-		str += j;
-	}
-}
-console.log(str);
-
-var str="";
-for (var j=0;j<10;j++){
-    str+="#"+"";
-}
-
-for (var i=10,str="";i>0;i--,str+="#"+""){
-	console.log(str);
-}
-
-
-var i = 0;
-var j = 0;
-var str = "\n";
-for (i=1;i<=8;i++){
-    for (j=1; j<=8;j++){
-        str += (i%2 == j%2) ? "#": "."
-        }
-        str += '\n';
-    }
-console.log(str);
-
-
-
-var i = 0;
-var str = "";
-var j=(Math.floor((Math.random()*10)))%2+5;
-    for (i=1; i<j; i++){
-        str += "#" + " "
-        } 
-console.log(str);
-
-var arr=[];
-var n=prompt();
-var str = "";
-for(i=0; i<=n; i++){
-    arr[i] = i*i*i; 
-    str += i + " ";
-}
-console.log(str);
-
-var i = 0;
-var j = 0;
-var str = "\n";
-for (i=1;i<=9;i++){
-    for (j=1; j<=9;j++){
-        str += (i * j) + " "
-        }
-        str += '\n';
-    }
-console.log(str);
-
-var arr=[];
-var str = "\n";
-var a=0;
-for (var i=1;i<=9;i++){
-    for (var j=1; j<=9;j++){
-        arr[i] = [];
-        a=i*j;
-        arr[i][j]=a;
-        str += arr[i][j] + " "
-        }
-        str += '\n';
-    }
-console.log(str);
-
-
-
-
-for (var key in person){
-    console.log(key+": "+person[key]);
-}
-
-
-var a={
-    name:"Nick",
-    surname:"Golden",
-}
-var b={
-    name:"Peter",
-    surname:"Green",
-}
-var c={
-    name:"Bob",
-    surname:"Black",
-}
-
-a.age = "15";
-b["fathername"] = "Petrovich";
-c.push(sex)="male";
-
-if ("age" in a) {
-    alert( "Свойство name существует!" );
-  }else{alert("Такого свойства нет")};
-
-var person={
-    name:"Dick",
-    surname:"Jhone",
-}
-
-person={...{a,b,c},name:"Dick", surname:"Jhone"}
-
-
-for (var key in person){
-    console.log(key+": "+person[key]);
-    for (let word of ['name','surname']){
-        console.log(word)
-    }
-}
-var a=0;
-var b=0;
-var c=0;
-function sum(a,b,c){
-    var d = a+b+c;
-    return(d);
-};
-sum();
-
-
-
-function(a=0,b=0){
-    var c=Math.floor()
-}
-var a=0;
-var b=0;
-function intRandom(a, b) {
-    return Math.floor(Math.random() * (b - a)) + a;
-  }
-
-greetAll("Superman") // выводит alert "Hello Superman"
-greetAll("Superman", "SpiderMan") // выводит alert "Hello Superman, SpiderMan"
-greetAll("Superman", "SpiderMan", "Captain Obvious")
-
-function salut() {
-    var args = [];
-    for (var i = 0; i < arguments.length; i++) {
-      args[i] ="   " +  arguments[i];
-    }
-    alert( "Привет! -  " + args);
-  }
-salut("Superman")
-salut("Superman", "SpiderMan")
-salut("Superman", "SpiderMan", "Captain Obvious");
-
-
-  
-function sum() {
-    var args = 0;
-    for (var i = 0; i < arguments.length; i++) {
-      args +=arguments[i];
-    }
-    alert( args);
-  }
- 
-  sum(1) 
-  sum(2) 
-  sum(10,20,40,100) 
-
-  
-  function avg() {
-    var args = 0;
-    for (var i = 0; i < arguments.length; i++) {
-      args +=arguments[i];
-      args=args/arguments.length;
-    }
-    alert( args);
-  }
-  avg(1) // => 1
-  avg(2) // => 2
-  avg(10,20,40,100) // => 42.5
- 
-
-
-
-function a(b){
-    alert(b);
-};
-
-function cube(a){
-    alert(Math.pow(a, 3)); 
-}
-
-function avg2(a,b){
-    var c = (a+b)/2;
-    alert(c);
-};
-
-function sum3(a=0,b=0,c=0){
-    alert(a+b+c);
-};
-
-function intrandom(a=0, b=0) {
-    alert (Math.floor(Math.random() * (b - a)) + a);
-}
-
-function greet() {
-    var args = [];
-    for (var i = 0; i < arguments.length; i++) {
-      args[i] ="   " +  arguments[i];
-    }
-    alert( "Привет! -  " + args);
-  }
-
-  function sum() {
-    var args = 0;
-    for (var i = 0; i < arguments.length; i++) {
-      args +=arguments[i];
-    }
-    alert( args);
-  }
-
-
-
-  function avg() {
-    var args = 0;
-    for (var i = 0; i < arguments.length; i++) {
-      args +=arguments[i];
-    }
-	args=args/arguments.length;
-    alert( args);
-  }
-
-var allFunc = {...a, cube, avg2, sum3, intrandom, greet, sum, avg,}
-for (var key in allFunc){
-    console.log(key+": "+allFunc[key]);
-}
-
-function allFunc() {
-    var args = {};
-    for (var i = 0; i < arguments.length; i++) {
-      args[i] ="   " +  arguments[i];
-    }
-    console.log(args);
-  }
-
-
-var obj2 = {...a, cube, avg2, sum3, intrandom, greet, sum, avg,}
-
-
-
-allFunc("a", "cube", "avg2", "sum3", "intrandom", "greet", "sum", "avg",);
-var person = {
-    ...
-    age: 50,
-    ...
-    getAgeCategory: function(){
-        ...
-    }
-}
-
-alert(person.getAgeCategory());
-
-
-var sample = prompt("Введите название задания")
-switch (sample.toLowerCase()){
-    case "a": aSample("Hello!")
-              break
-    case "cube": cubeSample(3)
-              break
-    case "avg2": avg2Sample(10,5)
-              break
-    case "sum3": sum3Sample(1,2,3)
-              break
-    case "intrandom": intrandomSample(2,15)
-              break
-    case "greet": greetSample("Superman", "SpiderMan", "Captain Obvious")
-              break
-    case "sum": sumSample(10,20,40,100); 
-              break
-    case "avg": avgSample(10,20,40,100)
-              break
-}
-
-
-
-
-var a=0;
-function cube(a){
-    var b = Math.pow(a, 3);
-    return(b);
-};
-
-
-function cubeSample(a,b){
-    var b = Math.pow(a, 3);
-    return(b);
-    cube(5) // => 125
-}
-
-
-
-
-rates={
-	usd: {
-        buy:26.15,
-        sell:26.51
-    },
-    eur: {
-        buy:31.98,
-        sell:32.62
-    },
-};
-
-
-
-
-var tabHtml = document.documentElement;
-var tabBody = document.createElement("body");
-tabHtml.appendChild(tabBody);
-var tBody = document.createElement("tbody");
-tabBody.appendChild(tBody);
-var tab=document.createElement("table");
-tab.border=1;
-tab.cellpadding=1;
-tab.cellspacing=1;
-tBody.appendChild(tab);
-var multi = new Array();
-for (i = 1; i <= 10; i++) {
-multi[i] = new Array();
-if (i%2 !=0) {
-    var tr =document.createElement("tr");
-  tab.appendChild(tr);
-  tr.style.backgroundColor = "yellow";
-      } 
-else {
-    var tr =document.createElement("tr");
-      tab.appendChild(tr);
-    tr.style.backgroundColor = "grey";
-  }   
-for (j = 1; j <= 10; j++) {
-multi[i][j] = i * j;
-var td =document.createElement("td")
-tr.appendChild(td);
-td.id = "cell" 
-td.width="50";
-td.height="50"
-td.innerHTML= "<td>" + multi[i][j] + "</td>";
-td.onmouseover = td.onmouseout = moveMouse;
-function moveMouse(event) {
-  if (event.type == 'mouseover') {
-    event.td.style.background = 'pink'
-  }
-  if (event.type == 'mouseout') {
-    event.td.style.background = ''
-  }
-}
-}
-}
-
-
-
-  var arr = ['1', 0, Math.random, alert, prompt, prompt(), null, undefined, "name", {}]
-  function typeStats (arr){
-      var massOne=[]
-      var obj={}
-      for(i = 0; i < arr.length; i++){
-        massOne.push(typeof arr[i]);
-          for(j=0; j<massOne.length; j++){
-              var count=obj[massOne[i]] || 0
-          }
-          obj[massOne[i]]=count+1
-      }
-      return obj;
-  }
-  typeStats(arr);
-
-
- 
-
-  var arr = ['1', 0, Math.random, alert, prompt, prompt(), null, undefined, "name", {}]
-  var typestats=function(arr){
-      var intmass=[];
-      var assmass={};
-      for(i=0; i<arr.length; i++){
-          intmass.push(typeof arr[i]);
-          for(j=0; j<intmass.length; j++){
-              var count=assmass[intmass[i]] || 0
-          }
-          assmass[intmass[i]]=count+1;
-      }
-      return assmass;
-  }
-  typestats(arr);
-
-<input id="f" type="submit" onclick="myFunc()" value='0'>
-
-
-
-  function myFunc() {
-    var elem = document.getElementById('f');
-    var x = parseInt(elem.value, 10);
-    elem.value = x + 1;
-        
-}
-
-
-document.createElement('<input id="f" type="submit" onclick="myFunc()" value='0'>')
-
-
-
-   <input type="nick" id = "nick" placeholder="Nick">
-   <input type="text" id = "message" placeholder="Message">
-   <input type="submit" value="send" id = "button">
-   <div id= "chat">  </div>
-
-function jsonPost(url, data)
-    {
-        return new Promise((resolve, reject) => {
-            var x = new XMLHttpRequest();   
-            x.onerror = () => reject(new Error('jsonPost failed'))
-            //x.setRequestHeader('Content-Type', 'application/json');
-            x.open("POST", url, true);
-            x.send(JSON.stringify(data))
-
-            x.onreadystatechange = () => {
-                if (x.readyState == XMLHttpRequest.DONE && x.status == 200){
-                    resolve(JSON.parse(x.responseText))
-                }
-                else if (x.status != 200){
-                    reject(new Error('status is not 200'))
-                }
-            }
-        })
-    }
-
-jsonPost("http://students.a-level.com.ua:10012", {func:"addMessage", nick:"Oleg", message:"Hello"})
-
-var messages=jsonPost("http://students.a-level.com.ua:10012", {func:"getMessages", messageId:"0"})
-.then(a=> console.log(a.data));
-
-function mess() {
-    var messages = jsonPost("http://students.a-level.com.ua:10012", {
-        func: "getMessages",
-        messageid: "0"
-    }).then(a => {
-        console.log(a)
-        for (q = 0; q < a.data.length; q++) {
-            var y = document.getElementById("ms")
-            var ссс = document.createElement("p")
-            ссс.innerHTML = a.data[q].nick + "----" + a.data[q].message
-            y.appendChild(ссс)
-
-        }
-        var qqq = a.nextMessageId
-        console.log(qqq + "a111")
-        console.log(a.data.length)
-        setInterval(function() {
-            var messages = jsonPost("http://students.a-level.com.ua:10012", {
-                func: "getMessages",
-                messageid: qqq
-            }).then(www => {
-                for (q = a.data.length; q < www.data.length; q++) {
-                    var y = document.getElementById("ms")
-                    var ссс = document.createElement("p")
-                    ссс.innerHTML = www.data[q].nick + "----" + www.data[q].message
-                    y.appendChild(ссс)
-
-                }
-                qqq = www.nextMessageId
-                console.log(qqq + "a222")
-                console.log(www.data.length)
-            })
-
-
-        }, 2000);
-    })
-}
-mess()

+ 0 - 82
new.php

@@ -1,82 +0,0 @@
-<?php
-$sudoku = $numbers = $temp_results = [];
-$num_of_cleanings;
-init_sudoku();
-//generating coords for each square (5-th square has 36, 37, 38, 46, 47, 48, 56, 57, 58)
-foreach (range(0, 8) as $square_number) {
-	$square_coords[] = get_square_coords($square_number);
-}
-$temp_results = [];
-while (count($numbers)) { //go through all the numbers
-	$number = array_pop($numbers);
-	$used_rows = $used_cols = [];
-	$square = 0;
-	while ($square < 9) {
-		$coord = random_coord($square, $used_rows, $used_cols);
-		if (false === $coord) {
-			// echo "cleaning!!!\n";
-			$num_of_cleanings++;
-			if($num_of_cleanings > 2) {
-				init_sudoku();
-				break;
-			}
-			$square = 0;
-			$sudoku = $temp_results;
-			$used_rows = $used_cols = [];
-			continue;
-		}
-		$row = intval($coord/10);
-		$col = $coord % 10;
-		$sudoku[$row][$col] = $number;
-		$used_rows[] = $row;
-		$used_cols[] = $col;
-		$square++;			
-	}
-	$temp_results = $sudoku;
-}
-$message = "We have created a sudoku!\n";
-// print_sudoku();
-function init_sudoku() {
-	global $sudoku, $numbers, $num_of_cleanings;
-	$zeroes = array_fill(0,9, 0); // array of 9 zeroes
-	$sudoku = array_fill(0, 9, $zeroes); // array 9 x 9 of zeroes for sudoku
-	$numbers = range(1, 9);
-	$num_of_cleanings = 0;
-}
-function print_sudoku(){
-	global $sudoku;
-	foreach ($sudoku as $s1) {
-		foreach ($s1 as $value) {
-			print $value . "  ";
-		}
-		print "\n";
-	}
-}
-function get_square_coords($square) {
-	$x = ($square % 3) * 3;
-	$y = intval($square / 3) * 3;
-	$coords = array_merge(
-		range($y*10 + $x, $y*10 +$x +2),
-		range(($y+1)*10 + $x, ($y+1)*10 +$x +2),
-		range(($y+2)*10 + $x, ($y+2)*10 +$x +2)
-	);
-	return $coords;
-}
-function random_coord($square, $used_rows, $used_cols) {
-	global $square_coords, $sudoku;
-	$option_coords = $square_coords[$square];
-	do {
-		if(! count($option_coords)) {
-			return false;
-		}
-		$coord = random_value($option_coords);
-		$x = $coord % 10;
-		$y = intval($coord/10);
-		$option_coords = array_diff($option_coords, [$coord]);
-	} while (in_array($x, $used_cols) || in_array($y, $used_rows) || ($sudoku[$y][$x] != 0));
-	return $coord;
-}
-function random_value($array) {
-	return $array[array_rand($array, 1)];
-}
-?>

+ 0 - 0
new2.js


+ 0 - 23
style.css

@@ -1,23 +0,0 @@
-@import url("fonts.css");
-*{
-  margin: 0;
-  padding: 0;
-  /* font-family:  */
-}
-
-a:hover, a {
-  text-decoration: inherit;
-  color: inherit; 
-}
-
-body{
-  margin: 0 auto;
-  padding-top: 60px;
-  background-color: white;
-}
-
-
-/* .wrapper{
-  max-width: 1200px;
-  margin: 0 auto;
-} */