html
html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<!-- Created by Yasir Khan! -->
<!DOCTYPE html>
<html>
<head>
<title>Answer and be sorted out by Sorting hat</title>
</head>
<body>
<h1>
Sorting hat's Decision:
<br />
</h1>
<script type="text/javascript">
start();
</script>
<br />
<br />
<br />
<br />
<marquee>
Welcome to Hogwartz School of Witchcrafts and Wizardry!
</marquee>
</body>
</html>
Enter to Rename, Shift+Enter to Preview
css
css
1
2
3
body {color: white; background-color: black; font-family: arial;}
h1 {font-family: "Times New Roman"; }
marquee {color:grey;font-size: x-large; border-style: dashed; border-color: blue;}
Enter to Rename, Shift+Enter to Preview
js
js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
function start(){
var wchck = prompt("Was Ron good at magic? If yes, type 0, if no type 1")
var hpchck = prompt("Will you like this program? if yes, 1, If no, 0")
var sechck = prompt("Are you a good programmar? If yes, 1. if no, 0")
var hwchck = prompt("Do you code at least one hour a day? If yes, 1. if no, 0")
if(((wchck && hpchck) == "1") && (sechck == "0")){
document.write("You are perfect for Graffyndor")
}else if(hwchck == "1" && (sechck && wchck == "0")){
document.write("You are perfect for Hufflepuff!")
} else if ((hpchck == "1") && sechck == "1"){
document.write("You are perfect for Revenclaw!")
} else if((sechck && wchck == "1") && (hpchck == "0" )){
document.write("You are perfect for Slythrin!")
} else {
document.write("Sorry! The sorting hat has diffuclty to choose your house. Please try again!")
}}
Enter to Rename, Shift+Enter to Preview
BROWSER
Console
Run