Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »

Activity for user‭

Type On... Excerpt Status Date
Edit Post #286855 Post edited:
over 2 years ago
Comment Post #286855 Could we return an infinite sequence of Niven numbers or return only the nth Niven number?
(more)
over 2 years ago
Edit Post #286858 Post edited:
over 2 years ago
Edit Post #286858 Initial revision over 2 years ago
Answer A: Find n Niven Numbers
Scala, 52 bytes ```scala Stream.from(1).filter(x=>x%(x+"":\0)(+-48) sum + char.toInt - '0'.toInt)`. At the end, only the first `n` Niven numbers are `take`n from the infinite list.
(more)
over 2 years ago
Suggested Edit Post #286855 Suggested edit:

(more)
helpful over 2 years ago
Edit Post #286534 Initial revision over 2 years ago
Answer A: From the smallest seed
Zsh, 61 bytes n=2;s=s=%q\;printf\ n=\$n\$n\\\;\$s\ \$s;printf n=$n$n\;$s $s Attempt This Online! A trivial modification of this quine: `s=s=%q\;printf\ \$s\ \$s;printf $s $s`. `n` goes from 2 to 22 to 2222.
(more)
over 2 years ago
Comment Post #286240 Can we use something other than asterisks?
(more)
over 2 years ago
Comment Post #285891 Oh ok (pad pad pad)
(more)
almost 3 years ago
Edit Post #285895 Initial revision almost 3 years ago
Answer A: Can you give me half?
Scala, 15 bytes ```scala '#'.toFloat/'F' ``` Try it in Scastie! Characters in Scala kinda get casted to integers. This is usually annoying, but it's useful when golfing. `#` is 35 and `F` is 70, and the `.toFloat` prevents it from doing integer division and truncating to 0.
(more)
almost 3 years ago
Comment Post #285891 I think the second works in 05AB1E too
(more)
almost 3 years ago
Edit Post #285832 Initial revision almost 3 years ago
Answer A: Keyword golfing
Scala 3, 553 bytes ```scala package a import E.Z as Z import E. sealed trait T open class Y{export E.Z as Q} enum E[+A]derives CanEqual: case Z end E private abstract final class X extends AnyRef with T{protected opaque type T>:0=0 lazy val x:X#T=0 override def toString:String={var e=0...
(more)
almost 3 years ago
Comment Post #285231 True, I've edited that out now.
(more)
almost 3 years ago
Edit Post #285231 Post edited:
almost 3 years ago
Edit Post #285478 Initial revision almost 3 years ago
Answer A: Determine whether an integer is square-free
Scala, 41 bytes ```scala x=>2 to x forall(d=>x%d+math.sqrt(d)%1>0) ``` Try it online! Pretty straightforward
(more)
almost 3 years ago
Comment Post #285477 Some testcases would be nice (sorry for not bringing this up in Sandbox)
(more)
almost 3 years ago
Comment Post #285231 Yup, those won't be given as inputs.
(more)
about 3 years ago
Edit Post #285231 Initial revision about 3 years ago
Article Create a finite projective plane of order $n$
Introduction Finite projective planes are an interesting geometric structure. A finite geometry is a system with a finite number of points, and a projective plane is a plane where every pair of lines meets at exactly one point. Finite projective planes do both of these. Here are their properties: ...
(more)
about 3 years ago
Comment Post #285064 Unfortunately, I don't this would work, as the maintainer of TIO (Dennis on CGCC) isn't too available ([context](https://chat.stackexchange.com/transcript/message/53428659#53428659)). However, there are alternatives to TIO popping up, such as [ATO](https://ato.pxeger.com)
(more)
about 3 years ago
Edit Post #285214 Post edited:
about 3 years ago
Edit Post #285214 Post edited:
about 3 years ago
Edit Post #285214 Initial revision about 3 years ago
Answer A: Find the IP address class
Vyxal, 24 bytes ``` \.€hEb:L8-0wẋf$J0ḟkA5Ẏ$i ``` Try it Online! This is absolutely abysmal but whatever. A lot of bytes are taken up by trying to pad the list with zeroes (`ẋ` was buggy or something so molding to `0 8ẋ` didn't work). Explanation: - `\.€` splits on `.` and `h` gets the firs...
(more)
about 3 years ago
Comment Post #284668 @#8056 I'm really sorry, but I'm not sure what exactly rules of inference are, I've kinda given up on this draft because I don't know enough logic to make it work. Feel free to post a version of it yourself if you want, though.
(more)
about 3 years ago
Edit Post #283796 Post edited:
about 3 years ago
Comment Post #283796 @#36356 Thanks!
(more)
about 3 years ago
Comment Post #284777 Just to be clear, this is just for IPv4, right?
(more)
about 3 years ago
Edit Post #284668 Initial revision about 3 years ago
Article Prove that $A \leftrightarrow \lnot\lnot A$ (WIP)
Task Prove that $A \leftrightarrow \lnot\lnot A$ using only the following axioms: 1. $P \rightarrow (Q \rightarrow P)$ 2. $(P \rightarrow (Q \rightarrow R)) \rightarrow ((P \rightarrow Q) \rightarrow (P \rightarrow R))$ 3. $(P \rightarrow Q) \leftrightarrow (\lnot Q \rightarrow \lnot P)$ S...
(more)
about 3 years ago
Edit Post #284586 Initial revision about 3 years ago
Answer A: Tips for golfing in Java
Abuse anonymous classes Warning: This only works in very specific circumstances, and I've never actually needed it. Instead of defining a method outside of your method, you can make an instance of an anonymous class to act as a closure. This'll only really help if what the method is closing ove...
(more)
about 3 years ago
Edit Post #284585 Initial revision about 3 years ago
Answer A: Tips for golfing in Java
Abuse the C-like array syntax If you ever have to declare two variables, one of type `X` and the other of type `X[]`, instead of two statements, you can declare them together using this atrocious syntax: ```java int i,a[],m[][]; ``` This defines an `int i`, an `int[] a`, and an `int[][] m`. ...
(more)
about 3 years ago
Comment Post #284584 Great tip! It's not just Strings, Java 9, 11, etc. added some methods to `Stream`s too (e.g. `takeWhile`). The newer versions actually makes programming in Java enjoyable. There's also `Map.of`, although that's less often needed.
(more)
about 3 years ago
Comment Post #284578 Just don't use Java :P
(more)
about 3 years ago
Comment Post #284493 @#53503 Sure, but I think "Works for me" helps you trust that someone actually tried an answer out and saw that it worked. Often, upvotes are given out without necessarily checking that a piece of code works. I think it *could* useful for proper Q&A sites, but we don't really need it.
(more)
about 3 years ago
Edit Post #284493 Initial revision about 3 years ago
Answer A: Reactions on Code Golf Codidact
I think "Dangerous" could perhaps stay on. "Outdated" would probably be better off replaced with "Invalid" or something of that sort. I don't think we need "Works for me" or an analog of it at all: I don't entirely disagree with Quintec's suggestion of "Interesting/Cool/Wow" but showing your support ...
(more)
about 3 years ago
Edit Post #279407 Post edited:
about 3 years ago
Comment Post #284001 [268](https://tio.run/##dVLLboQwDLz3KxCnXWlvvVSV@iWIQ8iaxWpIIvMS/XkaOw/60J4MztjjGdvv8@Ds65un4@g/jBq7u6q69war3lGFFdqmJrjXt3oHY9wWPh4EYEPsyG0cJ63IwMwZo/RniE4PBCF6UHoIkZZu57TBldMruojvlTQwGOq4sTNMpAennVEzQ0e1SIkmUKNEHCcnrGhWIG7uJkaor0U4DYzyTss0CUkYl8n9Qt4wYBtQWnu0Misp@wAZfoG6xV5EV117eEI7X/pL016vL@XnlM/4W...
(more)
about 3 years ago
Suggested Edit Post #279407 Suggested edit:

(more)
helpful about 3 years ago
Comment Post #284001 Here's a [311 byte](https://tio.run/##dVLLjoMwDDzDVyBORdvb3irxJaiHkJribkiQIa3an2djk8A@1JOJGXvsGY/PuXf2c1lU3ZQEl/JYPsEY9wgfVwKwIbbkHhwnrcjAzBmj9FeITvcEIY6gdB8i@fbJaYN3Tt/RrfhOSQODoY4bO8NEunfaGTUzdFBeSjSBGiTiMDlhRXMH4uZuYoR6eeE0MMh/8tMkJGFcJh89jYYBjx6l9YhWZiVlryDDeyjP@QW6oju01SnPdN2c86xzVGCBtlAhJa8bv1p...
(more)
about 3 years ago
Edit Post #283770 Post edited:
Don't use "program" or "function"
about 3 years ago
Suggested Edit Post #283770 Suggested edit:
Don't use "program" or "function"
(more)
helpful about 3 years ago
Edit Post #284191 Post edited:
Figuring out if it's a good idea is exactly what the Sandbox is for, no need to explicitly state it :)
over 3 years ago