Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions code/matt_r/java/hacker/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="myscript.js" defer></script>
<link rel="stylesheet" href="styles.css">
<title>Hacked</title>
</head>
<body>
<h1>Press any key to continue.</h1>

<div id="area"></div>

</body>
</html>
69 changes: 69 additions & 0 deletions code/matt_r/java/hacker/myscript.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@


let area= document.querySelector('#area')

let alphabet = ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z', '¼', '½', '¾', '⅓', '⅔', '⅛', '⅜', '⅝', '≈', '>', '≥', '≧', '≩', '≫', '≳', '⋝', '÷', '±', '∓', '≂', '⊟', '⊞', '⨁', '⨤', '⨦', '%', '∟∠∡', '⊾⟀', '⦜', '⦛', '⦠', '√', '∛', '∜', '⍍', '≡', '≢', '⧥', '⩧', '⅀', '◊', '⟠', '⨌⨍⨏', '⨜', '⨛', '◜', '◝', '◞', '◟', '⤸', '⤹', '◆', '◇', '❖', '○', '◍', '●', '◐', '◑', '◒', '◓', '◔', '◕', '◖', '◗', '⬡', '⬢', '‰', 'ⁿ', '¹', '²', '³', '§', '∞', 'ㅅ', '⌖', '◧', '◨', '◩', '◪', '▢', '▣', '▤', '▥', '▦', '▧', '▨', '▩', '▬', '▭', '▮', '▯', '▰', '▱', '◆', '◇', '◈', '◉', '◊', '○', '◌', '◎', '◘', '◙', '◚', '◛', '◜', '◝', '◞', '◟', '◠', '◡', '◢', '◣', '◤', '◥', '◦', '◫', '◬', '◭', '◮', '◯', '▲', '△', '▴', '▵', '▷', '▸', '▹', '►', '▻', '▼', '▽', '▾', '▿' , '◁', '◂', '◃', '◄', '◅']
const textArray = [

'Congratulations,',
"You've been hacked!!",
'<span class="test"> andfhg a </span>',
'<span class="center"> hello </span>',
]


let content = ''
let counter = 1

// document.body.addEventListener('keypress', (event) => {
// console.log(event)

// content=''

// for (let i=0; i < counter; i++){

// content += textArray[i]
// }

// counter += 1

// area.innerHTML=''
// area.innerHTML= content

// })


document.body.addEventListener('keypress', (event) => {
console.log(event)

content=''
let word=''


for (let i=0; i < counter; i++){

content += textArray[i]
}


let wordLength = Math.floor(Math.random() * (10 - 0) + 0)

for (let i=0; i < wordLength; i++){

let alphaIndex = Math.floor(Math.random() * (166 - 0) + 0)
let letter = alphabet[alphaIndex]


word = word + letter

}

textArray.push(word + '....')
console.log(word)

counter += 1

area.innerHTML=''
area.innerHTML= content

})
13 changes: 13 additions & 0 deletions code/matt_r/java/hacker/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.test{
color: red;
margin-left: 5rem;
}

.center{
color: green;
margin-left: 15rem;
}

body{
word-wrap: break-word;
}
73 changes: 73 additions & 0 deletions code/matt_r/java/redo_randpass/myscript.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@




const game = ['rock', 'paper', 'scisors']
let choice = Math.floor(Math.random() * (2 - 0) + 0);

let comp = game[choice]
let outcome = ''

console.log('comp: ' + comp)


// let human = nextline('human')






let btn = document.querySelector('#btn')

btn.onclick = function(){
// console.log('hello')

let humanNode = document.querySelector('#human')
let human = humanNode.value
console.log(human)

if (human == 'rock') {

if (comp == 'rock') {
outcome = 'its a tie'
} else if (comp == 'scissors') {
outcome = 'Player wins'
} else {
outcome = 'Computer wins'
}
}

if (human == 'paper') {

if (comp == 'paper') {
outcome = 'its a tie'
}
else if (comp == 'rock') {
outcome = 'Player wins'
}
else {
outcome = 'Computer wins'
}
}

if (human == 'scissors'){

if (comp == 'scissors'){
outcome = 'its a tie'
}
else if (comp == 'paper'){
outcome = 'Player wins'
}
else {
outcome = 'Computer wins'
}

}
console.log(outcome)

let result = document.querySelector('#result')
result.innerHTML = `${outcome}, computer chose ${comp}`
}