@ASCII-only ... and because RotateTransform(3); is buggy, I tried using for (3) RotateTransform(BitwiseAnd(Cast(q), i)); but that corrupts variables... code with workaround but try appending Print(q); to see what I mean...
Task:
Given an integer input, figure out whether or not it is a Cyclops Number and, optionally, the next Cyclops number after it.
What is a Cyclops number, you may ask? This video (specifically the part after 10:06) should answer that.
Test Cases:
Input | Output
--------------
0 | falsy
...
I just spent 3 minutes on TIO thinking my screen froze when it wouldn't let me edit the output tab (trying to edit input). I need sleep...
Anonymous
3:11 AM
@Οurous If I can't tell that the math/list operations are slow with regards to everything else, then they're not irritating. That said, if everything is slow, it's super irritating.
Problem Description
We all love a Twix (because it is the best candy), but this is the kids' first Halloween --- we gotta grab at least one of each type of candy for them. Each Halloween all the residents of Numberline avenue send out an email saying what types of candy they'll be giving away th...
Introduction
The original creator of this meme has gone blind, lost his internet and accidentally deleted all his memes. Except this one. He has this one last meme on his desktop, and since he can't see, he wants to know what this meme is.
By hearing it.
Challenge
Your challenge is to write t...
https://codegolf.stackexchange.com/questions/114654/print-the-periodic-table I've decided to try and x86-64 golf this challange. I'm approaching it one step at a time, and got the first part (Drawing the table without text and without the squiggly lines) down in concept
idea i had was to use a 21 byte table that contains a 1 if a cell is at that spot, and a 0 otherwise
if you represent the crank's position as a bit on a line (i.e. 0100), you can just check if the new position is equal to it rotated (the bitwise op) left or right, and if not it's an invalid position for the crank to move into in one step
@AdmBorkBork just so you know, however, those who golf assembly are usually insane in some shape or form. ;)
(You dont want me trying to give you assembly advice when all you want is to know a good way to golf something in JS, not the dozen and a half ways you could do it in x86-64)
@Rick good luck :3
@Rick are the lists sorted already? And is it only handling consecutive duplicates or all duplicates
shortest way (and fastest for smaller inputs, i.e. 8 bit numbers) in x86-64 with both as a "no" is literally a lookup table. And if the input numbers are 32-bit, that means a 4GB lookup table
I can do it in O(n) t with O(1) s assuming they are sorted
@moonheart08 Are you are talking about bytes or space and time
here is another one, find the intersections of two lists, assume sorted, assume duplicates, assume negatives. constraints for space are O(1) and time is O(n)
I can write this ^ in 19 lines of code using 5 loops
How Many Times Have I Been Called?
code-golf self-referential self-modifying
Write a program that outputs how many times it has been called.
It should be self-modifying such that the first time the program is run, it will output 0, then 1 the second time, 2 the third time, etc...
Too lazy...
@DJMcMayhem I think this would work for 51 bytes because 1) if you test the same pair twice but reversed it doesn't affect the outcome assuming that the black box is deterministic and 2) any deterministic function is commutative when given 2 identical arguments, so no need for combinations(s,2), I think.
Write a piece of code that rips out the soul of the most coders who look at it.
popularity-contest
Obviously, I'm figuratively speaking. Please do not write code that has the capacity to interact with souls, much less rip them out.
This is the coding equivalent of an ugly baby contest, and pu...