I also have a language announcement. After years of losing golfing contests, I've decided it's time to give up on my principles and bring Pip into the modern golf meta. To that end, I'm adding compressed string syntax and switching to the log-bytes scoring system of Fig. The combined language will be known as "Pig."
Vending Machine Simulator code-golfinteractiverandom
Alternate title: Linear Logic Simulator
Objective
Write an interactive program that asks you to design a vending machine, and then simulate the vending machine.
The fuss is, the vending machine is designed for simulation of linear logic.
Design...
LMAO so there's this AP test review site called Fiveable (5 is the highest score you can get), and they just sent out an email that they're rebranding to "fourable"
I have code that uses divide and conquer. It works on a 2d numpy array. It splits the array into two halves, solves the problem for each half and then merges the result . I want to speed it up using parallelism by solving both halves in parallel recursively. Is that plausible in python?
"Numba will release the GIL when entering such a compiled function if you passed nogil=True . Code running with the GIL released runs concurrently with other threads executing Python or Numba code (either the same compiled function, or another one), allowing you to take advantage of multi-core systems"
This might be too hard for me sadly. At least I don't know what to do
import concurrent.futures
with concurrent.futures.ThreadPoolExecutor(max_workers=2) as executor:
for i in range(1000):
futures = executor.submit(conquer, left_half(data[i])), executor.submit(conquer, right_half(data[i]))
results = concurrent.futures.wait(futures).done
output[i] = combine(results)
(TIL that everything that's ever been in __future__ is still in there, even if it has since been included in the core language. So you can also do stuff like from __future__ import print_function, unicode_literals, with_statement if you want.)
does this look like a useful way to layout a debugger for my grid-with-values-traveling-across-it-2d-language? (still haven't found a name for this type of esolang)
Gonna put the title here as a reminder to myself to flesh it out later: "Play tag on a lattice"
Okay basically here's the idea
Your bot starts at some point on a grid (its x and y are both integers). It's given a set of moves, which are pairs of relative coordinates. Think, e.g., chess pieces. So you might get (1, 0), (-1, -1), (2, 0), which would allow you to move anywhere on the grid, just somewhat awkwardly. Or maybe you'd get (-4, 4), (6, 0), (2, 8), which would limit the precise grid squares you can land on, but allow you to travel long distances rapidly.
Your goal is to hunt down other bots, but you don't know their movesets (until they've used any given move from it)
And the twist: you can unlock new moves by killing an opponent
Constructing the Irish possessive
natural-language
In this challenge you will take an Irish word and a personal pronoun and create the possessive pronoun construction combining the two.
For example sé, madra becomes a mhadra. Translated to English he, dog becomes his dog.
Rather than exhaustively...
I completed the spec here. Are there any edge cases I'm missing?
i.e. are there aspects of the spec that aren't covered by the test cases.
Given a Minecraft terrain as a 2-dimensional array of integers or similar datastructure, determine the maximum number of cacti that can be planted on it.
The integers represent the height (y) of the terrain at each location (x and z). A cactus cannot be planted next to higher terrain or next to a...