Forwarded from 💻Visual📡Time📸 (Abdulaziz Baxriddinov Rashid o'g'li)
<html>
<head>
<title>Pixel Art Maker!</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Monoton">
<link rel="stylesheet" href="styles.css">
</head>
<body>
<h1>Lab: Pixel Art Maker</h1>
<h2>Choose Grid Size</h2>
<form id="sizePicker">
Grid Height:
<input type="number" id="inputHeight" name="height" min="1" value="1">
Grid Width:
<input type="number" id="inputWidth" name="width" min="1" value="1">
<input type="submit">
</form>
<h2>Pick A Color</h2>
<input type="color" id="colorPicker">
<h2>Design Canvas</h2>
<table id="pixelCanvas"></table>
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="designs.js"></script>
</body>
</html>
<head>
<title>Pixel Art Maker!</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Monoton">
<link rel="stylesheet" href="styles.css">
</head>
<body>
<h1>Lab: Pixel Art Maker</h1>
<h2>Choose Grid Size</h2>
<form id="sizePicker">
Grid Height:
<input type="number" id="inputHeight" name="height" min="1" value="1">
Grid Width:
<input type="number" id="inputWidth" name="width" min="1" value="1">
<input type="submit">
</form>
<h2>Pick A Color</h2>
<input type="color" id="colorPicker">
<h2>Design Canvas</h2>
<table id="pixelCanvas"></table>
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="designs.js"></script>
</body>
</html>
Forwarded from 💻Visual📡Time📸 (Abdulaziz Baxriddinov Rashid o'g'li)
body {
text-align: center;
}
h1 {
font-family: Monoton;
font-size: 70px;
margin: 0.2em;
}
h2 {
margin: 1em 0 0.25em;
}
h2:first-of-type {
margin-top: 0.5em;
}
table,
tr,
td {
border: 1px solid black;
}
table {
border-collapse: collapse;
margin: 0 auto;
}
tr {
height: 20px;
}
td {
width: 20px;
height: 20px;
}
input[type=number] {
width: 6em;
}
text-align: center;
}
h1 {
font-family: Monoton;
font-size: 70px;
margin: 0.2em;
}
h2 {
margin: 1em 0 0.25em;
}
h2:first-of-type {
margin-top: 0.5em;
}
table,
tr,
td {
border: 1px solid black;
}
table {
border-collapse: collapse;
margin: 0 auto;
}
tr {
height: 20px;
}
td {
width: 20px;
height: 20px;
}
input[type=number] {
width: 6em;
}
Forwarded from 💻Visual📡Time📸 (Abdulaziz Baxriddinov Rashid o'g'li)
"use strict";
const $tableElement = $('#pixelCanvas');
const $inputHeight = $('#inputHeight');
const $inputWidth = $('#inputWidth');
const $colorPicker = $('#colorPicker');
$('#sizePicker').submit( event => {
event.preventDefault();
let width = $inputWidth.val();
let height = $inputHeight.val();
$tableElement.html(''); //clear
makeGrid(height, width);
addCellClickListener();
});
function makeGrid(height, width) {
for(let i = 0; i < height; i++) {
$tableElement.append('<tr></tr>');
};
for(let i = 0; i < width; i++) {
$('tr').append('<td></td>');
};
};
function addCellClickListener() {
$('td').click( event => {
let color = $colorPicker.val();
$(event.currentTarget).css("background-color", color)
});
};
const $tableElement = $('#pixelCanvas');
const $inputHeight = $('#inputHeight');
const $inputWidth = $('#inputWidth');
const $colorPicker = $('#colorPicker');
$('#sizePicker').submit( event => {
event.preventDefault();
let width = $inputWidth.val();
let height = $inputHeight.val();
$tableElement.html(''); //clear
makeGrid(height, width);
addCellClickListener();
});
function makeGrid(height, width) {
for(let i = 0; i < height; i++) {
$tableElement.append('<tr></tr>');
};
for(let i = 0; i < width; i++) {
$('tr').append('<td></td>');
};
};
function addCellClickListener() {
$('td').click( event => {
let color = $colorPicker.val();
$(event.currentTarget).css("background-color", color)
});
};
💻Visual📡Time📸
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Building the Prototype</title> <link rel="stylesheet" href="styles.css"> </head> <body> <div id="container"> <h1>Leopard</h1> <!-- photo credit: wikipedia.org, image taken by Ritik…
ask 1:
You are required to complete the function reverse(x). given a string "x" as an input it is expected to return that same string but reversed.
Example:
input : "again"
output: "niaga"
you can change the string value in the variable text but you are not allowed to change the variable names or edit any other code,
except the function's body, doing so may jeopardize your evaluation
sol1----------------------
text = "this is not a reversed text"
def reverse(x):
#complete this function so that it takes string x as an input
#and returns its reverse
return x[::-1]
print("the reversed text is: "+reverse(text))
--------------------------------------------------------------------------------------------
Task 2:¶
You are required to complete the function average(x). where "x" is a list of numbers, and contains more than 3 numbers. the function is expected to return the average from that list.
Example:
input : [10,20,30,40]
output: 25
you can change the numbers in the list no_list but you are not allowed to change the variable names or edit any other code,
except the function's body, doing so may jeopardize your evaluation
sol2------------------------------------
no_list = [22,68,90,78,90,88]
def average(x):
#complete the function's body to return the average
sum = 0
for e in x:
sum += e
return sum / len(x)
print(average(no_list))
--------------------------------------------------------------------------------
Task 3:¶
You are required to complete the function maximum(x). where "x" is a list of numbers, and contains more than 2 numbers. the function is expected to return the highest number in that list.
Example:
input : [5,20,12,6]
output: 20
you can change the numbers in the list no_list but you are not allowed to change the variable names or
edit any other code, except the function's body, doing so may jeopardize your evaluation*
sol3-------------------------------------------
no_list = [1,2,3,4]
def maximum(no_list):
#complete the function to return the highest number in the list
high = no_list[0]
for e in no_list:
if e > high:
high = e
return high
print(maximum(no_list))
------------------------------------------------------------------------------
Task 4:¶
You are required to complete the function unique_list(l). where "l" is a list of numbers. the function is expected to return the unique numbers in that list.
Example:
input : [1,1,1,2,2,3,3,3,3,4,5,5,6]
output: [1,2,3,4,5,6]
you are not allowed to change the variable names or their values or edit any other code, except the function's body, doing so may jeopardize your evaluation
sol4------------------------
no_list = [22,22,2,1,11,11,2,2,3,3,3,4,5,5,5,55,55,66]
def unique_list(l):
#complete the function's body to return the unique list of numbers
unique = []
for x in l:
if x not in unique:
unique.append(x)
return unique
print(unique_list(no_list))
You are required to complete the function reverse(x). given a string "x" as an input it is expected to return that same string but reversed.
Example:
input : "again"
output: "niaga"
you can change the string value in the variable text but you are not allowed to change the variable names or edit any other code,
except the function's body, doing so may jeopardize your evaluation
sol1----------------------
text = "this is not a reversed text"
def reverse(x):
#complete this function so that it takes string x as an input
#and returns its reverse
return x[::-1]
print("the reversed text is: "+reverse(text))
--------------------------------------------------------------------------------------------
Task 2:¶
You are required to complete the function average(x). where "x" is a list of numbers, and contains more than 3 numbers. the function is expected to return the average from that list.
Example:
input : [10,20,30,40]
output: 25
you can change the numbers in the list no_list but you are not allowed to change the variable names or edit any other code,
except the function's body, doing so may jeopardize your evaluation
sol2------------------------------------
no_list = [22,68,90,78,90,88]
def average(x):
#complete the function's body to return the average
sum = 0
for e in x:
sum += e
return sum / len(x)
print(average(no_list))
--------------------------------------------------------------------------------
Task 3:¶
You are required to complete the function maximum(x). where "x" is a list of numbers, and contains more than 2 numbers. the function is expected to return the highest number in that list.
Example:
input : [5,20,12,6]
output: 20
you can change the numbers in the list no_list but you are not allowed to change the variable names or
edit any other code, except the function's body, doing so may jeopardize your evaluation*
sol3-------------------------------------------
no_list = [1,2,3,4]
def maximum(no_list):
#complete the function to return the highest number in the list
high = no_list[0]
for e in no_list:
if e > high:
high = e
return high
print(maximum(no_list))
------------------------------------------------------------------------------
Task 4:¶
You are required to complete the function unique_list(l). where "l" is a list of numbers. the function is expected to return the unique numbers in that list.
Example:
input : [1,1,1,2,2,3,3,3,3,4,5,5,6]
output: [1,2,3,4,5,6]
you are not allowed to change the variable names or their values or edit any other code, except the function's body, doing so may jeopardize your evaluation
sol4------------------------
no_list = [22,22,2,1,11,11,2,2,3,3,3,4,5,5,5,55,55,66]
def unique_list(l):
#complete the function's body to return the unique list of numbers
unique = []
for x in l:
if x not in unique:
unique.append(x)
return unique
print(unique_list(no_list))
Forwarded from Azamat Qo'chqarov
Бир миллион дастурчи жавоблари.doc
40.5 KB
Бир миллион дастурчи
Йўналишлар бўйича барчасининг жавоблари 100%
Йўналишлар бўйича барчасининг жавоблари 100%
Forwarded from ️Islom Imomaliyev
This media is not supported in your browser
VIEW IN TELEGRAM
Forwarded from Abdulaziz 🌙 Baxriddinov
Toshkentga ketish uchun 6x70000 qaytish kechikganimiz sababli 6x80000. Qo’liq vodiy petakdan bo’ldi!