Input
A single positive integer \$ 10 \geq n \geq 2\$
Output
A list of strings, each of length \$2n\$, satisfying the following properties.
Each string will contain each of the first \$n\$ lowercase letters of the alphabet exactly twice.
No letter can occur twice consecutively. That is abbcac is...
I'm back! Lately I've been working on something, but finally I've
finished it and can return to CGCC! I'll be continuing the Fast &
Golfiest Series soon, and also try to start working on (given I have
the time and energy) WumpusWars. For now, a new question as a gift for everyone!
The original ...
@mousetail i never really understood these. why is multiplication higher precedence than division/addition higher than subtraction? wouldn't that mean something like 2/3*4 = 2/12 rather than 8/3?
(1) A "planet" [1] is a celestial body that (a) is in orbit around the Sun, (b) has sufficient mass for its self-gravity to overcome rigid body forces so that it assumes a hydrostatic equilibrium (nearly round) shape, and (c) has cleared the neighbourhood around its orbit.
The Jupiter trojans, commonly called trojan asteroids or simply trojans, are a large group of asteroids that share the planet Jupiter's orbit around the Sun. Relative to Jupiter, each trojan librates around one of Jupiter's stable Lagrange points: either L4, existing 60° ahead of the planet in its orbit, or L5, 60° behind. Jupiter trojans are distributed in two elongated, curved regions around these Lagrangian points with an average semi-major axis of about 5.2 AU.The first Jupiter trojan discovered, 588 Achilles, was spotted in 1906 by German astronomer Max Wolf. More than 9,800 Jupiter trojans...
(2) A "dwarf planet" is a celestial body that (a) is in orbit around the Sun, (b) has sufficient mass for its self-gravity to overcome rigid body forces so that it assumes a hydrostatic equilibrium (nearly round) shape [2], (c) has not cleared the neighbourhood around its orbit, and
CMQ: Is it possible to get all the ways to partition an infinite list? All the algorithms I'm finding require knowing the length of the target list, which isn't possible with an infinite list.
A list with countably infinitely many entries have $\beth_1$ permutations. As such, I thought uniform probability distribution over permutations of an infinite list exists, but eventually, I found that the answer is negative. Here goes the proof attempt.
A uniform probability distribution over th...
Count N-Rich Permutations of an Integer Sequence
Given a sequence of integers with length \$L\$ and an integer \$1 \le N \le L\$, an "\$N\$-rich" permutation is one whose the longest strictly increasing subsequence has length exactly \$N\$.
For example, let our sequence be [0, 1, 2, 3]. There is ...
import cv2
import numpy as np
# Load the image
image = cv2.imread('input_image.jpg')
# Get the dimensions of the image
height, width = image.shape[:2]
# Calculate the height to keep (30% of the total height)
crop_height = int(0.3 * height)
# Create a mask for the bottom 30% section
mask = np....
Python Program (97 Bytes)
Code for the Microwave Timer Project
f=lambda i:f"Lower"if (int(i[0:2])*60)+int(int(i[3:5]))>6000else(int(i[0:2])*60)+int(int(i[3:5]))
Example Input:
76:92 # String input
Example Output:
4652 # Number of seconds
Note: You do have to call the function and print it sepa...
@cairdcoinheringaahing (and non-moderators ofc) I want to test something about MathJax on your meta site. I don't really want to litter up the place, do you have a MathJax sandbox I could abuse. I'd search but I just get the question sandbox.
I love progress bars in python but I thought it be fun to have one that shows a rotating bar. That is - \ | / - \ | etc but all shown in the same place. Is there a golfy way to show these in the same place in python?
@RydwolfPrograms I love progress bars in python but I thought it be fun to have one that shows a rotating bar. That is - \ | / - \ | etc but all shown in the same place. Is there a golfy way to show these in the same place in python
First the layout of the page will be per-language customizable (so, e.g., you can remove compiler flags from brainfuck, and instead add toggles for things like cell size), and second all of the input/output boxes will have tons of options in a dropdown
Yup, hexdump will be one of the supported output formats, along with plain text, JSON-style escaped string, and terminal
The terminal one will even support interactive input
Oh one more feature request: Ability to run the same code on a whole list of test cases, to be more easily able to test full programs without needing a seperate link for each
The way headers and footers are going to work is super cool
Instead of header-code-footer, it's just one box, which you can subdivide arbitrarily. You can customize the separators and which ones are byte-counted, and even use different encodings (so that you can, e.g., intermix binary hexdumps with readable text). By default it'll be laid out in a header-code-footer system, but it's flexible enough you can use it for all sorts of stuff
Python 3, 86 83 bytes
GIF to follow. Golfing suggestions welcome as this is still a little verbose. -3 bytes thanks to Flp.Tkc.
import time
i=1
while i:print(end="\rLoading... "+"/-\|"[i%4]);time.sleep(.25);i+=1
(also the question itself is roughly equivalent to your CMC)