This file contains 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 allmax_positions( input_array ): | |
if len(input_array) == 0: | |
return [] | |
positions_of_max_values = [0] | |
the_max_values = input_array[0] | |
for counter_i in range(1, len(input_array)): | |
if input_array[counter_i] > the_max_values: | |
positions_of_max_values = [counter_i] | |
the_max_values = input_array[counter_i] |
This file contains 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
//----------------------------------------------------- | |
// Program returns the factors for an inputted number. | |
// filename: factors.cpp by Joshua Paul Barnard | |
//----------------------------------------------------- | |
#include<iostream> | |
using namespace std; | |
int main() | |
{ |
This file contains 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
let b = 1; | |
Object.defineProperty(globalThis,'a',{ | |
get(){return b++;} | |
}); | |
let result = Boolean( 'false' ) | |
if (a == 1 && a == 2 && a == 3) { | |
result = 'true' | |
console.log( result ); |
This file contains 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
# 1337 Speak Converter | |
# Author: Joshua Paul Barnard | |
# Date: January 29th, 2024 | |
# This is my 1337 speak converter. There are many like it, but this one is mine. | |
# There are many different ways to use 1337 speak, and some letters can have tens of variations. | |
# So I created this converter to be able to quickly convert text into my style of 1337. | |
# Function to replace characters |
This file contains 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
# A staircase is a list of lists where list 0 has length 1, and every list i+1 is one item longer than list i. | |
def create_staircase(integers): | |
integers.sort(reverse=True) # Sort the integers in descending order | |
staircase = [] # Initialize the staircase as an empty list | |
while len(integers) != 0 : # Continue until the list of integers is empty | |
sublist_length = len(staircase) + 1 # Determine the length of the next sublist | |
sublist = integers[:sublist_length] # Extract integers for the next sublist | |