From a9ed88397da32a2540cb6e438921643ad2873c1d Mon Sep 17 00:00:00 2001 From: fmouse01 Date: Wed, 26 Oct 2022 21:37:21 -0700 Subject: [PATCH 1/4] hacked wip --- code/matt_r/java/hacker/index.html | 15 +++++++++++++++ code/matt_r/java/hacker/myscript.js | 29 +++++++++++++++++++++++++++++ code/matt_r/java/hacker/styles.css | 9 +++++++++ 3 files changed, 53 insertions(+) create mode 100644 code/matt_r/java/hacker/index.html create mode 100644 code/matt_r/java/hacker/myscript.js create mode 100644 code/matt_r/java/hacker/styles.css diff --git a/code/matt_r/java/hacker/index.html b/code/matt_r/java/hacker/index.html new file mode 100644 index 00000000..5e4f48df --- /dev/null +++ b/code/matt_r/java/hacker/index.html @@ -0,0 +1,15 @@ + + + + + + + + + Hacked + + +
+ + + \ No newline at end of file diff --git a/code/matt_r/java/hacker/myscript.js b/code/matt_r/java/hacker/myscript.js new file mode 100644 index 00000000..c77519cd --- /dev/null +++ b/code/matt_r/java/hacker/myscript.js @@ -0,0 +1,29 @@ +let area= document.querySelector('#area') + +const textArray = [ + 'hello ', + "You've been hacked!", + ' andfhg a ', + ' hello ', +] + + +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 + +}) \ No newline at end of file diff --git a/code/matt_r/java/hacker/styles.css b/code/matt_r/java/hacker/styles.css new file mode 100644 index 00000000..ddabbb7f --- /dev/null +++ b/code/matt_r/java/hacker/styles.css @@ -0,0 +1,9 @@ +.test{ + color: red; + margin-left: 5rem; +} + +.center{ + color: green; + margin-left: 15rem; +} \ No newline at end of file From 78b8d2d4b0ea5ff2d90e74c80055caa879f66cb9 Mon Sep 17 00:00:00 2001 From: fmouse01 Date: Thu, 27 Oct 2022 18:20:12 -0700 Subject: [PATCH 2/4] wip --- code/matt_r/java/hacker/myscript.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/code/matt_r/java/hacker/myscript.js b/code/matt_r/java/hacker/myscript.js index c77519cd..46e51c84 100644 --- a/code/matt_r/java/hacker/myscript.js +++ b/code/matt_r/java/hacker/myscript.js @@ -11,6 +11,24 @@ const textArray = [ 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) From ca9f15cac583171eae8fe9c7ebff7d4793df54b5 Mon Sep 17 00:00:00 2001 From: fmouse01 Date: Fri, 28 Oct 2022 20:07:46 -0700 Subject: [PATCH 3/4] idk --- code/matt_r/java/hacker/myscript.js | 23 ++++++- code/matt_r/java/hacker/styles.css | 4 ++ code/matt_r/java/redo_randpass/myscript.js | 73 ++++++++++++++++++++++ 3 files changed, 99 insertions(+), 1 deletion(-) create mode 100644 code/matt_r/java/redo_randpass/myscript.js diff --git a/code/matt_r/java/hacker/myscript.js b/code/matt_r/java/hacker/myscript.js index 46e51c84..0b9cdc87 100644 --- a/code/matt_r/java/hacker/myscript.js +++ b/code/matt_r/java/hacker/myscript.js @@ -1,5 +1,8 @@ + + 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 = [ 'hello ', "You've been hacked!", @@ -33,12 +36,30 @@ 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='' diff --git a/code/matt_r/java/hacker/styles.css b/code/matt_r/java/hacker/styles.css index ddabbb7f..4979f1d6 100644 --- a/code/matt_r/java/hacker/styles.css +++ b/code/matt_r/java/hacker/styles.css @@ -6,4 +6,8 @@ .center{ color: green; margin-left: 15rem; +} + +body{ + word-wrap: break-word; } \ No newline at end of file diff --git a/code/matt_r/java/redo_randpass/myscript.js b/code/matt_r/java/redo_randpass/myscript.js new file mode 100644 index 00000000..07d89801 --- /dev/null +++ b/code/matt_r/java/redo_randpass/myscript.js @@ -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}` +} + + From 63304cd728132902d271bbeaa9e8830dc070013b Mon Sep 17 00:00:00 2001 From: fmouse01 Date: Mon, 12 Dec 2022 20:06:51 -0800 Subject: [PATCH 4/4] fixed --- code/matt_r/java/hacker/index.html | 2 ++ code/matt_r/java/hacker/myscript.js | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/code/matt_r/java/hacker/index.html b/code/matt_r/java/hacker/index.html index 5e4f48df..c69d74d3 100644 --- a/code/matt_r/java/hacker/index.html +++ b/code/matt_r/java/hacker/index.html @@ -9,6 +9,8 @@ Hacked +

Press any key to continue.

+
diff --git a/code/matt_r/java/hacker/myscript.js b/code/matt_r/java/hacker/myscript.js index 0b9cdc87..e0f50fde 100644 --- a/code/matt_r/java/hacker/myscript.js +++ b/code/matt_r/java/hacker/myscript.js @@ -4,8 +4,9 @@ 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 = [ - 'hello ', - "You've been hacked!", + + 'Congratulations,', + "You've been hacked!!", ' andfhg a ', ' hello ', ]