#programmingpuzzle — Public Fediverse posts
Live and recent posts from across the Fediverse tagged #programmingpuzzle, aggregated by home.social.
-
This is an unbirthday present for @screwlisp,
who posted earlier about quines.To give it as a puzzle at first:
find a Python quine as a string Q such that eval(Q) == Q.
A spoiler to follow.
_________
The term "fixed point" comes to mind. And the Y combinator comes into
this picture as well; wie another day.(Estimating Python's degree of homoiconicity is left as an exercise.)
#ComputerProgramming
#Homoiconicity
#ProgrammingPuzzle
#Puzzle
#Python
#Quine -
This is an unbirthday present for @screwlisp,
who posted earlier about quines.To give it as a puzzle at first:
find a Python quine as a string Q such that eval(Q) == Q.
A spoiler to follow.
_________
The term "fixed point" comes to mind. And the Y combinator comes into
this picture as well; wie another day.(Estimating Python's degree of homoiconicity is left as an exercise.)
#ComputerProgramming
#Homoiconicity
#ProgrammingPuzzle
#Puzzle
#Python
#Quine -
This is an unbirthday present for @screwlisp,
who posted earlier about quines.To give it as a puzzle at first:
find a Python quine as a string Q such that eval(Q) == Q.
A spoiler to follow.
_________
The term "fixed point" comes to mind. And the Y combinator comes into
this picture as well; wie another day.(Estimating Python's degree of homoiconicity is left as an exercise.)
#ComputerProgramming
#Homoiconicity
#ProgrammingPuzzle
#Puzzle
#Python
#Quine -
This is an unbirthday present for @screwlisp,
who posted earlier about quines.To give it as a puzzle at first:
find a Python quine as a string Q such that eval(Q) == Q.
A spoiler to follow.
_________
The term "fixed point" comes to mind. And the Y combinator comes into
this picture as well; wie another day.(Estimating Python's degree of homoiconicity is left as an exercise.)
#ComputerProgramming
#Homoiconicity
#ProgrammingPuzzle
#Puzzle
#Python
#Quine -
This is an unbirthday present for @screwlisp,
who posted earlier about quines.To give it as a puzzle at first:
find a Python quine as a string Q such that eval(Q) == Q.
A spoiler to follow.
_________
The term "fixed point" comes to mind. And the Y combinator comes into
this picture as well; wie another day.(Estimating Python's degree of homoiconicity is left as an exercise.)
#ComputerProgramming
#Homoiconicity
#ProgrammingPuzzle
#Puzzle
#Python
#Quine -
#JavaScript #ProgrammingPuzzle ...
It's very simple to make a readable function to generate an increasing numerical sequence that wraps using the modulo operator.
num = 1;
1
num = (num % 3) + 1;
2
num = (num % 3) + 1;
3
num = (num % 3) + 1;
1The reverse function I came up with seems unreasonable and unreadable!
num = 3
3
num = (((num + 2) % 3) + 2) % 3 + 1;
2
num = (((num + 2) % 3) + 2) % 3 + 1;
1
num = (((num + 2) % 3) + 2) % 3 + 1;
3Am feeling tired ;-)