Search
Your task is to write a program $p$ which outputs a string $s$ with the same length as $p$, where $s \neq p$. If I remove the $n$th byte from your program to get program $q$, then either $q$ outpu...
Python 3, 68 bytes def g(n): while True:print(n);d=[*map(int,str(n))];n+=min(d)+max(d) Outputs the n-based sequence indefinitely, starting with n.
For challenges that require a input, what is the maximum a solution has to support, if not further specified by the challenge author? Lets say the input is a string, how long can of a string has t...
Input is a number, you have to decide if it is part of the mandelbrot set or not, after at least 16 iterations. This is done by applying this formula: $z_n = z_{n-1}^2 + c$ repeatedly. $c$ is the ...
A program may use IOs for input and output. A input can be read via IO, which can be a port with (multiple) IOs each IO reads a symbol (a bit or more when you have a ADC). Or it can come from fram...
A program may output a boolean value by using different amount of time or instructions till it returns. If a program needs to determine a boolean value, it may return in less than N second (or ins...
ARM Thumb machine code, 6 bytes 0: fa90 f0a0 rbit r0, r0 // reverse bits in 32-bit register 0 4: 4770 bx lr // return if bytes have to be octets (8-bit): ARM Thumb machine code...
Python, 143 bytes def r(i): y,z=65537,1+(1<<32);s=257*y*z;n=(i|(i&252*s)*y>>10|(i&254*s)*z>>17|(i&127*s)*z>>15|(i&63*s)*y>>6)&(1<<64)-1 ...
Python (3.6 and up), 32 bytes (unsigned integer I/O) lambda x:int(f'{x:08b}'[::-1],2) Input and output are int objects. This also reverses the bits in integers larger than 255, implicitly infer...
C, 30 + 1-4 byte f(m){f(printf("%0*i\n",m,0));} Has this limitations: counter stops working at INT_MAX or at stack overflow. Needs a input value to indicate on which line we start. 0 starts...
Suggest a word from a word list, given a string. Motivation Imagine typing a word one letter at a time, and seeing a suggested word after each letter is typed. At first the suggested word is simp...
C (gcc), 42 bytes c;f(i){c++<8&&(printf("%d",i&1),f(i>>1));} Try it online! Binary output version.
C (gcc), 47 bytes r,c;f(i){return c++<8&&(r=r<<1|i&1,f(i>>1)),r;} Try it online! I didn't manage to come up with anything better than the most obvious recursive im...
Recently I asked for tips on improving some code-golf of mine. The code was supposed to output every third value of the Fibonacci sequence starting with 2: 2,8,34,144,610,2584,10946,46368,196418,...
Sclipting, (UTF-16) 26 bytes 갠긂갠밂乘감뒄뀢감雙갿및剩 Uses a formula I found here unsigned char b; // reverse this (8-bit) byte b = (b * 0x0202020202ULL & 0x010884422010ULL) % 1023;
Python, 55 Bytes lambda x:chr(int(bin(ord(x))[2:].rjust(8,"0")[::-1],2)) Takes input as the actual byte, and outputs the actual byte. Try it online!
Simple challenge: Read a byte, swap bit 7 with 0, 6 with 1, 5 with 2 and 4 with 3 and then output the byte. For example the byte 0b1001'1100 would turn into 0b0011'1001. Rules: Shortest code wi...
import requests import json import numpy as np import base64 import cv2 Replace this with the actual image path you want to test image_path = 'H_L_.jpg' Read and preprocess the image image ...
R, 32 bytes \(s)intToUtf8(rev(utf8ToInt(s))) Attempt This Online!
Brainfuck, 10 Bytes ,[>,]<[.<] Requires EOF to be 0. Try it online! ,[>,]<[.<] , # Read character [ ] # loop as long as current cell is not 0 (EOF) >, ...