Comments (4)
It converts the first argument, an integer, into 8 bit binary.
Numbers 0 and 256 convert to 00000000
.
Negative numbers convert to 11111111
.
Executing without arguments will give a Segmentation fault (core dumped)
error.
Compilation generates a warning, which can be ignored.
prog.c:1:68: warning: unsafe pointer arithmetic [-Wunsafe-buffer-usage]
1 | int main(int b,char**i){long long n=B,a=I^n,r=(a/b&a)>>4,y=atoi(*++i),_=(((a^n/b)*(y>>T)|y>>S)&r)|(a^r);printf("%.8s\n",(char*)&_);}
| ^
1 warning generated.
from fh-250-puzzles.
It converts a non-negative integer x
to the binary representation of x % 256
.
It converts a negative integer to 11111111
It converts an integer and any character separated with whitespace (e.g. ./prog 3 randomstuff
) to 30"31331
from fh-250-puzzles.
With a non-zero argument input, the code returns 8 characters, based on the flow seen in the image.
With zero arguments, it throws a segmentation fault.
argc represents the number of arguments passed to the program. atoi(argv[1]) converts the argument (string) to an integer
from fh-250-puzzles.
Unfortunately, we could not figure this out too.
There are some hints here that emphasise certain binary operations.
There is a trace of the math here.
from fh-250-puzzles.
Related Issues (5)
- Code Golf: Missing Digit HOT 3
- Code Golf: Pernicious Numbers HOT 6
- Code Golf: Collatz HOT 4
- Figure it out HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fh-250-puzzles.