This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if (isReturnInstructions()) { | |
| divs = document.getElementsByClassName('a-section'); | |
| for (i = 0; i < divs.length; i++) { | |
| div = divs[i]; | |
| if (! div.className.includes("page-break-avoid") && ! div.parentElement.className.includes("page-break-avoid")) { | |
| div.className += (" no-print"); | |
| console.log("Div #"+ (i+1) + div.className); | |
| } | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var inputCleaned = input.prompt.toLowerCase().replace(/\s+/g, '') | |
| switch (inputCleaned) { | |
| case 'uninspired': | |
| alert(response.uninspired); | |
| break; | |
| case 'lackofpassion': | |
| alert(response.noPassion); | |
| break; | |
| // etc... | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| case @ran_letter | |
| when "b" | |
| @column = 0 | |
| when "i" | |
| @column = 1 | |
| when "n" | |
| @column = 2 | |
| when "g" | |
| @column = 3 | |
| when "o" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def separate_comma(num) | |
| separated_num = num.to_s.split("").reverse | |
| result = [] | |
| separated_num.each_with_index.map do |num, index| | |
| if index % 3 == 0 && index != 0 | |
| result << num + "," | |
| else | |
| result << num | |
| end | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $(document).ready(function() { | |
| bindStart(); //assumes you have an element, could be a div or button or whatever, with an id of 'start' | |
| bindRGBYButtons(); | |
| }); | |
| function bindStart() { | |
| $('#start').on('click', function() { | |
| startGame(); | |
| }); | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def vert(board) | |
| board[0].each_with_index do |cell, column_num| | |
| puts "Cell: #{cell}" | |
| if cell == "x" | |
| column = [] | |
| 4.times do |row_num| | |
| column << board[row_num + 1][column_num] | |
| end | |
| puts "#Column: #{column}" | |
| return true if column.count('x') == 4 |