Rast Gele Sayı Uygulamaları
Ekrana rastgele tutulan sayı resim dosyaları ile yazılıyor
<!doctype html>
<html>
<head>
<title>hebeşe hübeşe</title>
</head>
<body>
<h1>Rast Gele Oluşturulan Sayı</h1>
<div id="hungary"></div>
<button onclick="generateRandomNumber()">click yap</button>
<script>
const images =
[
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRjK4O4g1zNHhyYt5Wwo5S2eKNaQnrTqMlv7A&s", "https://e7.pngegg.com/pngimages/578/522/png-clipart-1-1-thumbnail.png", "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRL9vDTeJUAVvZM5Bp8QtgvIq09mDNOuvIFQA&s", "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSNw5AFVjG6DlNmyaXzkqMIkJ6f7wRxw9PsIg&s", "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRJ9FgnTz_7JBE6vCfa0pvwr6XgyV-AHeCJEQqzimInaOjhD9txbNLSkCm2FonA5Yrczu0&usqp=CAU",
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSd1HxmRAJ_DZzsIzHa4ZsATs-VWcgsk5Zg&s", "https://e7.pngegg.com/pngimages/132/689/png-clipart-number-number-6-image-file-formats-orange-thumbnail.png", "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRh23TpqMfuAmvb4fM5O6Mnvbk2pHZsaEavOQ&s", "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSrSaCXThiqjq0xGK2Yso_UrGu4Cu8KqLuGhg&s", "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRjLocY4XIhAoxVIdenI-I1GIYhGbnOt4qOWA&s"
];
function generateRandomNumber() {
const hungary = Math.floor(Math.random() * 900) + 100;
const thing = hungary.toString();
let htmlContent = '';
for (let i = 0; i < thing.length; i++) {
const digit = thing[i];
htmlContent += `<img src="${images[digit]}" alt="Sayı ${digit}">`;
}
document.getElementById('hungary').innerHTML = htmlContent;
}
window.onload = generateRandomNumber;
</script>
</body>
</html>
<html>
<head>
<title>hebeşe hübeşe</title>
</head>
<body>
<h1>Rast Gele Oluşturulan Sayı</h1>
<div id="hungary"></div>
<button onclick="generateRandomNumber()">click yap</button>
<script>
const images =
[
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRjK4O4g1zNHhyYt5Wwo5S2eKNaQnrTqMlv7A&s", "https://e7.pngegg.com/pngimages/578/522/png-clipart-1-1-thumbnail.png", "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRL9vDTeJUAVvZM5Bp8QtgvIq09mDNOuvIFQA&s", "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSNw5AFVjG6DlNmyaXzkqMIkJ6f7wRxw9PsIg&s", "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRJ9FgnTz_7JBE6vCfa0pvwr6XgyV-AHeCJEQqzimInaOjhD9txbNLSkCm2FonA5Yrczu0&usqp=CAU",
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSd1HxmRAJ_DZzsIzHa4ZsATs-VWcgsk5Zg&s", "https://e7.pngegg.com/pngimages/132/689/png-clipart-number-number-6-image-file-formats-orange-thumbnail.png", "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRh23TpqMfuAmvb4fM5O6Mnvbk2pHZsaEavOQ&s", "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSrSaCXThiqjq0xGK2Yso_UrGu4Cu8KqLuGhg&s", "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRjLocY4XIhAoxVIdenI-I1GIYhGbnOt4qOWA&s"
];
function generateRandomNumber() {
const hungary = Math.floor(Math.random() * 900) + 100;
const thing = hungary.toString();
let htmlContent = '';
for (let i = 0; i < thing.length; i++) {
const digit = thing[i];
htmlContent += `<img src="${images[digit]}" alt="Sayı ${digit}">`;
}
document.getElementById('hungary').innerHTML = htmlContent;
}
window.onload = generateRandomNumber;
</script>
</body>
</html>
Yorumunuzu Ekleyin