Ask questions which are clear, concise and easy to understand.
Ask QuestionPosted by Mujibur Choudhury 42 minutes ago
Posted by Zaquiya Firdaus 57 minutes ago
Posted by Nikhil Pandey 3 hours ago
Posted by Irfan Ahmad 11 hours ago
Posted by Jeevan. C Jeevan. C 1 day, 8 hours ago
Posted by Harsh Kumar Jha 2 days, 1 hour ago
Posted by Suvan Rana 2 days, 4 hours ago
Posted by Janhvi Dinesh God 2 days, 10 hours ago
Posted by Archana Bhandari 4 days, 2 hours ago
Archana Bhandari 4 days, 2 hours ago
Posted by ཞƠყĄɩ Ɬɧąƙųཞ 📚 4 days, 4 hours ago
ཞƠყĄɩ Ɬɧąƙųཞ 📚 2 days, 9 hours ago
On building this simple game I learnt more about how the programming languages HTML5, CSS and JavaScript worked. The rules are stated below
Have fun!!
<button onclick="shootLeft()" style="top:400px; left:100px;" type="leftButton">Shoot left</button> <button onclick="shootRight()" style="top:400px; left:200px;" type="rightButton">Shoot right</button> <div> </div> </div> <script> var ball = null; var x = 1; var score = 0; document.getElementById('score').innerHTML = '0'; var animate; ball = document.getElementById('ball'); function shootLeft(){ var ran = Math.random(); while(parseInt(ball.style.top) != 300){ ball.style.left = parseInt(ball.style.left) - 1 + 'px'; ball.style.top = parseInt(ball.style.top) - 1 + 'px'; animate = setTimeout(shootLeft,20); } if(ran<0.3){ score = score + 1; document.getElementById('score').innerHTML = score; } else{ document.getElementById('score').innerHTML = score; } x++; if(x==10){ document.getElementById('gameover').innerHTML = "Game over! You got a score of " + score; } ball.style.left = '300px'; ball.style.top = '410px'; } function shootRight(){ van ran = Math.random(); while(parseInt(ball.style.top != 300){ ball.style.left = parseInt(ball.style.left) + 1 + 'px'; ball.style.top = parseInt(ball.style.top) - 1 + 'px'; animate = setTimeout(shootRight,20); } if(ran>0.7){ score = score + 1; document.getElementById('score').innerHTML = score; } else{ document.getElementById('score').innerHTML = score; } x++; if(x==10){ document.getElementById('gameover').innerHTML = "Game over! You got a score of " + score; } ball.style.left = '300px'; ball.style.top = '410px'; } } </script> </body> </html>Posted by Sharanya Ashish 4 days, 5 hours ago
Posted by Dipender Shinghania 4 days, 6 hours ago
Posted by Aman Ahmed 4 days, 19 hours ago
Posted by Anil Kumar 4 days, 22 hours ago
Posted by Sujata Rai 5 days ago
Posted by Abhishek Kumar 5 days, 13 hours ago
Posted by Medha Priyadarshini 6 days ago
Posted by Sapna Kumari 6 days, 1 hour ago
Posted by Dipesh Kashyap 6 days, 23 hours ago
Posted by Pundalikappa Goudar 1 week ago
Posted by 🔱Tomar ➡️Jaat⬅️ 1 week, 1 day ago
Posted by 🔱Tomar ➡️Jaat⬅️ 1 week, 1 day ago
Posted by Sundha Maata 1 week, 1 day ago
Posted by Kundan Kumar 1 week, 1 day ago
Create papers in minutes
Print with your name & Logo
Download as PDF
3 Lakhs+ Questions
Solutions Included
Based on CBSE Blueprint
Best fit for Schools & Tutors
No software required, no contract to sign. Simply apply as teacher, take eligibility test and start working with us. Required desktop or laptop with internet connection