An IP address is a 32-bit numeric address written as four numbers separated by periods. Each number can be zero to 255.
Input: An IP address for example, 1.160.10.240
Output: 0 or 1
This is code-golf, so fewest bytes will win!
Unicode encoder
Do Invent your own Unicode 7.0.0 encoding (as efficient as possible) with score 317754. Shortest encode+decode program win.
code-golf kolmogorov-complexity
p.s. I'll expand it when posting, though
Is the Circuit Possible?
Write a program or function that takes input: all resistors available and a resistance value and outputs a truthy value of whether or not it is possible to get the resistance by using those resistors.
Rules:
Any format for input will do.The last number is the required ...
Input: A valid 6 HEX digit color code wihout a # prefix
Valid:
000000
FF00FF
ABC123
Your job is to find to which one of these:
Red: FF0000
Green: 00FF00
Blue: 0000FF
White: FFFFFF
Black: 000000
the input color is the closest too, in this case you try to only match it to blac...
I'm trying to launch a container through a custom image, that has been created by a Dockerfile.
The issue is, by default my containers are launching in 'exited' state and I am not able to see the output in my browser while typing the ip of my server.
I'm using AWS ec2 ubuntu 18.04 instance.
...
A barcode of EAN-13 symbology consists of 13 digits (0-9). The last digit of this barcode is its check digit. It is calculated by the following means (the barcode 8923642469559 is used as an example):
Starting from the second digit, sum up all alternating digits and multiply the sum by 3:
8 9 ...
An IP address is a 32-bit numeric address written as four numbers separated by periods. Each number can be zero to 255.
Valid format: a.b.c.d where a, b, c or d, can be 0 or a natural number with no leading zeros.
Output: 0 or 1
Test Cases:
Input | Output | Reason
...
As long as people are talking about perl, why does keys %ENV work but not keys (1 => 2, 3 => 4)?
Experimental keys on scalar is now forbidden at (eval 17)[/usr/share/perl5/perl5db.pl:738] line 2.
Type of arg 1 to keys must be hash or array (not list) at (eval 17)[/usr/share/perl5/perl5db.pl:738] line 2, near "4)"
From what I can tell when you pass a hash variable to a function it gets interpreted in list context anyway
Ok, I can do it by dereferencing a hashref literal. But I'm not sure why I can't just use a regular hash literal. How does perl even tell the difference between %{{1 => 2, 3 => 4}} and (1,2,3,4)?
Choose an Outcome for Maximum Drama
code-golf decision-problem
The premise of this is simple: A 10% chance is pretty unlikely, but everyone knows that a one-in-a-million chance is a sure thing!
So, write code that implements the following "dramatic" probability rules:
Take in a floating po...
Here's another one I've been thinking about . If you include Data::Dump, pp (1,2,3) will print (1,2,3). However, if you say my $str = pp (1,2,3), it will assign it to $str and not print it.This is probably less of a mystery and more "Pavel doesn't understand perl context correctly".
Here's a reasonably trivial sequence which is not in the Online Encyclopedia of Integer Sequences.
Start with an empty sequence then define each term as the number of characters required to write out, in English, all of the digits of the sequence so far without spaces.*
For reference the number...
Sale! \$38\%\$ Off All Codegolf While Stocks Last!
This is a restricted-sourcekolmogorov-complexitycode-golf challenge to produce a fixed output with no input.
The output format, however, is flexible - it may be printed to standard out, printed to standard error, returned as a list of character...
Comments would be appreciated on this proposed challenge ^ :D
Time to travel home, maybe I'll see comments and/or votes once I get back (I think it seems to be in reasonable shape already, but just wanted to run it past a few people)
Goal
In light of the World Series being around the corner, I need a program that can read the box scores and tell me what inning it is. This is complicated slightly because baseball uses an odd method to record the score. They don't write down the at-bat team's score for the inning until they've...
@ngn one has to have been in a room in the last week to be pingable, and @arc isn't showing anything
Anonymous
@LeakyNun call/cc is the way that you "return" from a function in Scheme (and related languages). Unlike direct style, where a function returns a value to an enclosing scope, continuation-passing style passes a function as an extra param, which is then invoked with the result of the function you're calling. It's kind of like using callbacks everywhere (like pre-Promise JS).