text:
Tips for golfing in Kotlin
Given Google's recent announcement of official Kotlin support for Android development, I thought it might be timely to poll the community for some awesome golfing tips for this relatively new JVM language.
Kotlin includes a unique combination of features among it's JVM siblings which makes it potentially attractive for golfing:

operator overloading
local, infix, and static extension functions
smart casts
Groovy-style type-safe builders
type aliases
ranges
an extensive functional collections package
scripting support

So, how do I squeeze the last few bytes out of my Kotlin program? One tip per answer, please.

Would there be interest in a golfing language that shortens some of Kotlin's longer names, but doesn't add a lot of extras (at least initially)? I am thinking of making common 1 letter, making string char counts shorter and adding single letter strings with only 1 quote mark?

*Common functions

Seems Kotlin golfing interest is not that high :( http://data.stackexchange.com/codegolf/query/793250/top-kotlin-golfers

I plan to start submitting more Kotlin solutions! I'll have to check out that project of yours as well.

Use + instead of toString
As one might expect, String overloads the + operator for string concatenation, like so.
print("Hel" + "lo")

However, checking the docs tells us that it accepts Any?, not just String. As stated:

Returns a string obtained by concatenating this string with the string representation of the given other object.

In other words, String + anything makes sure to call .toString() on the right hand side before concatenating. This allows us to shorten it.toString() to ""+it, a massive 8 byte savings at best and 6 bytes at worst.

Use fold instead of joinToString
Related to the above, if you're calling map and then joinToString, you can shorten that by using fold instead.
list.map{it.repeat(3)}.joinToString("")
list.fold(""){a,v->a+v.repeat(3)}

TIL fold is a thing, nice

Just as a note to be fair to joinToString, this example shouldn't use map, but instead use the transform lambda of joinToString itself: list.joinToString(""){it.repeat(3)} so the tip only saves 2 characters

About ""+it, I find "$it" more convenient because you don't need parentheses when chaining with other stuff

Starting from 1.3 you can omit args in fun main() completely, thus shaving off 18 chars (that is, the length of args:Array<String>).

Submitting Lambdas: A Guide
According to meta consensus the default for most challenges allows submitting lambdas/anonymous function bodies. Part of this consensus is that the declaration/assignment of the lambda doesn't have to be included. Take the typical lambda:
val f={a:Int,b:Int->a+b}

We can omit the declaration, that being val f= which saves us 6 bytes.
val f=              // declaration
{a:Int,b:Int->a+b}  // lambda

For the rest of this tip I will write the declaration on one line and the lambda body on the next line to make it clear that it is separate. Know that the declaration line won't count to the score; on TIO you'd include it in the Header and put the lambda as the Code (see here.)
Type Inference and You
Kotlin has a fairly robust system of type inference. If the compiler can infer the type of something, you can omit the type information. Lambdas themselves are typed; their type signatures are expressed as:
(Param1Type, ...ParamNType) -> ReturnType

Therefore, the type of the above is (Int, Int) -> Int.
The type information of a lambda can be inferred from two places:

The lambda body
The declaration/use site (when assigned to a variable with a type annotation, or passed to a function)

In the given example above, the types of the parameters are stated in the lambda body, and the return type of the lambda can be inferred by the expression in the body because the types of everything is known. This is why the type of the lambda doesn't have to be stated in the declaration; the compiler knows its complete type signature!
...but what if we did?
A Parlor Trick
val f:(Int,Int)->Int=
{a,b->a+b}

By moving the type information of the lambda into the declaration, it's removed from our actual answer. Thanks to inference, the types of a and b are known, and the return type is known, so this compiles, and it's free bytes!
Inferred it Parameter for Single-Param Lambdas
If a lambda only takes one parameter and its type can be completely inferred, you don't even have to specify a parameter in the lambda body! The inferred parameter will be named it. Take the two examples:
val shuf:(List<T>)->List<T>=
{l->l.shuffled()}
                              // -2
val shuf:(List<T>)->List<T>=
{it.shuffled()}

The compiler knows that this lambda takes one parameter and it knows what type it is, so if it isn't bound to a name in the lambda body, it is named it instead. You can use this to save 2 bytes in the degenerate case above, but if you have to refer to the parameter many times, it will be shorter to simply give it a name as in the former.
{it*it*it*it}
{n->n*n*n*n}

Lambdas With Receiver
Kotlin allows you to specify a receiver parameter for a lambda. Basically, you can rebind this inside. You indicate this lambda takes a receiver by writing the receiver type and a dot before the type signature:
Recv.(Param1, ...ParamN) -> Ret

Where this is useful is highly dependent on your approach.
val f:(Int,Int)->Int=
{a,b->a+b}
                       // -1
val f:Int.(Int)->Int=
{this+it}

Of course, what's most useful is that this is the implicit receiver of member access. So if your submission consists mostly of a call chain on one of the parameters, or you refer to a field a couple times, this is extremely useful.
val shuf:(List<T>)->List<T>=
{l->l.shuffled()}
                               // -5
val shuf:List<T>.()->List<T>=
{shuffled()}

It can be a bad call to use this instead of it e.g.

If there's only one parameter to the lambda and you don't need to call any methods on it
You need to destructure the parameter
etc.

Some Examples
Examples can help you learn!

pleTriwapt Sgpin (Triplet Swapping)
"Multiply" two strings
Count sum of all digits

Extension Functions
Extension functions can really help to reduce the names of built in methods, and chains of them, an example could be:
fun String.c() = this.split("").groupingBy{it}.eachCount()
but this only helps if:
A) The call is long enough to cancel out the definition
B) The call is repeated
Use of lambdas rather than methods
Lambdas can return without using the return keyword, saving bytes
KotlinGolfer
A project I have started here which takes pretty Kotlin code and gives posts with tests and TIO links automatically

Defining Int's in params
This will likely have some pretty specific use cases where it may be worth it, but in recent question I golfed I found I could save a few bytes by defining my variable as optional parameters rather than defining them in the function.
Example from my answer to this question:
defining variable in the function:
fun String.j()={var b=count{'-'==it}/2;var a=count{'/'==it};listOf(count{'o'==it}-a,a-b,b)}
defining variables as params:
fun String.j(b:Int=count{'-'==it}/2,a:Int=count{'/'==it})=listOf(count{'o'==it}-a,a-b,b)
because var a= is the same length as a:Int= it will be the same number of bytes to define them (this is only the case for Int) however since I now only have 1 line in the function I can drop the {} and I also drop a single ; (the other is replaced with a ,)
So if there are any functions that require defining an Int, and would be a 1 liner if you didn't define the int in the function - then doing it as a parameter will save a couple bytes

You don't need to add a ; after the imports if the last element is *
for instance, you can do this
import java.util.*import kotlin.random.*import kotlin.random.Random

even this
import java.util.*import kotlin.random.*fun main(){}

Please separate the tips by answers

The to infix function
There is a standard infix function named to that creates Pairs of two values. It's commonly used with mapOf() for defining Maps but it's can potentially be a lot shorter than the Pair() constructor.
Pair(foo,bar)   //constructor
foo to bar      //best case
(foo)to(bar)
((foo)to(bar))  //worst case

Most of the time it is better to use ranges instead of pairs (for numbers). foo..bar is shorter then foo to bar also range.last is shorter then pair.second

Destructuring in lambda arguments
Say you want to accept a Pair<*,*> in a lambda. Normally, handling this would be annoying. As an example, here's a lambda that takes a Pair and checks if the two values are equal:
{it.first==it.second}

This is long-winded and clumsy. Luckily, Kotlin allows you to destructure any destructable type (any type that implements componentN() methods, such as Pair, Triple etc.) as arguments to a lambda. So, we can rewrite this in the following way:
{(a,b)->a==b}

It looks similar to pattern matching a tuple in something like F#, and it is in many cases. But a wide variety of types in Kotlin support destructuring (MatchResult is a useful one.)
You can take more arguments, though. Say your lambda had to take a Pair and an additional value. You'd simply write the lambda signature like this:
(a,b),c->  // pair first
a,(b,c)->  // pair second

you can assign the functions (most important case is the main however) an unit type function
for instance instead of doing
fun main(){println("hello world")}
you can do
fun main()=println("hello world")
which shaves off a mere byte

The repeat function sometimes can shave off a few bytes in some cases
the repeat function basically translates to this,
for repeat(100){something(it)}
it becomes for(it in 0..100-1){something(it)}
the main problem of this is that the it starts from 0 as always and goes until times-1 which might not be ideal for some cases. I'd suggest, for any for loops, converting for loops to repeat loops and checking the byte count, like you might convert it then name the variable i instead of it etc. This will most certainly save you bytes if you use the variable "it" frequent enough.

Get STDIN
If you want to read a line, you can do readln() instead of readLine()!!


text:
How many valid programs can you write?
Backstory:
I think that my boss might finally realize that I don't any enough work, despite being paid by the hour. I want to throw him off track, by writing as many valid programs as I can to send to him. Unfortunately, due to budget cuts, my keyboard only allows each key to be pressed once.
Specification:
Write as many different valid programs as you can for your language. You may not reuse any character at any time (even within the same program). A program is "valid" is it compiles and runs without any errors (warnings are acceptable), for any given input. Your score is the number of unique programs written.
It does not matter what the program actually does. It does not need to take input, produce output, or even terminate. The only restriction is that may never return an error.
Example (JavaScript):

b=1
alert(2)

"Any given input" is a bit problematic, we often define that input can be taken as command line arguments, and most compilers/interpreters will crash given some random argument. How about any input through one particular method chosen by the answerer? For complicated challenges like this I'd personally recommend using the sandbox.

Open virtual keyboard, no keys pressed, any byte entered [/sarcasm]

Does "any given input" mean it's up to us because later on it says "It does not need to take input"?

How do you define "return an error"?

I voted to close as unclear because of the "any input" issue. (It's labelled as too broad because that's what the majority chose.)

Another thing to verify for reopen votes: do you mean "character" (in which case Lenguage wins) or "byte"?

When you say, "You may not reuse any character at any time," does that include '\n'?

If this gets reopened, I have dibs on Brainfuck; 1114104 programs (every Unicode character other than <>+-.,[])

@JonathanAllan I think it would be fair to say that there is a couple of languages that would tie.  For example every single character program for Cubix qualifies for this challenge, as they would never be hit and terminating is not a requirement in this challenge.

There are plenty of languages in which all possible strings of characters are valid programs. This isn't a very interesting challenge in those languages.

Yes, this is problematic in many esoteric languages, but it can be a very interesting challenge in others! My recent "How high can you count" challenge resulted in two gold badges and is somewhat similar to this one. A few suggestions off the top of my hat: 1. Ban languages where every single character is a valid complete program (e.g. Pingpong). 2. Ban symbol independent languages (Lenguage). 3. Require that the program does something (to disallow "programs" that consists of no-ops). 4. Skip the "any input" rule. I suggest you change the rule to: "The programs may optionally take input.".

APL (Dyalog Unicode) version 16.0, 8384 programs
⍝ empty program
 ⍝ single space
	⍝ single tab
0
1
2
3
4
5
6
7
8
9
+
-
×
÷
⌈
⌊
*
⍟
|
!
○
~
∨
∧
⍱
⍲
<
≤
=
≥
>
≠
≡
≢
⍴
,
⍪
⍳
↑
↓
?
⍒
⍋
⍉
⌽
⊖
∊
⊥
⊤
⍎
⍕
⌹
⊂
⊃
∪
∩
⍷
⌷
→
⎕
1 2 3           ⍝ input for above program
⍞
Hello, World!   ⍝ input for above program
/
⌿
\
⍀
¨
&
⍨
⌶
#
⊆
⊣
⊢
⌸
⍸
⍝
⋄
L:
⍬
{}
⍝ just a newline
⍝ this line belong with the previous one

Try it online! (except for two which cannot run on TIO's version 15.0)
Explanations:
Most of the programs just print their content. Exceptions are:

The four whitespace ones do nothing.
→ terminates
⎕ asks for evaluated input
⍞ asks for character input
⍝ is a comment
⋄ is a statement separator (i.e. two statements that each do nothing)
⍬ prints an empty numeric list (i.e. just a newline)

@Uriel I keep forgetting that this isn't that other challenge.

Yup. These should already have a tag, like polysnippets or something else

Jelly, 225 programs
(empty program)
¢
¤
¥
¬
®
µ
½
Æ
Ç
Ñ
×
Ø
Œ
ß
æ
ç
ð
ı
ȷ
ñ
÷
ø
œ
  (space)
!
$
%
&
(
)
*
+
,
-
.
0
1
2
3
4
5
6
7
8
9
:
;
<
=
>
A
B
C
D
E
F
G
H
I
J
K
L
N
O
P
Q
R
S
U
V
W
X
Y
[
]
^
_
a
b
c
e
f
g
h
i
j
k
l
m
n
o
p
q
r
u
v
w
x
|
~
¶
°
¹
²
³
⁴
⁵
⁶
⁷
⁸
⁹
⁺
⁻
⁼
⁽
⁾
Ɓ
Ƈ
Ɗ
Ƒ
Ƙ
Ɱ
Ɲ
Ƥ
Ƭ
Ʋ
Ȥ
ɓ
ƈ
ɗ
ƒ
ɦ
ƙ
ɱ
ɲ
ƥ
ʠ
ɼ
ʂ
ƭ
ʋ
ȥ
Ạ
Ḅ
Ḍ
Ẹ
Ḥ
Ị
Ḳ
Ḷ
Ṃ
Ṇ
Ọ
Ṛ
Ṣ
Ṭ
Ụ
Ṿ
Ẉ
Ỵ
Ẓ
Ȧ
Ḃ
Ċ
Ḋ
Ė
Ḟ
Ġ
Ḣ
İ
Ṁ
Ṅ
Ȯ
Ṗ
Ṙ
Ṡ
Ṫ
Ẇ
Ẋ
Ẏ
Ż
ạ
ḅ
ḍ
ẹ
ḥ
ị
ḳ
ḷ
ṇ
ọ
ṛ
ṣ
ṭ
ụ
ṿ
ẉ
ỵ
ẓ
ȧ
ḃ
ċ
ḋ
ė
ḟ
ġ
ḣ
ṁ
ṅ
ȯ
ṗ
ṙ
ṡ
ṫ
ẇ
ẋ
ẏ
ż
«
»
‘
’
“
”

224 characters in Jelly's 256-byte codepage are valid, non-error-throwing programs on their own, plus an empty program. The other characters could be used in literals, but since all the literal-denoting characters are already in use on their own, no new programs can be made from them.
All of these were tested, one by one, on tio.run.

@JonathanAllan Not according to the codepage. Are you thinking of a linefeed?

Oopsie yes I was!

You could add t€, d/ and s\ .

The rules are rather unclear to me, but many of these programs error given certain inputs.

The any input might trounce this count :( (was about to suggest changing d/ to t/ and adding dþ).

Yeah... string input would break nearly all the arithmetic atoms. Shame. The rules are a tad unclear so my fingers are crossed for my answer!

You can add the program that consists of a single newline.

@Adám that would be the pilcrow (same byte).

@JonathanAllan No, Jelly can understand both when using Unicode, and since this isn't code-golf, you should.

@Adám Hmm it says "character" so I guess literally speaking, they are different programs even though they are the same program. Looks like a win for Lenguage.

@Adám I see your point, but since Jelly's default is to use that codepage, I would say they're the same character. There are a few other consensuses saying basically "go with whatever your language uses" so I'm confident in saying that here.

@Christian Is that really the default? TIO certainly uses Unicode.

@Adám if a language defines its own codepage, it makes sense to define its encoding based on that codepage, does it not?

@Christian No, then you may use an encoding based on that code page. The prototypical example would be APL, which can use its code page. but can also use Unicode when advantageous. In fact, I do so in my answer, to maximize my score. If I didn't, I'd have to leave out three of my programs, ⌸, ⊆, and ⍸.

Python REPL, 24 programs
[empty]
[space]
[tab]
[newline]
0
1
2
3
4
5
6
7
8
9
sum
pow
chr
next
id
()
{}
[]
#
\

How about this set of six... sum, pow, id, all, chr, next? Also _ is valid.

@JonathanAllan all isn't valid because internal repeats aren't allowed.

@xnor oh yeah :p well five there, maybe there is another set of six somewhere...

...in which case hash, '', ..., and "" must go.

@JonathanAllan _ on a clean repl would throw a name error - it is assigned only after each evaluation

Ahha, yes, that it would, good catch.

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

sort: votes


text:
Decode my I2C Stream!
From the sandbox!
I2c or TWI, is a 2 way stream that uses 2 signal lines: SDA and SCK. This is used in sensors to communicate between a master and a slave.
So, how does this work? Well, here's the boilerplate:
Input:
1 I2c command represented by 2 strings where - is a high signal, and _ is low. SDA is always the first string.
Output:
The debug info for that command, including weather
it's a READ or WRITE,
which address it's to (in Hex), and
what memory the signal's addressing(in Hex).
if the transmission is invalid, print "Invalid"
How does I2c work, then?

Image from Sparkfun!
An i2c request has 2 9-bit parts. the address and the payload. The address comes first.
A bit is only READ when the clock signal goes from LOW to HIGH. Going from HIGH to LOW is not a valid reading event.
The address is 7 bits, which come after both SDA and SCL are LOW. This is sent by the master.
After the 7th bit, the next is sent by the master, which is the READ Bit. If this bit is HIGH, then it's a READ operation, if the bit is LOW, then it's a WRITE operation.
After the 8 bits, the slave responds with an ACK bit, if the ACK bit is HIGH, then the entire transmission is invalid.
Then, the second transmission is sent.
The first 8 bits represent the data address that the master is READing or WRITEing.
and the final bit is the 2nd ACK bit. If this bit is HIGH, then the entire transmission is invalid.
Examples:
Raw IN: ["--____--__----__----__----__--__--__","___-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-"]
SDA: --____--__----__--__--__----__--__--__
SCK: ___-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-
Result: 0 0 1 0 1 1 0 1 0 1 0 1 1 0 1 0 1 0
Parse:  addr[22] op:[R] data:[181] success[yes]
out: address:0x16 op:Read data:0xB5

Raw IN: ["--____--__----__------__----__--__--__","___-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-"]
SDA: --____--__----__------__----__--__--__
SCK: ___-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-
Result: 0 0 1 0 1 1 0 1 1 1 0 1 1 0 1 0 1 0
Parse:  addr[22] op:[R] data:[181] success[No]
out: invalid
Note: (the ACK bit flipped high);

Raw IN: ["--_-_--__--_-__--_-_-__-_-_-_--__--__-","___-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-"]
SDA: --_-_--__--_-__--___-__-_-_-_--__--__-
SCK: ___-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-
Result: 0 0 1 0 1 1 0 1 0 1 0 1 1 0 1 0 1 0
Parse:  addr[22] op:[R] data:[181] success[yes]
out: address:0x16 op:Read data:0xB5
Note: (the bit before the change is read.);

Raw IN: ["--_____--___-----___--___--___-----__---____--____","___--_-_--_--_-_--_-_--_-_--_-_--_-_--_-___-_--__-"]
SDA: --_____--___-----___--___--___-----__---____--____
SCK: ___--_-_--_--_-_--_-_--_-_--_-_--_-_--_-___-_--__-
Result: 0  0 1  0  1 1  0 1  0 1  0 1  1 0  1   0 1   0
Parse:  addr[22] op:[R] data:[181] success[yes]
out: address:0x16 op:Read data:0xB5
Note: (Clock signals Don't have to be perfect.);

Raw IN: ["--_____--___-----___--___--___-----__---____--____","___---_-_--_-___-_--__-"]
SDA: --_____--___-----___--___--___-----__---____--____
SCK: ___---_-_--_-___-_--__-
Result: 0   0 1  0   1 0   1
Parse:  Invalid
out: invalid
Note: (They do however, have to match the length of the data dignal.);

Extra rules:
The 0x prefix must be appended to all hex values in the output, as a formality.
The input is strictly - for HIGH and _ for LOW, and will always be 2 separate strings with a separator character.
If both SDA and SCL change at the same time, then the previous bit is read.
This is a code golf, so whoever creates a running program in the least number of bytes wins! Good luck

Is the third example incorrect..? It seems that the first result bit should be set.

@TylerMacDonell i looked it over,  and it is correct.  For this,  imagine that sda is pushed forward (right)  half a character

Oops, misunderstood this part: If both SDA and SCL change at the same time, then the previous bit is read.

"The 0x prefix must be appended to all hex values in the output" Do you mean "prepended"?

I'm a bit disappointed that you didn't take most of my Sandbox feedback into account. (For example, the output format is still underspecified; your Java "model answer" doesn't match the format given in the test cases, and most of the details of the format are left entirely unspecified in the prose.) This makes it hard to compete fairly, because it's unclear how many corners can be cut in the format to save bytes.

@ais what do you mean? I added the extra rules section for that

As a simple example, you have address: in the test cases, and Addr:  in your model answer. Those are different numbers of bytes. Just how much can someone abbreviate those whilst still complying with the question? As this is [tag:code-golf], any abbreviation that could be used there, must be, in order to save bytes. Additionally, there are some cases that are relevant, but don't come up in your testcases (such as leading zeroes on the addresses), so it's unclear how they should work. These aren't the only problems either.

@ais leading zeroes are like any other number, i don't think i understand.  You mean instead of writing 0010110, writing 10110, right?

If the address is 12 (decimal), is that written as 0x0C or 0xC, or does it not matter? (If you'd followed my advice in the Sandbox to allow a more flexible output format, this sort of thing wouldn't be an issue.)

@ais output is pretty flexible. As long as you use the 0x notation and have a designator for each of the three data types, I'd say you're valid.  The output shouldn't be as much of a problem as the input.

Concretely: what's the shortest possible designator for each of the three values? This needs to be stated in the question!

@ais523 it's flexible, it could be any one character token that you like, so long as it's documented in your answer.

The SDA and SCK in the first example's raw input does not match the signals on the following two lines

I did this once in college, that was enough lol.

GNU sed, 427 378 364 + 1 = 428 379 365 bytes
+1 byte for -r flag. Takes colon-separated input. Output format is e.g. a0x16oRd0xB5, where a precedes the address, o precedes the operation (R or W), and d precedes the data.
Why do I do this to myself?
s/^/:/
:Q
s/:.+:$|::./E/
s/:(.).(.*):_-/\1:x\2:x/
s/:./:/g
tQ
s/(.{7})(.)(.)(.*)(.):/#\3\1%\2#\5\4:/
/#-|E/{z;iinvalid
q}
s/#./#/g
:R
s/[:%]/!u0;%0123456789ABCDEF,/
:A
s/((-)|_)!/!\2/
s/!-(u+)(.+);/!\1\2;\1/
:
/u%/!bZ
s/F;/;0/
t
s/(.);(.*%.*\1)(.)/\3\2\3/
s/u;/u1/
s/u(u*)%/;\1%/
b
:Z
s/!(u+)/!\1\1/
/#!/!bA
s/#!u+(.+);.+,/\1/
/:/bR
s/(..)(.)/a0x\1o\2d0x/
y/-_/RW/

Try it online!
Explanation
The code works in two phases. In phase 1 we turn the two signals into a single binary string. This is the easy part.
# Prepend a `:`
s/^/:/
:Q
  # Check for length mismatch (one string exhausted before the other)
  s/:.+:$|::./E/

  # If the first two characters of SCK are `_-`, record first character of SDA
  # and discard second; replace each pair with `x` so we can unconditionally...
  s/:(.).(.*):_-/\1:x\2:x/

  # ...consume a character from each signal
  s/:./:/g

  # If we did a substitution, branch to :Q
  tQ

If this was our input:

--_____--___-----___--___--___-----__---____--____:___--_-_--_--_-_--_-_--_-_--_-_--_-_--_-___-_--__-

...we now have this:

__-_--_-_-_--_-_-_:

Before phase 2, we reformat this to make it a little easier to work with:
# Reformat `.......ma........b:` to `#a.......%m#b........:`
s/(.{7})(.)(.)(.*)(.):/#\3\1%\2#\5\4:/

# Check if ACK high or length mismatch; if either, print error and quit
/#-|E/{z;iinvalid
q}

# Delete ACK bits
s/#./#/g

Now we have:

#__-_--_%-#-_--_-_-:

In phase 2, we convert each run of _ and - (0 and 1) to a hexadecimal number. Because sed doesn't do math, this is almost half of the code. It actually takes each binary digit, converts it to unary, and then increments the hexadecimal number once for each unary digit.
:R
# Initialize: u = magnitude (unary 1); 0 = running sum (decimal); lookup table
s/[:%]/!u0;%0123456789ABCDEF,/

:A
  # Take the least-significant bit; if it's 0 drop it
  s/((-)|_)!/!\2/

  # If 1 (-), remove it and copy current magnitude (`u+`) after `;`
  s/!-(u+)(.+);/!\1\2;\1/

  # Increment number for each `u` after `;`
  # e.g. 12;uu -> 13uu -> 13;u -> 14u -> 14;
  :
    # No more `u`s, branch to :Z
    /u%/!bZ

    # Carry: 1F;u -> 1;0u -> 20u -> 20;
    s/F;/;0/
    t

    s/(.);(.*%.*\1)(.)/\3\2\3/
    s/u;/u1/

    # Drop a `u`; branch to `:`
    s/u(u*)%/;\1%/
    b

  :Z
    # Double magnitude: !uu3 -> !uuuu3
    s/!(u+)/!\1\1/
    # If there are binary digits left, branch to :A
    /#!/!bA

# Clean up
s/#!u+(.+);.+,/\1/

# Branch to :R for the second number
/:/bR

# Format output
s/(..)(.)/a0x\1o\2d0x/
y/-_/RW/

Before formatting, we have:

16-B5

All that remains is to add a prefix to each hexadecimal number change the operation (- or _) to read (R) or write (W), giving us:

a0x16oRd0xB5

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
Do you like Taekwondo?
Choi Hong Hi died on the 15th June 2002 at the honorable age of 83. He founded Taekwondo.
15 years after his death, I would like to be a Taekwondo master. This is my time to shine !
Task
Given a string you should output a Taekwondo version.
Rules

You will receive a non-empty string/sentence by any valid input
You must replace each titles (case insensitive)  by the revised romanization equivalent.
You must add , *side kick* at the end of the sentence because I like to do side kicks.
You must output this changed sentence as a string.
This is code-golf you should aim to minimize the byte count of your answer

Examples
"I am a Student and I do Taekwondo twice a week"
  => "I am a Geup and I do Taekwondo twice a week, *side kick*"

"I am a Teacher willing to be a President"
  => "I am a Gyosa nim willing to be a Gwanjang nim, *side kick*"

List of titles
English             =>  Revised Romanization
============================================
President           =>  Gwanjang nim
Founder             =>  Gwanjang nim
Master instructor   =>  Sabeom nim
Teacher             =>  Gyosa nim
Black Belt          =>  Dan
Student             =>  Geup
Color Belt          =>  Geup
Master level        =>  Godanja

case insensitive? and is a space needed before *side kick*

@LiefdeWen Yes Teacher == teacher == tEaCher

@LiefdeWen The space is obviously needed. How can you do a side kick without space between you and your opponent ?

As a Korean guy, I approve of this challenge. But I must say that Geup (급) doesn't really mean 'student.' Haksaeng (학생) would be better. Also, you would use Sabeom nim (사범님) instead of Gyosa nim (교사님) when it comes to martial arts instructor, regardless of the mastery (The word Gyobeom nim (교범님) exists, but it's rarely used).

Will you make changes as a consequence of JungHwanMin's comment? (to be sure I won't post an answer that will become invalid afterwards)

I'm guessing that those labels came from the Wikipedia page, but they're wrong nonetheless.

Any chance the input to end in punctuation? “I'm strong!” → “I'm strong! *side kick*” (no comma after punctuation) or “I'm strong!” → “I'm strong, *side kick*!” (insert before punctuation) would add a little twist.

side kick is different of side-kick

Are the titles guaranteed to be whole words? I mean, should “I run in presidential election” become “I run in Gwanjang nimial election, *side kick*”?

Dan is a blackbelt in Taekwondo is always true.

@JungHwanMin Thanks for the comment. I only took the translation from wikipedia

@Mr.Xcoder It won't change

@sergiol Question updated

@manatwork The end of the sentence is not important. Just add , *side kick*

@manatwork Yes the title should be the full word

Can we assume that the input will always contain a title to translate?

@Titus Yes always a title

Retina, 154 bytes
i(`president|founder
Gwanjang_
master instructor
Sabeom_
teacher
Gyosa_
black belt
Dan
student|color belt
Geup
master level
Godanja
_
 nim
$
, *side kick*

Try it online!

PHP, 241 bytes
<?=preg_replace(["#\b(President|Founder)\b#i","#\bMaster instructor\b#i","#\bTeacher\b#i","#\bBlack Belt\b#i","#\b(Studen|Color Bel)t\b#i","#\bMaster level\b#i"],[Gwanjang.$n=" nim",Sabeom.$n,Gyosa.$n,Dan,Geup,Godanja],"$argn, *side-kick*");

Try it online!

As I count, it would be shorter with str_ireplace().

Unclear what “You must output this changed sentence as a string.” actually means, but given the side kick must always be added, I would say the sentence will always change, so something should always be output. For example in case of input like “Me coder, no Taekwondo”.

@manatwork It is say valid input. Under valid input I assume a input with a title. Your count with str_ireplace was right

There seems to be enough “ nim” to worth a variable: [$a=Gwanjang.$n=" nim",$a,Sabeom.$n,Gyosa.$n,….

@manatwork Yes it saves two bytes. I have tried a version with additional strtr but it saves nothing

Fails for "presidential" ... that should not be translated. Add a couple of \bs to all your regexes, drop the str_ireplace approach. And: won´t preg_filter fail if there is nothing to translate?

@Titus I know! Are your examples valid inputs? In this case I would change my approachs. And then we must handle special characters for the regex we must add a preg_quote

Read the comments on the question: the title should be the full word. I don´t see any special char in the given titles; so no need for escaping. Apart from these issues: there´s probably no shorter approach than those 238 bytes.

@Titus fixed 238?

Oh right ... I forgot the parentheses.

C#, 262 bytes
s=>{for(int i=0;i<8;)s=s.ToUpper().Replace("PRESIDENT|FOUNDER|MASTER INSTRUCTOR|TEACHER|BLACK BELT|MASTER LEVEL|STUDENT|COLOR BELT".Split('|')[i],(i<2?"GWANJANG":i>3?"GEUP":"SABEOM|GYOSA|DAN|GODANJA".Split('|')[i-2])+(i++<4?" NIM":""));return s+", *SIDE KICK*";}

Full/Formatted version:
class Program
{
    static void Main(string[] args)
    {
        System.Func<string, string> f = s =>
        {
            for (int i = 0; i < 8;)
                s = s.ToUpper().Replace("PRESIDENT|FOUNDER|MASTER INSTRUCTOR|TEACHER|BLACK BELT|MASTER LEVEL|STUDENT|COLOR BELT".Split('|')[i],
                                        (i < 2 ? "GWANJANG"
                                               : i > 3 ? "GEUP"
                                                       : "SABEOM|GYOSA|DAN|GODANJA".Split('|')[i-2])
                                        + (i++ < 4 ? " NIM" : ""));

            return s + ", *SIDE KICK*";
        };

        System.Console.WriteLine(f("I am a Student and I do Taekwondo twice a week"));
        System.Console.WriteLine(f("I am a Teacher willing to be a President"));

        System.Console.ReadLine();
    }
}

We should ask if *SIDE KICK* can be in this form, in the examples it was lowercased

@Mr.Xcoder The comment on the OP says it is case-insensitive, either way it isn't a change in byte count. Also a kick in upper case is more powerful so it should be allowed...

Yes, just making that remark... This answer is Lethal anyways :))

Retina, 163 bytes
i`President|Founder
Gwanjang¶
i`Master instructor
Sabeom¶
i`Teacher
Gyosa¶
i`Black Belt
Dan
i`Student|Color Belt
Geup
i`Master level
Godanja
¶
 nim
$
, *side kick*

Try it online!

tcl, 212
puts "[string map -nocase {President Gwanjang\ nim Founder Gwanjang\ nim Master\ instructor Sabeom\ nim Teacher Gyosa\ nim Black\ Belt Dan Student Geup Color\ Belt Geup Master\ level Godanja} $argv], *side kick*"

demo

@manatwork: fixed.

Python 3, 281 bytes
import re
x=input();a="Gwanjang";b=" nim";c="Geup";d="Master";e=" Belt"
for i in range(8):x=re.sub("(?i)"+["President","Founder",d+" instructor","Teacher","Black"+e,"Student","Color"+e,d+" level"][i],[a+b,a+b,"Sabeom"+b,"Gyosa"+b,"Dan",c,c,"Godanja"][i],x)
print(x+", *side kick*")

Try it online!

JavaScript (ES6), 251 bytes
a=>a.replace(RegExp(b='president|founder|master instructor|teacher|black belt|student|color belt|master level','gi'),c=>((d='Gwanjang nim|')+d+'Sabeom nim|Gyosa nim|Dan|Geup|Geup|Godanja').split`|`[b.split`|`.indexOf(c.toLowerCase())])+', *side kick*'

Try it online!
This is not as compact as it could be since JavaScript is so verbose, but it's a great question. I recognized most of these terms as I am a 2nd Dan Black Belt in Taekwondo.
Explanaion
a=>
  a.replace(                                    // Replace on input string
    RegExp(                                     // Regex matching English phrases
      b='president|founder|master instructor|teacher|black belt|student|color belt|master level',
      'gi'                                      // Match all, case insensitive
    ),
    c=>
      ((d='Gwanjang nim|')+d+                   // Duplicate string portion
        'Sabeom nim|Gyosa nim|Dan|Geup|Geup|Godanja') // Add remaining phrases
      .split`|`                                 // Split into array by pipe
        [b.split`|`.indexOf(c.toLowerCase())])  // Access Korean phrase by corresponding index of matched English phrase
      +', *side kick*'                          // I like to do side kicks

JavaScript (ES6), 233 bytes
s=>(btoa`>·¬×§·mÁ©ãjx4)µ§uêö§©àÒx¦ÔÆ¬µêô{-®ç-¢½i·¨IâTÞiÈ^¯a²¢Æ´)µV@^Ýj}R¶ç^Ýzêu
h¯@^Ýzêu1«-z½%z÷¥ØjjxÚ`.split(0).join` `.split`1`.map(d=>([a,b]=d.split(/2+/),s=s.replace(RegExp(a,'gi'),b))),s+', *side kick*"')

f=
s=>(btoa`>·¬×§·mÁ©ãjx4)µ§uêö§©àÒx¦ÔÆ¬µêô{-®ç-¢½i·¨IâTÞiÈ^¯a²¢Æ´)µV@^Ýj}R¶ç^Ýzêu
h¯@^Ýzêu1«-z½%z÷¥ØjjxÚ`.split(0).join` `.split`1`.map(d=>([a,b]=d.split(/2+/),s=s.replace(RegExp(a,'gi'),b))),s+', *side kick*"')

console.log(f('I am a Teacher willing to be a President'))

JavaScript (ES6), 243 bytes
s=>(`President${A=':Gwanjang nim|'}Founder${A}Master instructor:Sabeom nim|Teacher:Gyosa nim|Black Belt:Dan|Student:Geup|Color Belt:Geup|Master level:Godanja`.split`|`.map(r=>([a,b]=r.split`:`,s=s.replace(RegExp(a,'gi'),b))),s+', *side kick*')

f=
s=>(`President${A=':Gwanjang nim|'}Founder${A}Master instructor:Sabeom nim|Teacher:Gyosa nim|Black Belt:Dan|Student:Geup|Color Belt:Geup|Master level:Godanja`.split`|`.map(r=>([a,b]=r.split`:`,s=s.replace(RegExp(a,'gi'),b))),s+', *side kick*')

console.log(f('I am a Teacher willing to be a President'))


text:
Draw an ASCII cuboid
Given three integers >= 2, create an ASCII cube in an orthogonal (cabinet) projection.
The three integers represent height, width and depth (measured in visible characters) including the corners. The corners should be 'o's or '+', free choice.
w: 10, h: 5, d: 4
Thus gives:
   o--------o
  /        /|
 /        / |
o--------o  |
|        |  o
|        | /
|        |/
o--------o

Now, to make this slightly harder, all faces can either be solid, transparent or missing.
We order the faces like this:
   o--------o
  /        /|
 /    2   / |
o--------o 3|
|        |  o
|   1    | /
|        |/
o--------o

  ---
  |2|
-------
|5|1|3|
-------
  |4|
  ---
  |6|
  ---

And supply a list of tokens, S, T or M. The original example is thus:
w 10
h 5
d 4
S S S S S S

   o--------o
  /        /|
 /        / |
o--------o  |
|        |  o
|        | /
|        |/
o--------o

If one face is transparent, we can see anything that is behind it:
T S S S S S

   o--------o
  /        /|
 /        / |
o--------o  |
|  o-----|  o
| /      | /
|/       |/
o--------o

T T T T T T

   o--------o
  /|       /|
 / |      / |
o--------o  |
|  o-----|--o
| /      | /
|/       |/
o--------o

For pairs of missing faces, adjacent edges or corners are no longer visible:
M M S S S S

   o--------o
  /|       /|
 / |      / |
o  |     o  |
|  o-----|  o
| /      | /
|/       |/
o--------o

M M S S M S

   o--------o
   |       /|
   |      / |
   |     o  |
   o-----|  o
  /      | /
 /       |/
o--------o

Code golf, shortest code wins!
Trailing spaces and newlines are fine, you're free to choose input method and input order.

How strict is your input format? can I make a function with 9 parameters?

@LiefdeWen you're free to choose input method and input order. And as nothing says otherwise, any of the default input/output methods can be used.

Can I take an integer as bitmap for the transparent/solid flags?

@Titus Well.. alright. I guess it's a bit more entertaining if you actually can test the values by your self.

Charcoal, 190 181 bytes
ＮωＡ⁻ω²ςＮηＡ⁻η²γＮδＡ⁻δ²χＡ⪪Ｓ αＦ›⊟αMＦ⟦ςγςγ⟧«oκ↶»Ｆ∧›⊟αM²«oς↷³oχ↷¹»Ｆ∧›⊟αM²«↷³oχ↷³oγ↶»Ｍ⁻ωδ⁻δηＦ⁼§α²SＧ↗δ↓η↙δ↑η Ｆ∧›⊟αM²«↶¹oχ↷³oγ↷»Ｆ⁼§α¹SＧ↗δ←ω↙δ→ω Ｆ∧›⊟αM²«↶¹oχ↶³oς»Ｆ⁼§α⁰SＵＯ±ωη ↷Ｆ›⊟αMＦ⟦γςγς⟧«oκ↷

Try it online! Link is to verbose version of code. Edit: Saved 9 bytes by optimising my conditions. Charcoal has no else token, so if commands always have two alternatives, unless they're at the end of a block or program. To avoid this, I use for (<bool>) instead of if (<bool>) which has a similar effect when the expression can only have the values 0 or 1 but saves a byte. (In order to achieve this I had to change the expressions so that they were always true when the body needed to be executed.) I was also able to optimise if (<bool>) for (<int>) into for (And(bool, int)).

Holy Christ O_O. I couldn't even figure out how to draw the cube itself using charcoal. Can you put up an example to draw a simple cube on the github examples folder? One that's been optimized? I want to compare my like... 50 byte answer to what it should've been.

@carusocomputing Sorry, I'm unclear as to what you mean by "simple cube", and I'm not an author of Charcoal itself, so I can't add an example.

You aren't?! Holy crap, who is? I honestly thought you were. Also, I'd ask to be a charcoal contributor. You could easily become one on github :). You're talented in the language, obviously. And by "simple cube" I mean the first half of the challenge, just making an X * Y * Z ASCII cube.

@carusocomputing ASCII-only is the main contributor as far as I can tell, although the esolang wiki does credit a second contributor.

at the very least I'd contact them with a few of your examples, you've taken it further than anyone else I've seen. I'd love to get more explanations of your code, I've followed your Charcoal answers for a bit now because the language is interesting to me.

@carusocomputing 50 bytes? Not bad! My first attempt was 56 bytes, but I was eventually able to pare it down to 29: Try it online!

@Neil I can give you edit permissions to Charcoal if you want

JavaScript (ES6), 318 314 308 bytes
Takes width, height and depth as integers and the faces as an array of characters.
(w,h,d,l,M=(n,F)=>[...Array(n+1).keys()].map(F),a=M((L=w--+d)*(h--+--d),i=>++i%L?' ':`
`),D=(t,Y=0,X=d,W=t&1?d:w,H=t&2?d:h,F=l[t>>2])=>F>'R'&&M(W,i=>M(H,j=>a[p=L*(Y+j-i*(t&1))+X+i-(t&2?j:0)]=(x=!(i&&i-W)|2*!(j&&j-H))?' |-o|/o/-o'[t%4*3+x]:a[F>'S'?p:0])))=>D(20)&D(D(14,h)&D(17,d,0),d,D(9,d,w)&D(6))||a.join``

How?
The function M() processes a given callback F on a given range [0...n].
M = (n, F) => [...Array(n + 1).keys()].map(F)

The variable a holds a flat array representing a grid of size (w+d) x (h+d-1). It is initially filled with rows of spaces terminated with newlines.
a = M((L = w-- + d) * (h-- + --d), i => ++i % L ? ' ' : '\n')

The function D() is used to 'draw' a face of the cuboid.
The two least significant bits of the parameter t hold the face type:

0 = rear / front
1 = left / right
2 = bottom / top

Bits #2 to #4 hold the 0-based face index.
D = (                                           // given:
  t, Y = 0, X = d,                              // - the type and the initial coordinates
  W = t & 1 ? d : w,                            // - the drawing width
  H = t & 2 ? d : h,                            // - the drawing height
  F = l[t >> 2]                                 // - the character representing the status
) =>                                            //
  F > 'R' &&                                    // provided that the face is not missing:
  M(W, i =>                                     // for each i in [0...W]:
    M(H, j =>                                   //  for each j in [0...H]:
      a[                                        //    update the output
        p = L * (Y + j - i * (t & 1)) +         //    at position p
            X + i - (t & 2 ? j : 0)             //
      ] =                                       //    with either:
      (x = !(i && i - W) | 2 * !(j && j - H)) ? //    - '|', '-' or '/' on edges
        ' |-o|/o/-o'[t % 4 * 3 + x]             //    - or 'o' on vertices
      :                                         //
        a[F > 'S' ? p : 0]                      //    - or a space on solid faces
    )                                           //    - or the current character on
  )                                             //      transparent faces

Faces are drawn in the following order:
D(5 * 4 + 0, 0, d)  // face #5 (rear)
D(3 * 4 + 2, h, d)  // face #3 (bottom)
D(4 * 4 + 1, d, 0)  // face #4 (left)
D(2 * 4 + 1, d, w)  // face #2 (right)
D(1 * 4 + 2, 0, d)  // face #1 (top)
D(0 * 4 + 0, d, 0)  // face #0 (front)

Demo

let f =

(w,h,d,l,M=(n,F)=>[...Array(n+1).keys()].map(F),a=M((L=w--+d)*(h--+--d),i=>++i%L?' ':`
`),D=(t,Y=0,X=d,W=t&1?d:w,H=t&2?d:h,F=l[t>>2])=>F>'R'&&M(W,i=>M(H,j=>a[p=L*(Y+j-i*(t&1))+X+i-(t&2?j:0)]=(x=!(i&&i-W)|2*!(j&&j-H))?' |-o|/o/-o'[t%4*3+x]:a[F>'S'?p:0])))=>D(20)&D(D(14,h)&D(17,d,0),d,D(9,d,w)&D(6))||a.join``

let update = _ => O.innerHTML = f(W.value, H.value, D.value, [...F.value])
update()
Width <input id="W" size="3" value="10" oninput="update()" />
Height <input id="H" size="3" value="5" oninput="update()" />
Depth <input id="D" size="3" value="4" oninput="update()" />
Faces <input id="F" size="6" value="MMSSMS" oninput="update()" />

SOGL V0.11, 200 194 193 192 190 bytes
b³@*⁶
ž}1}X⁵
;aκ⁴
2-³
* o1Ο²
d=?a³:?∫:¹
be.Aā6∫D,ζLI%:C?abe"DCa∫:c+H⁴d+ /ž}{"a+Hy"e³┐²čž|"b³┌²žz"EBAøp”,ōkB°s9θW=*↑(⅜⅞~υ=\⁰ōwūΧ►ΣΤP░¶Ο⁽◄Φ7⅟▲s#‘┌Θdwι+#¶ŗ!!6c=?6d=?2aI⁶e³∙ž}5¹b+⁴Ie³@∙⁵}4¹2+⁴⁶⁵

Takes input in the order
width
height
depth
down-face
left-face
back-face
top-face
right-face
front-face

Tied!
Try it Here! (compressed value changed to be V0.12 compatible)


text:
Number of values between input and next highest square
Given a positive square number as input. Output the number of values between the input and next highest square.
Example
Input: 1
Output: 2
Reason: The numbers 2 and 3 are between 1 and 4, the next highest square
Input: 4
Output: 4
Reason: The numbers 5, 6, 7, 8 are between 4 and 9

What range of input values do we have to support?

I think this would have been more interesting if the input didn't have to be a square.

@xnor Hindsight, I definitely agree.

Jelly, 2 bytes
½Ḥ

Try it online!
Port of my Mathematica answer (take square root, then double). This is limited to inputs which can be represented exactly as a floating-point number. If that's an issue, the three-byte solution Æ½Ḥ works for arbitrary squares (which Dennis posted first but then deleted).

Oh I missed the whole "input will be a square" oops.

@JonathanAllan Me too.  Weird spec IMO.

Are there any squares that can't be represented exactly in floating point?

@Christian Sure, floating-point numbers are fixed in size, so there is only a finite number of values they can represent.

@MartinEnder In that case, given Jelly's support for arbitrary-precision integers and the spec's lack of an upper bound, I vote it should support all valid inputs.

Brain-Flak, 38, 22 bytes
{([[]](({})))}{}([]<>)

Try it online!
I'm very proud of this answer. IMO, one of my best brain-flak golfs.
How does it work?
As many other users have pointed out, the answer is simply sqrt(n) * 2. However, calculating the square root in brain-flak is very very nontrivial. Since we know the input will always be a square, we can optimize. So we write a loop that subtracts
1, 3, 5, 7, 9...

from the input, and track how many times it runs. Once it hits 0, the answer is simply the last number we subtracted minus one.
Originally, I had pushed a counter on to the other stack. However, we can use the main stack itself as a counter, by increasing the stack height.
#While TOS (top of stack, e.g. input) != 0:
{

    #Push:
    (

      #The negative of the height of the stack (since we're subtracting)
      [[]]

      #Plus the TOS pushed twice. This is like incrementing a counter by two
      (({}))
    )

#Endwhile
}

#Pop one value off the main stack (or in other words, decrement our stack-counter)
{}

#And push the height of the stack onto the alternate stack
([]<>)

In python-y pseudocode, this is basically the following algorithm:
l = [input]
while l[-1] != 0:   #While the back of the list is nonzero
    old_len = len(l)
    l.append(l[-1])
    l.append(l[-1] - old_len)

l.pop()

print(len(l))

My brain has literally been flak'd by this, nice job.

Mathematica, 8 bytes
2Sqrt@#&

Try it online! (Using Mathics.)
The difference between n2 and (n+1)2 is always 2n+1 but we just want the values between them excluding both ends, which is 2n.
This can potentially be shortened to 2#^.5& depending on precision requirements.

How about 2√#& ?

Julia 0.5, 8 bytes
!n=2n^.5

Try it online!

dc, 5
?2*vp

Try it online.

Previously I misread the question.  This version works for any positive integer input, not just perfect squares:
dc, 12
?dv1+d*1-r-p

Try it online.

Jelly,  7  6 bytes
I missed the "input will be square" caveat, but this will work for all non-negative integers... Martin Ender already gave the 2 byte solution.
½‘Ḟ²’_

A monadic link returning the count.
Try it online!

Japt, 5 3 bytes
¬*2

Try it online!
Square root of the input, then multiply by 2.

Brain-Flak, 20 bytes
Shout out to DJMcMayhem's amazing (albiet slightly longer) answer here
{({}()[({}()())])}{}

Try it online!
Explanation
This code works by counting down from the square number by odd increments.  Since every square is the sum of consecutive odd numbers this will reach 0 in n1/2 steps.  The trick here is we actually keep track of our steps in an even number and use a static () to offset it to the appropriate odd number.  Since the answer is 2n1/2, this even number will be our answer.  So when we reach 0 we remove the zero and our answer is sitting there on the stack.

Mathematica, 17 bytes
(Sqrt@#+1)^2-#-1&

Try it online!

Octave, 25 10 bytes
@(n)2*n^.5

Try it online!
Saved 15 bytes by using Martin's much better approach. The range consists of 2*sqrt(n) elements. The function does exactly that: Multiplies 2 with the root of the input.

Add++, 22 20 bytes
+?
_
S
+1
^2
-1
-G
O

Try it online!
Do you want to know how it works? Well, fear not! I'm here to educate you!
+?   Add the input to x (the accumulator)
_    Store the input in the input list
S    Square root
+1   Add 1
^2   Square
-1   Subtract 1
-G   Subtract the input
O    Output as number

I had the same logic for my original QBIC answer, but there's a shorter way.

Jelly, 7 bytes
½‘R²Ṫ_‘

Try it online!
Explanation:
½‘R²Ṫ_    Input:              40
½         Square root         6.32455532...
 ‘        Increment           7.32455532...
  R       Range               [1, 2, 3, 4, 5, 6, 7]
   ²      Square              [1, 4, 9, 16, 25, 36, 49]
    Ṫ     Tail                49
     _‘   Subtract input+1    8

Btw, the input will always be a square itself.

@JonathanAllan Fixed

@MartinEnder I totally misread the challenge, then... in the interest of not copying your answer (since it's obvious now why that works) I'll leave this one up.

Python 3, 16 bytes
lambda n:2*n**.5

Try it online!

Ohm, 2 bytes
√d

Try it online!

JavaScript ES6, 10 bytes
n=>n**.5*2

Try it online! Math.sqrt is pretty long which is why we use **.5

Then that's ES7 rather than ES6...

TI-Basic, 3 bytes
2√(Ans

Simplest approach...

05AB1E, 2 bytes
t·

Try it online!
Another port of Martin Ender's submission ...

Welcome to PPCG!

MATL (8 7 bytes)
I'm sure this can be reduced significantly (edit: thanks Luis), but a naive solution is:
X^QUG-q

Try it online!
Explanation:
X^   % Take the square root of the input (an integer)
QU  % Square the next integer to find the next square
G-   % Subtract the input to find the difference
q    % Decrement solution by 1 to count only "in between" values.

You can replace 2^  by U (and this worked in version 20.1.1, which was the most recent at the time of the challenge, so the answer it would be eligible even by our old standard)

Thanks Luis! I'm surprised that my naive approach only wasted 1 character relative to the MATL master. :)

QBIC, 19 9 bytes
?sqr(:)*2

Saved a bunch by copying @MartinEnder's approach.
No TIO link for QBIC, unfortunately.
Explanation
?          PRINT
 sqr( )    The square root of
     :     the input
        *2 doubled

Pari/GP, 9 bytes
n->2*n^.5

Try it online!

PHP, 44 bytes
<?=count(range($argn,(sqrt($argn)+1)**2))-2;

Try it online!

Alice, 10 bytes
2/*<ER
o@i

Try it online!
Explanation
Again, computes 2 sqrt(n). The layout saves two bytes over the standard solution:
/o
\i@/2RE2*

Breakdown of the code, excluding redirection of the IP:
2    Push 2 for later.
i    Read all input.
i    Try reading more input, pushes "".
2    Push 2.
R    Negate to get -2.
E    Implicitly discard the empty string and convert the input to an integer.
     Then take the square root of the input. E is usually exponentiation, but
     negative exponents are fairly useless in a language that only understands
     integers, so negative exponents are interpreted as roots instead.
*    Multiply the square root by 2.
o    Output the result.
@    Terminate the program.

Go, 56 bytes
import."math"
func f(n float64)float64{return 2*Sqrt(n)}

Try it online!

05AB1E, 4 3 bytes
Crossed out 4 is still 4 :c
t2*

Try it online!

Actually, 3 bytes
√2*

Try it online!

Retina, 21 bytes
.+
$*
(^1?|11\1)+
$1

Try it online! Explanation: Works by taking the square root of the number based on @MartinEnder's triangular number solver. After matching the square number, $1 is the difference between the square number and the previous square number, in unary. We want the next difference, but exclusive, which is just 1 more. To achieve this, we count the number of null strings in $1.

Cubix, 22 18 bytes
+@UOI0),c?;^..u;;/

Try it online!
Watch it online!
A port of Martin Ender's solution. Since Cubix only supports integer arithmetic, computing the square root is literally just trying every number until we hit the square root, so this approach only works since the input is a perfect square.
Expands to the following cube:
    + @
    U O
I 0 ) , c ? ; ^
. . u ; ; / . .
    . .
    . .

I       # read in input [n^2]
0       # push 0 [n^2, 0]
Main loop:
)       # increment [n^2, 1]
,       # divide, rounding to zero [n^2, 1, n^2]
c       # bitwise xor -- zero if equal, positive if not
?       # turn right if positive, go straight if zero [n^2,1,n^2,___]
 nonzero branch:
  /      # reflect IP direction
  ;;     # pop top two off stack [n^2, 1]
  u      # right-hand U-turn
  (re-enter main loop)
 zero branch: stack is [n^2, n, n, 0]
  ;      # pop top of stack [n^2, n, n]
  ^      # go north
  +      # add top two elements [n^2, n, n, 2n]
  U      # left-hand u-turn
  O      # output as int
  @      # terminate program

T-SQL, 22 bytes
SELECT 2*SQRT(a)FROM t

Input is via a pre-existing table, per our standards.

Java (OpenJDK 9) / JShell, 17 bytes
n->2*Math.sqrt(n)

Try it online!
Note: This would require import java.util.function.*; to get IntFunction<T> in Java 8 or Java 9, but the java.util.function package is imported by default in JShell.

Haskell, 9 bytes
(*2).sqrt

Try it online
Input and output will be treated as Float values.

Noether, 7 bytes
I.5^2*P

Try it here!
Just the same as every other answer: outputs two times the square root.

S.I.L.O.S, 26 bytes
readIO
i=2*i^.5
printInt i

Try it online!
Straightforward port of Martin Ender's Mathematica answer.

C#, 24 bytes
n=>System.Math.Sqrt(n)*2

Perl 6, 12 bytes
*.sqrt.Int*2

Try it

If it had to work with positive numbers that aren't squares:
{+($_^..^(.sqrt.Int+1)²)}

Try it

CJam, 11 10 bytes
ri_mQ)_*-~

Explanation:
ri e# Read integer: | 16
_  e# Duplicate:    | 16 16
mQ e# Square root:  | 16 4
)  e# Increment:    | 16 5
_* e# Square:       | 16 25
-  e# Subtract:     | -9
~  e# Bitwise NOT:  | 8

Alternative Solution, 6 bytes
rimQ2*

Explanation:
ri e# Read integer: | 16
mQ e# Square root:  | 4
2* e# Times 2:      | 8

Pyth, 4 bytes
y@Q2

Explanation:
     # Implicit copy input to Q
y    # Multiply by 2
 @Q2 # Square-root of Q
     # Implicit print

NewStack, 3 bytes
2√ᵢ

The breakdown:
 √ᵢ    Append the square root of the input.
2      Multiply it by two.

Why this works:
To find how many numbers N are in between the square number x and the next square number m, we first need to find a formula for m.
Since x is a square number, √x will be an integer. And √x + 1 will equal √m.
Therefore m = (√x + 1)^2 = x + 2√x + 1
The amount of numbers in between x and m will just equal their difference minus 1.
N = m - x - 1 = (x + 2√x + 1) - x - 1
So we've concluded
N = 2√x

Plain English 129 98 bytes
To put a n number's d into a r number:
Put the square root of the n in the r.
Add the r to the r.

Ungolfed:
To put a number's delta into a result number:
Put the square root of the number in the result.
Add the result to the result.

The Plain English IDE is available at github.com/Folds/english.  The IDE runs on Windows.  It compiles to 32-bit x86 code.

Charcoal, 7 bytes
Ｉ×²ＸＮ·⁵

Try it online!
Explanation
Ｉ         Cast (int -> str)
  ×²       Multiplied by 2
    ＸＮ·⁵ N to the power of .5 (Square root of N)

@DestructibleLemon No? The output is always a whole number (something.0)

counter example: 66 and 2. wait a minute I didn't read the challenge very well nvm

@DestructibleLemon "Given a positive square number as input"

C#, 42 bytes
int b=(int)Math.Sqrt(n);b=(b+1)*(b+1)-n-1;

Try it online!

Can't it just the last assignment just be b=(b+1)*(b+1)-n-1?

You could do this: int b=1+(int)Math.sqrt(n);b=b*b-n-1;
Doesn't this need to be a Lambda or something?

Dyalog APL, 6 bytes
2×*∘.5

I can't believe this hasn't been posted yet.
A variant with the same byte count:
+⍨*∘.5

Both of them work by doubling the square root.

J, 4 bytes
+:%:

    e.g. +:%: 9  ====>  6

Excel, 9 bytes
=2*A1^0.5

To handle all cases (not only squares):  21 bytes
=INT(A1^0.5+1)^2-A1-1

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
Create a checkerboard matrix
Take a positive integer n as input, and output a n-by-n checkerboard matrix consisting of 1 and 0.
The top left digit should always be 1.
Test cases:
n = 1
1

n = 2
1 0
0 1

n = 3
1 0 1
0 1 0
1 0 1

n = 4
1 0 1 0
0 1 0 1
1 0 1 0
0 1 0 1

Input and output formats are optional. Outputting the matrix as a list of lists is accepted.

Is a list of strings OK?

Yes, that's OK.

Related.

Your examples show spaces between numbers on the same row, is that required, so as to look more like a square?

@BradC it's not required. The first approach here is valid.

Can we take the input in unary if our language doesn't have the concept of a number? (e.g. #### for input 4)

https://oeis.org/A100241 has all of the binary representations of this. Dunno how I'd even begin to use it though lol.

Can we output whatever value for 0 and whatever value for 1?

No, it should be 1 and 0.

Jelly, 4 bytes
52 seconds!
+€ḶḂ

Try it online!

"52 seconds!" like I'm not used to it...

Do ya'll have, like, a beeper, you wear 24/7 for new PPCG challenges?

@carusocomputing Those who have a faster internet connection are usually the lucky ones that will win.

MATL, 5 bytes
:otYT

Try it at MATL online!
Explanation
Consider input 4 as an example.
:    % Implicit input, n. Push range [1 2 ... n]
     %   STACK: [1 2 3 4]
o    % Parity, element-wise
     %   STACK: [1 0 1 0]
t    % Duplicate
     %   STACK: [1 0 1 0], [1 0 1 0]
YT   % Toeplitz matrix with two inputs. Implicit display
     %   STACK: [1 0 1 0;
     %           0 1 0 1;
     %           1 0 1 0;
     5           0 1 0 1]

Japt, 6 bytes
ÆÇ+X v

Test it online! (Uses -Q flag for easier visualisation)
Explanation
 Æ   Ç   +X v
UoX{UoZ{Z+X v}}  // Ungolfed
                 // Implicit: U = input number
UoX{          }  // Create the range [0...U), and map each item X to
    UoZ{     }   //   create the range [0...U), and map each item Z to
        Z+X      //     Z + X
            v    //     is divisible by 2.
                 // Implicit: output result of last expression

An interesting thing to note is that v is not a "divisible by 2" built-in. Instead, it's a "divisible by X" built-in. However, unlike most golfing languages, Japt's functions do not have fixed arity (they can accept any number of right-arguments). When given 0 right-arguments, v assumes you wanted 2, and so acts exactly like it was given 2 instead of nothing.

V, 16, 15 bytes
Ài10ÀñÙxñÎÀlD

Try it online!
Hexdump:
00000000: c069 3130 1bc0 adf1 d978 f1ce c06c 44    .i10.....x...lD

Haskell, 50 41 39 38 bytes
Thanks to nimi and xnor for helping to shave off a total of 9 10 bytes
f n=r[r"10",r"01"]where r=take n.cycle

Alternately, for one byte more:
(!)=(.cycle).take
f n=n![n!"10",n!"01"]

or:
r=flip take.cycle
f n=r[r"10"n,r"01"n]n

Probably suboptimal, but a clean, straightforward approach.

concat.repeat is cycle: n!l=take n$cycle l. If you go pointfree it saves one more byte: (!)=(.cycle).take.

Lovely! I knew there was a builtin for that, but couldn't remember the name for the life of me

I was going to suggest f n|r<-take n.cycle=r[r"10",r"01"] or similar. but Haskell seems to infer the wrong type for r? It works with explicit typing f n|r<-take n.cycle::[a]->[a]=r[r"10",r"01"].

That is really weird, especially given that f n=r[r"10",r"01"] where r=take n.cycle seems to work fine (but gives the same byte count as the current solution)

@JulianWolf Haskell seems to have trouble inferring polymorphic types

@JulianWolf: you can omit the space before the where, so your function from the comment is 38 bytes

@JulianWolf This is because of the monomorphism restriction.  I'm not sure if it's legal, but this is disabled by default in GHCi, so you might be able specify "Haskell - GHCi" to get the bytes.

@zbw I thought this was the case but using NoMonomorphismRestriction didn't help. Nor did Rank2Types or RankNTypes. Do you know what's going on there?

Another solution at 39 bytes using only list comprehension.

APL (Dyalog), 8 bytes
~2|⍳∘.+⍳

Try it online!
Explanation
Let's call the argument n.
⍳∘.+⍳

This creates a matrix
1+1 1+2 1+2 .. 1+n
2+1 2+2 2+3 .. 2+n
...
n+1 n+2 n+3 .. n+n

Then 2| takes modulo 2 of the matrix (it vectorises) after which ~ takes the NOT of the result.

JavaScript ES6, 55 54 51 46 bytes
Saved 1 byte thanks to @Neil
Saved 2 bytes thanks to @Arnauld
n=>[...Array(n)].map((_,i,a)=>a.map(_=>++i&1))

Try it online!
This outputs as an array of arrays. JavaScript ranges are pretty unweildy but I use [...Array(n)] which generates an array of size n

It's still a byte shorter to use the index parameters: n=>[...Array(n)].map((_,i,a)=>a.map((_,j)=>(i+j+1)%2))

@Neil huh, I never thought to use the third parameter in map, thanks!

@Arnauld thanks! that inspired me to save 5 more bytes!

Mathematica, 25 bytes
1-Plus~Array~{#,#}~Mod~2&

Retina, 33 30 bytes
.+
$*
1
$_¶
11
10
T`10`01`¶.+¶

Try it online! Explanation: The first stage converts the input to unary using 1s (conveniently!) while the second stage turns the value into a square. The third stage inverts alternate bits on each row while the last stage inverts bits on alternate rows. Edit: Saved 3 bytes thanks to @MartinEnder.

$\1$'is just$_`.

05AB1E, 9 7 bytes
-2 bytes thanks to Emigna
LDÈD_‚è

Try it online!
Explanation
LDÈD_‚sè» Argument n
LD        Push list [1 .. n], duplicate
  ÈD      Map is_uneven, duplicate
    _     Negate boolean (0 -> 1, 1 -> 0)
     ‚    List of top two elements of stack
      è   For each i in [1 .. n], get element at i in above created list
          In 05AB1E the element at index 2 in [0, 1] is 0 again

You can cut the » as list-of-lists output is okay and you can also remove s.

Explanation is a bit irrelevant.

MATL, 7 bytes
:t!+2\~

Try it online!
Explanation:
         % Implicit input (n)
:        % Range from 1-n, [1,2,3]
 t       % Duplicate, [1,2,3], [1,2,3]
  !      % Transpose, [1,2,3], [1;2;3]
   +     % Add        [2,3,4; 3,4,5; 4,5,6]
    2    % Push 2     [2,3,4; 3,4,5; 4,5,6], 2
     \   % Modulus    [0,1,0; 1,0,1; 0,1,0]
      ~  % Negate     [1,0,1; 0,1,0; 1,0,1]

Note: I started solving this in MATL after I posted the challenge.

Equivalent, and shorter: :&+o~

Still learning :-) I'll update tomorrow. I liked your other approach too :-)

This is what I came up with, too. And hey, you only use the pure MATL instruction set, not those pesky Y-modified instructions @LuisMendo uses.

@Sanchises Pesky, huh? :-P

Java (OpenJDK 8), 80 77 bytes
-3 bytes thanks to Kevin Cruijssen
j->{String s="1";for(int i=1;i<j*j;s+=i++/j+i%j&1)s+=1>i%j?"\n":"";return s;}

Try it online!
Oh look, a semi-reasonable length java answer, with lots of fun operators.
lambda which takes an int and returns a String.  Works by using the row number and column number using / and % to determine which value it should be, mod 2;
Ungolfed:
j->{
    String s="1";
    for(int i=1; i<j*j; s+= i++/j + i%j&1 )
        s+= 1>i%j ? "\n" : "";
    return s;
}

You can remove the space to save a byte. The challenge states the output format is flexible. Oh, and you can save two more bytes by changing (i++/j+i%j)%2 to i++/j+i%j&1 so you won't need those parenthesis. Which make the total 1 byte shorter than my nested for-loop solution (n->{String r="";for(int i=0,j;i++<n;r+="\n")for(j=0;j<n;r+=j+++i&1);return r;}), so +1 from me. :)

@KevinCruijssen Yeah I was still waiting on a response on the space.  I didn't think about & having higher precedence than % and &1 == %2

Brachylog, 15 bytes
^₂⟦₁%₂ᵐ;?ḍ₎pᵐ.\

Try it online!
Explanation
Example Input: 4

^₂               Square:                            16
  ⟦₁             1-indexed Range:                   [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]
    %₂ᵐ          Map Mod 2:                         [1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0]
       ;?ḍ₎      Input-Chotomize:                   [[1,0,1,0],[0,1,0,1],[1,0,1,0],[0,1,0,1]]
           pᵐ.   Map permute such that..
             .\  ..the output is its own transpose: [[1,0,1,0],[0,1,0,1],[1,0,1,0],[0,1,0,1]]

Clojure, 36 bytes
#(take %(partition % 1(cycle[1 0])))

Yay, right tool for the job.

J, 9 bytes
<0&=$&1 0

Try it online!

Nekomata, 5 bytes
ᵒ+→2%

Attempt This Online!
ᵒ+→2%
ᵒ+       Create an (input x input) matrix where the element at (i,j) is i+j
  →      Increment
   2%    Mod 2

Brachylog, 19 bytes
⟦₁Rg;Rz{z{++₁%₂}ᵐ}ᵐ

Try it online!

Charcoal, 8 bytes
ＵＯＮ10¶01

Try it online! Explanation: This roughly translates to the following verbose code (unfortunately the deverbosifier is currently appending an unnecessary separator):
Oblong(InputNumber(), "10\n01");

C, 69 67 63 bytes
Thanks to @Kevin Cruijssen for saving two bytes and @ceilingcat for saving four bytes!
i,j;f(n){for(i=n;i--;puts(""))for(j=n;j;)printf("%d",j--+i&1);}

Try it online!

You can remove the space in printf("%d ", since that's another valid method of output.

@ConorO'Brien Yeah, thanks.

You can save two bytes by changing (j+++i)%2 to j+++i&1 to remove those parenthesis.

@ceilingcat Thanks!

Pyth, 9 bytes
VQm%+hdN2

Try this!
another 9 byte solution:
mm%+hdk2Q

Try it!

///, 87 bytes + input
/V/\\\///D/VV//*/k#D#k/k#D&k/k&DVk/k\D/SD/#/r
DSkk/10DSk/1D&/V#rV#0r;VV0;VVV1;V\D/r/S/&[unary input in asterisks]

Try it online! (input for 4)
Unary input in 1s, 95 bytes + input
/V/\\\///D/VV//&1/k#&D&|D/#k/k#D&k/k&DVk/k\D/SD/#/r
DSkk/10DSk/1D&/V#rV#0r;VV0;VVV1;V\D/r/S/&&[unary input in ones]|

Try it online! (input for 8)
How does this work?

V and D are to golf \/ and // respectively.
/*/k#/ and /&1/k#&//&|// separate the input into the equivalent of 'k#'*len(input())
/#k//k#//&k/k&//\/k/k\// move all the ks to the /r/S/ block
Ss are just used to pad instances where ks come after /s so that they don't get moved elsewhere, and the Ss are then removed
#s are then turned into r\ns
The string of ks is turned into an alternating 1010... string
The r\ns are turned into 1010...\ns
Every pair of 1010...\n1010\n is turned into 1010...\01010...;\n
Either 0; or 1; are trimmed off (because the 01010... string is too long by 1)

Octave, 24 bytes
@(n)~mod((a=(1:n))+a',2)

Try it online!

Or the same length:
@(n)mod(toeplitz(1:n),2)

Try it online!

Mathematica, 23 bytes
ToeplitzMatrix@#~Mod~2&

R, 38 37 bytes
n=scan();(matrix(1:n,n,n,T)+1:n-1)%%2

Try it online!
-1 byte thanks to Giuseppe
Takes advantage of R's recycling rules, firstly when creating the matrix, and secondly when adding 0:(n-1) to that matrix.

You can drop a byte by getting rid of the t and instead constructing the matrix with byrow=T, i.e., (matrix(1:n,n,n,T)+1:n-1)%%2

outer(1:n,1:n-1,"+")%%2 is quite a few bytes shorter :)

Swi-Prolog, 142 bytes.
t(0,1).
t(1,0).
r([],_).
r([H|T],H):-t(H,I),r(T,I).
f([],_,_).
f([H|T],N,B):-length(H,N),r(H,B),t(B,D),f(T,N,D).
c(N,C):-length(C,N),f(C,N,1).

Try online - http://swish.swi-prolog.org/p/BuabBPrw.pl
It outputs a nested list, so the rules say:

t() is a toggle, it makes the 0 -> 1 and 1 -> 0.
r() succeeds for an individual row, which is a recursive check down a row that it is alternate ones and zeros only.
f() recursively checks all the rows, that they are the right length, that they are valid rows with r() and that each row starts with a differing 0/1.
c(N,C) says that C is a valid checkerboard of size N if the number of rows (nested lists) is N, and the helper f succeeds.

Test Cases:

Can't you strip off all newlines?

Arturo, 39 36 bytes
$[n][map..1n'x->map..1n'y->%x+y+1 2]

Try it
-3 thanks to alephalpha's simpler method
Prettified and rearranged for clarity:
$[n][                     ; a function taking an argument n
    map 1..n 'x ->        ; map over 1..n, assign current elt to x
        map 1..n 'y ->    ; map over 1..n again, assign current elt to y
            (x+y+1)%2     ; what it looks like
]                         ; end function

Vyxal, 5 bytes
ʁ∷:v=

Try it Online!
-3 thanks to @lyxal
-1 thanks to @emanresuA
Explanation
ʁ∷:v=    implicit input
ʁ        range(input)
 ∷       mod 2
  :      duplicate
   v=    equals, vectorised over the top list
         (generates a nested list)

Old:
ɾ∷ẋ⁽†ẇ    implicit input
ɾ         range(1, input+1)
 ∷        mod 2
  ẋ       repeated input times
     ẇ    apply to every 2nd item:
   ⁽†     vectorised not

ʁ:∷:†$"$İ    implicit input
ʁ:           range, duplicate
  ∷:         mod 2, duplicate
    †        vectorised not
     $"      swap and pair
       $İ    swap and index in

Seems to work on the official site

@lyxal it works now, but when I answered the official site wasn't loading

Try it Online! for 6 bytes

@lyxal thanks, can you check my explanation?

100% accurate. Good job!

5

TI-Basic, 30 29 bytes
identity(Ans→[A]
Fill(1,[A]
cumSum([A]
2fPart(.5(Ans+Ansᵀ+[A]

Takes input in Ans.
-1 byte thanks to MarcMush

PHP, 56 bytes
Output as string

for(;$i<$argn**2;)echo++$i%2^$n&1,$i%$argn?"":"
".!++$n;

Try it online!
PHP, 66 bytes
Output as 2 D array

for(;$i<$argn**2;$i%$argn?:++$n)$r[+$n][]=++$i%2^$n&1;print_r($r);

Try it online!

QBIC, 19 bytes
[:|?[b|?(a+c+1)%2';

Explanation
[:|         FOR a = 1 to b (b is read from cmd line)
?           PRINT - linsert a linebreak in the output
[b|         FOR c = 1 to b
?(a+c+1)%2  PRINT a=c=1 modulo 2 (giving us the 1's and 0's
';            PRINT is followed b a literal semi-colon, suppressing newlines and
              tabs. Printing numbers in QBasic adds one space automatically.

CJam, 17 bytes
{_[__AAb*<_:!]*<}

Try it online!
Returns a list (TIO link has formatted output).

out-golfed

@Challenger5 Sorry you can't outgolf with deleted answer.

Bash + rs, 42
eval echo \$[~{1..$1}+{1..$1}\&1]|rs $1 $1

Try it online.

Cheddar, 38 bytes
n->(|>n).map(i->(|>n).map(j->i+j+1&1))

Try it online!

Python, 73 63 62 66 bytes
Saved 4 bytes thanks to officialaimm
r=range(input());print[''.join([`(x+y+1)%2`for x in r])for y in r]

Declaring R=range(n) and using R saves 3 bytes. 1 unwanted space between ) and for can be removed as well.

@officialaimm Sweet, thanks for the tip! I'm new a golfing. I'm thankful for any tips :)

Just noticed your code is just a snippet, not a function or  full program which is not a healthy practice. You can use this instead, only 8 bytes more!

@officialaimm Noted. Still better than my original submission. Thanks a bunch. :)

Mathematica, 28 bytes
Cos[+##/2Pi]^2&~Array~{#,#}&

Pure function taking a positive integer as input and returning a 2D array. Uses the periodic function cos²(πx/2) to generate the 1s and 0s.
For a little more fun, how about the 32-byte solution
Sign@Zeta[1-+##]^2&~Array~{#,#}&

which uses the locations of the trivial zeros of the Riemann zeta function.

q/kdb+, 37 16 bytes
Solution:
{x#x#'(1 0;0 1)}

Example:
q){x#x#'(1 0;0 1)}1
1
q){x#x#'(1 0;0 1)}2
1 0
0 1
q){x#x#'(1 0;0 1)}3
1 0 1
0 1 0
1 0 1
q){x#x#'(1 0;0 1)}4
1 0 1 0
0 1 0 1
1 0 1 0
0 1 0 1

Explanation:
2nd version is much simpler, and thus shorter and faster (4x). Create a 2-item list containing 01... and 10... to the length of the input, then take 'x' number of items from this new list.
{              } / lambda function
      (1 0;0 1)  / 2-item list of (0;1) and (1;0)
   x#'           / take 'x' items from each list, if x=3 then (1 0 1;0 1 0)
 x#              / take 'x' items from *this* list

Notes:
I've re-written this twice during this edit, went from 37->25->24->16 bytes. Now it's a little more competitive.
Edits:

-21 bytes with complete re-write...

braingasm, 21 bytes
;$[$[>+o:<]p[>+<]10.]

Explanation:
;                       Read a number from stdin.
 $[                 ]   That many times...
   $[     ]               That many times...
     >+o:<                  Increase the next cell and print its value modulo 2.
           p[   ]       If the input was even...
             >+<          Increase the next cell once more.
                 10.    Print a newline.

J, 41 bytes
I know there's a J answer at 9, but I'm pleased to get anything working, even if it's not a tacit programming best possible..
ch=:monad define
2|(2$y)$(1+i.y),(i.y)
)

It takes a number y and generates two lists of numbers 1,2,3,..y and 0,1,2,3,..y-1 to make the offset first and second row, appends them into one long list, reshapes that into a y,y matrix (wrapping around when it runs out), and then does modulo 2 on all the elements to make them a 1 or 0.
   ch 1
1

   ch 2
1 0
0 1

   ch 3
1 0 1
0 1 0
1 0 1

   ch 4
1 0 1 0
0 1 0 1
1 0 1 0
0 1 0 1

   ch 5
1 0 1 0 1
0 1 0 1 0
1 0 1 0 1
0 1 0 1 0
1 0 1 0 1

Haskell, 43 bytes
h=1:0:h
l=h:(0:h):l
s x=take x$map(take x)l

Try it online!
This creates the infinite checkerboard matrix and saves it to l.  Then our function s chops off a square.

Husk, 6 bytes
´Ṫ=↑İ¬

Try it online!

Thunno, \$ 12 \log_{256}(96) \approx \$ 9.88 bytes
RD2%D1_ZPsAH

Attempt This Online! or see it in a nicer format
Explanation
RD2%D1_ZPsAH  # Implicit input                Example: n=3
RD            # Duplicate range(input)        STACK: [0, 1, 2],  [0, 1, 2]
  2%D         # Duplicate ^ mod 2             STACK: [0, 1, 2],  [0, 1, 0],  [0, 1, 0]
     1_       # 1 - top copy of ^             STACK: [0, 1, 2],  [0, 1, 0],  [1, 0, 1]
       ZP     # Pair top two items            STACK: [0, 1, 2],  [[0, 1, 0], [1, 0, 1]]
         sAH  # 1-based modular indexing      STACK: [[1, 0, 1], [0, 1, 0], [1, 0, 1]]
              # Implicit output

Pyt, 7 bytes
ř2%Đɐ=Ɩ

Try it online!
ř                    implicit input; řangify
 2%                  modulo 2
   Đ                 Đuplicate
    ɐ=               for ɐll possible pairs, check for equality
      Ɩ              coerce booleans to integers; implicit print

Prints list of lists

Pip -S, 8 bytes
%U$+GMCa

Other list-formatting flags such as -l and -p work too. Without a flag, the list of lists is printed without any separators (e.g. 1001 for input 2), which seemed like stretching the permissive output format a bit too far.
Attempt This Online!
Explanation
       a  ; Command-line argument
     MC   ; Map to a square coordinate grid of that size:
  $+G     ;   Sum the two coordinates
 U        ;   Increment
%         ;   Mod 2

Go, 89 bytes
import."fmt"
func f(n int){
for i:=1;i<=n;i++{
for j:=i;j<i+n;j++{Print(j%2)}
Println()}}

Attempt This Online!
Prints a multi-line string.
Explanation
import ."fmt"               // Boilerplate
func f(n int) {             // Function f taking an integer n:
for i := 1; i <= n; i++ {   //  Loop through each i in [1..n]:
for j := i; j < i+n; j++ {  //   Loop through each j in [i..i+n]:
Print(j%2)}                 //    Print j mod 2 without a newline
Println()}}                 //   Print a newline

Thunno 2, 5 bytes
RɗDȷ=

Attempt This Online!
Port of my Vyxal answer.
Explanation
       # implicit input
R      # one range
 ɗ     # mod 2
  D    # duplicate
   ȷ   # outer product:
    =  #  equality
       # implicit output

Uiua, 6 bytes
⊞=.◿2⇡

Try it!
⊞=.◿2⇡
     ⇡  # range
   ◿2   # modulo 2
  .     # duplicate
⊞=      # table by equality

Mathematica, 28 bytes
Table[Mod[i+j+1,2],{i,#},{j,#}]&

Julia, 38 bytes
n->map(x->x%2,(1:n).+transpose(0:n-1))

The usual approach

Python 2, 72 70 61 54 bytes
-7 bytes thanks to Leaky Nun. -1 byte thanks to Wheat Wizard.
lambda n:[[i-~j&1for i in range(n)]for j in range(n)]

Try it online!

62 bytes

54 bytes

Actually, 15 bytes
r;╗⌠╜+u⌠2@%⌡M⌡M

Try it online!

Python, 43 bytes
lambda n:[('10'*n)[i:i+n]for i in range(n)]

Try it online!
Anonymous function that outputs a list like ['1010', '0101', '1010', '0101'].

tcl, 82
time {set a "";time {set a $a[expr [incr i]%2]} $n;puts $a;if \!($n%2) incr\ i} $n

demo
Still a looser, but I think i can be golfed down a little bit further.

C#, 145 Bytes
int u=1;int n=int.Parse(b.Text);for(int i=0;i<n;i++){if(i%2==0){u=1;}else{u=0;}for(int j=0;j<n;j++){t.Text+=u.ToString();u=1-u;}t.Text+="\r\n";}[enter link description here][1]

Try it online!

Bash & coreutils, 82 bytes
x=$1;yes 10|tr -d \\n|dd bs=1 count=$[x*x*2]|fold -w$[x*2-1]|grep -om$x "^.\{$x\}"

Takes one command-line integer as input.  Apparently the spaces between are optional.

Common Lisp, SBCL, 81 bytes
version 1:
(#1=dotimes(i(set'a(read)))(#1#(j a)(format t"~:[1~;0~] "(oddp(+ j i))))(terpri))

version 2:
(lambda(n)(#1=dotimes(i n)(#1#(j n)(format t"~:[1~;0~] "(oddp(+ j i))))(terpri)))

Two loops, and inside I print either 1 and space or zero and space based on parity of (+ j i). (terpri) for newline.
It's long, I know:/

C# (.NET Core), 88 bytes
n=>{var r=new int[n,n];for(int i=0,j;i<n;i++)for(j=0;j<n;j++)r[i,j]=(i+j+1)%2;return r;}

Try it online!
I can't believe this is the shortest way to initialize a 2D array of integers, there must be another way...

Perl 5, 49 bytes
$_=10x(($n=<>)/2).1x($n%2);say&&y/01/10/while$n--

Try it online!

C (gcc), 60 59 bytes
i;f(n){for(i=n*n;i--;)printf(i%n?"%d":"%d\n",i%n+i/n+1&1);}

Try it online!

Japt -m, 5 4 bytes
Outputs a 2D array.
W£°v

Try it


text:
Print the nth Fibonacci number containing the nth Fibonacci number!
Challenge
You must write a program that takes a positive integer n as input, and outputs the nth Fibonacci number (shortened as Fib# throughout) that contains the nth Fib# as a subtring. For the purposes of this challenge, the Fibonacci sequence begins with a 1.
Here are some examples that you can use as test cases, or as examples to clarify the challenge (for the latter, please leave a comment down below explaining what you find unclear).
n=1
Fib#s: 1
       ^1 1st Fib# that contains a 1 (1st Fib#)
Output: 1

n=2
Fib#s: 1, 1
       ^1 ^2 2nd Fib# that contains a 1 (2nd Fib#)
Output: 1

n=3
Fib#s: 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233
             ^1              ^2                   ^3 3rd Fib# that contains a 2 (3rd Fib#)
Output: 233

n=4
Output: 233

n=5
Output: 6765

n=6
Output: 28657

n=7
Output: 1304969544928657

n=8
Output: 14472334024676221

n=9
Output: 23416728348467685

n=10
Fib#s: 1, ..., 34, 55, 89, ..., 63245986, 102334155, 165580141, ..., 2880067194370816120, 4660046610375530309
                   ^1                     ^2         ^3                                   ^10 10th Fib# that contains a 55 (10th Fib#)
Output: 4660046610375530309

As always, this is code-golf, so go for the lowest byte count possible.
If something is confusing/unclear, please leave a comment.
(This challenge is based off another challenge I posted: Print the nth prime that contains n)

I recommend including the n=5 testcase, because I just made a silly error where I wrote a check which counted a number several times if it had the substring more than once. n=5 would catch that because of the 55.

What are the constraints of n?

@officialaimm I don't think it's reasonable to expect very high numbers. My solution works on TIO up to n=25 (the output has 1186 digits), then gets killed for n=26 (3085 digits compiled on my own laptop). There seems to be a jump in difficulty whenever fib(n) gets one more digit (as one would expect). The next jump, 31, has 12990 digits in the final output.

Yes. Lol! my python solution gets stuck for n>6 because there is a recursive function which is called many times in a loop. :D

@officialaimm Oh right, exponential blowup is a problem when defining Fibonacci directly with recursion. Even without that you might hit Python's recursion limit rather soon.

Can we consider 0 to be a Fibonacci number for the purposes of this challenge? Can we use 0-indexing? Can you add test cases for 4-9?

@Shaggy: The standard convention these days is to consider 0 as the 0th Fibonacci number. This is consistent with the examples in the question.

@ShreevatsaR, the test cases appear to be using 1-indexing with 1 as the first number in the sequence.

@Shaggy: That's what I meant by consistent: when 0 is the 0th Fibonacci number, then 1 is the first ("1th"?) Fibonacci number.

I tried this in Taxi and got TIO to print the nth Fibonacci number with this program but is only accurate up to the 48th Fibonacci number and I have no idea why. This was going to be phase 1 in a ridiculously complicated Taxi solution but not if I can't figure out the problem first.

@Shaggy I have added test cases 4 through 9. Since you're just using them as test cases, and not challenge clarification, I only put the required output. I hope that's OK.

@officialaimm You could always just use the formula if you don't want to do it recursively. That might take more bytes though.

Yes. I have already posted iterative solution for python. Check it out!

@officialaimm Yeah, I saw it. I meant that there's an equation to find the nth term. It's faster, but takes more bytes.

@EngineerToast That's just about the right size to break if your ints are 32 bits. fib(48)==4807526976, 2^32==4294967296.

@ØrjanJohansen That makes a lot of sense, thanks. I don't know if it's Taxi or TIO with that limitation. Ah, well.

Haskell, 85 84 bytes
EDIT:

-1 byte: Laikoni shortened l.
Typo (x>=s for x<=s) in explanation.

f takes an Int and returns a String.
l=0:scanl(+)1l
m=show<$>l
f n|x<-m!!n=[y|y<-x:m,or[x<=s|s<-scanr(:)""y,x++":">s]]!!n

Try it online!
How it works

l is the infinite list of Fibonacci numbers, defined recursively as the partial sums of 0:1:l. It starts with 0 because lists are 0-indexed. m is the same list converted to strings.
In f:

n is the input number, and x is the (string of the) nth Fibonacci number.
In the outer list comprehension, y is a Fibonacci number tested for whether it contains x as a substring. The passing ys are collected in the list and indexed with the final !!n to give the output. An extra x is prepended to the tests to save two bytes over using !!(n-1) at the end.
To avoid counting ys several times, the tests of each y are wrapped in or and another list comprehension.
In the inner list comprehension, s iterates through the suffixes of y.
To test whether x is a prefix of s, we check whether x<=s and  x++":">s. (":" is somewhat arbitrary but needs to be larger than any numeral.)

l=0:scanl(+)1l saves a byte.

Jelly, 15 14 bytes
1 byte thanks to Jonathan Allan.
0µ³,ÆḞẇ/µ³#ÆḞṪ

Try it online!

Python 2, 99 86 bytes

 Ørjan Johansen Saved 7 bytes:  starting with b=i=x=-1 a=1 and dropping the x and
 Ørjan Johansen again saved 3 bytes: f and n==2 to f*(n>2)
 Felipe Nardi Batista saved 9 bytes: economic swap a,b=a+b,a shorthand f-=str(x)in str(a), squeezed (n<2)*f
 ovs  saved 13 bytes: transition from python 3 to python 2.

f=n=input()
b=i=x=-1
a=1
while(n>2)*f:i+=1;a,b=a+b,a;x=[x,a][i==n];f-=`x`in`a`
print a

Try it online!
Explanation:
f=n=int(input())                 # f is number of required numbers

b=i=x=-1                         # i is index(counter) set at -1
                                 # In Two-sided fibonacci, fib(-1) is 1
                                 # and b(fib before it) i.e. fib(-2) is -1
                                 # Taking advantage of all -1 values, x is
                                 # also set to -1 so that the `if str(...`
                                 # portion does not execute until x is set a
                                 # value(i.e. the nth fibonacci) since there
                                 # is no way -1 will be found in the number
                                 # (ALL HAIL to Orjan's Genius Idea of using
                                 # two-sided fibonacci)

a=1                              # fib(-1) is 1

while(n>2)*f:                    # no need to perform this loop for n=1 and
                                 # n=2 and must stop when f is 0

 i+=1                            # increment counter

 b,a=a,a+b                       # this might be very familiar (fibonacci
                                 # thing ;))

 x=[x,a][i==n]                   # If we have found (`i==n`) the nth
                                 # fibonacci set x to it

 f-=`x`in`a`                     # the number with required substring is
                                 # found, decrease value of f

print a                          # print required value

Python 3, 126 120 113 112 110 101 99 bytes
f=n=int(input())
b=i=x=-1
a=1
while(n>2)*f:i+=1;a,b=a+b,a;x=[x,a][i==n];f-=str(x)in str(a)
print(a)

Try it online!

You can get rid of 7 more bytes by starting with b=i=x=-1
a=1 and dropping the x and . (Essentially starting 3 steps earlier in the two-sided Fibonacci sequence -1, 1, 0, 1, 1, 2, ....)

Thanks a lot!!. But I only got it down by 6.

You left a space at the end of -1 :P

Updated the explanation. That was hard one. ;) Take a look and let me know if it makes sense.

Erm blush. Also, I want to get rid of  and n>2 but it seems n==2 really needs special treatment. But it can be shortened to *(n>2).

golfed it down to 88 bytes, some changes are exclusive to python 2. but the rest will work in python 3 as well

@FelipeNardiBatista Woah! Thanks a lot! I wish python 3 had \a``.  You can post an answer for python 2 btw just cite my answer. ;)

for python 3, you can still golf 9 bytes: here

last thing :P you can make your while into one line and shave 2 more bytes

Nice. But I just updated to the same length and much clean-looking check!

You can do the same thing in 86 bytes with Python 2

@ovs Can I submit another python 2 answer?

@officialaimm While you could do it, it will be better received if you edit this answer or add the python 2 version to your current answer

Java, 118 111 bytes
i->{long n=i,p=0,q,c=1;for(;--n>0;p=c,c+=q)q=p;for(n=c;i>0;q=p,p=c,c+=q)if((""+c).contains(""+n))--i;return p;}

I keep thinking it should be possible not to duplicate the Fibonacci bit, but all my efforts somehow result in more bytes.
Thanks to Kevin for improvements... guess it shows this was my first attempt at golfing :)

Snippets are not allowed. You should turn this into a lambda like so: i->{long n=i,p=0,q,c=1;while(--n>0){q=p;p=c;c+=q;}n=c;while(i>0){if((""+c).contains(""+n))--i;q=p;p=c;c+=q;}return p;} (118 bytes)

Welcome to PPCG! After you've changed it to a lambda as @Okx pointed out, I must say it's an impressive answer. I tried to do this challenge about an hour ago just before lunch, and gave up. So +1 from me. Some small things to golf: while(--n>0){q=p;p=c;c+=q;} can be for(;--n>0;p=c,c+=q)q=p; and n=c;while(i>0){if((""+c).contains(""+n))--i;q=p;p=c;c+=q;} can be for(n=c;i>0;q=p,p=c,c+=q)if((""+c).contains(""+n))--i;. (In total: i->{long n=i,p=0,q,c=1;for(;--n>0;p=c,c+=q)q=p;for(n=c;i>0;q=p,p=c,c+=q)if((""+c).contains(""+n))--i;return p;} (111 bytes)

Perl 6, 45 bytes
{my@f=0,1,*+*...*;@f.grep(/$(@f[$_])/)[$_-1]}

$_ is the argument to the function; @f is the Fibonacci sequence, lazily generated.

JavaScript (ES6), 96 93 92 90 86 bytes
0-indexed, with the 0th number in the sequence being 1. Craps out at 14.
f=(n,x=1,y=1)=>n?f(n-1,y,x+y):x+""
g=(n,x=y=0)=>x>n?f(y-1):g(n,x+!!f(y++).match(f(n)))

2 6 bytes saved thanks to Arnauld

Try it

f=(n,x=1,y=1)=>n?f(n-1,y,x+y):x+""
g=(n,x=y=0)=>x>n?f(y-1):g(n,x+!!f(y++).match(f(n)))
oninput=_=>o.innerText=(v=+i.value)<14?`f(${v}) = ${f(v)}\ng(${v}) = `+g(v):"Does not compute!"
o.innerText=`f(0) = ${f(i.value=0)}\ng(0) = `+g(0)
<input id=i min=0 type=number><pre id=o>

Explanation
Updated version to follow, when I get a minute.
f=...                   :Just the standard, recursive JS function for generating the nth Fibonacci number
g=(...)=>               :Recursive function with the following parameters.
n                       :  The input integer.
x=0                     :  Used to count the number of matches we've found.
y=0                     :  Incremented on each pass and used to generate the yth Fibonacci number.
x>n?                    :If the count of matches is greater than the input then
f(y-1)                  :    Output the y-1th Fibonacci number.
:                       :Else
g(...)                  :    Call the function again, with the following arguments.
n                       :      The input integer.
x+                      :      The total number of matches so far incremented by the result of...
RegExp(f(n)).test(f(y)) :        A RegEx test checking if the yth Fibonacci number, cast to a string, contains the nth Fibonacci number.
                        :        (returns true or false which are cast to 1 and 0 by the addition operator)
y+1                     :      The loop counter incremented by 1

Your answer seems to provide different output from the examples.

@ericw31415, that's because it's 0-indexed.

I wrote specifically wrote this though: "For the purposes of this challenge, the Fibonacci sequence begins with a 1."

@ericw31415: And my sequence does begin with 1, it's just 0-indexed; the 0th and 1st numbers in the sequence are 1, the 2nd is 2, the 3rd is 3, the 4th is 5, the 5th is 8, and so on, and so forth.

Charcoal, 65 bytes
ＡＩθνＡνφＡ±¹βＡβιＡβξＡ¹αＷ∧›ν²φ«Ａ⁺ι¹ιＡ⁺αβχＡαβＡχαＡ⎇⁼ιναξξＡ⁻φ›№ＩαＩξ⁰φ»Ｉα

Try it online! Link to verbose code for explanation.

PHP, 96 bytes
for($f=[0,1];$s<$a=$argn;$s+=$f[$a]&&strstr($f[$i],"$f[$a]")?:0)$f[]=$f[$i]+$f[++$i];echo$f[$i];

Try it online!

Mathematica, 85 bytes
(i=ToString;f=Fibonacci;For[n=t=0,t<#,If[i@f@n++~StringContainsQ~i@f@#,t++]];f[n-1])&

input

[10]

-4 bytes from @JungHwan Min
output

4660046610375530309

Looks weird but f@i@n++ is totally valid, decreasing 1 byte. Using For instead of While reduces 3 bytes. 85 bytes: (i=ToString;f=Fibonacci;For[n=t=0,t<#,If[i@f@n++~StringContainsQ~i@f@#,t++]];f[n-1])&

Just a heads up, declaring global variables separately is completely fine. My bad.

R, 77 72 bytes
F=gmp::fibnum;i=0;d=n=scan();while(n)if(grepl(F(d),F(i<-i+1)))n=n-1;F(i)

This makes use of the gmp library for the Fibonacci number.  Fairly straight foward implementation of the question.
F=gmp::fibnum;          # Alias Fibonacci function to F
i=0;                    # intitalise counter
d=n=scan();             # get n assign to d as well
while(n)               # loop while n
  if(grepl(F(d),F(i<-i+1)))  # use grepl to determine if Fib of input is in Fib# and increment i
     n=n-1;             # decrement n
F(i)                  # output result

Some tests
> F=gmp::fibnum;i=0;d=n=scan();while(n)if(grepl(F(d),F(i<-i+1)))n=n-1;F(i)
1: 2
2:
Read 1 item
Big Integer ('bigz') :
[1] 1
> F=gmp::fibnum;i=0;d=n=scan();while(n)if(grepl(F(d),F(i<-i+1)))n=n-1;F(i)
1: 3
2:
Read 1 item
Big Integer ('bigz') :
[1] 233
> F=gmp::fibnum;i=0;d=n=scan();while(n)if(grepl(F(d),F(i<-i+1)))n=n-1;F(i)
1: 10
2:
Read 1 item
Big Integer ('bigz') :
[1] 4660046610375530309
> F=gmp::fibnum;i=0;d=n=scan();while(n)if(grepl(F(d),F(i<-i+1)))n=n-1;F(i)
1: 15
2:
Read 1 item
Big Integer ('bigz') :
[1] 1387277127804783827114186103186246392258450358171783690079918032136025225954602593712568353

05AB1E, 11 9 bytes
µNÅfDIÅfå

-2 bytes thanks to @ovs.
Try it online or verify the first 10 test cases.
Explanation:
µ          # Loop until the counter_variable is equal to the (implicit) input:
           # (the counter_variable is 0 by default)
 N         #  Push the loop index
  Åf       #  Pop and push the index'th Fibonacci number
    D      #  Duplicate it
     IÅf   #  Get the input'th Fibonacci number
        å  #  Check that the index'th Fibonacci nr contains the input'th Fibonacci nr
           #  (if this is truthy, implicitly increase the counter_variable by 1)
           # (after the loop, the top of the stack - the last index'th Fibonacci number
           #  we've duplicated - is output implicitly as result)

You don’t need to close the loop if you flood the stack with Fibonacci numbers: µNÅfDIÅfå

@ovs Thanks for the -2. :)

Husk, 15 13 bytes
!fȯ€d!¹İfQdİf

Try it online!
!⁰fȯ€od!⁰İfQdİf
!⁰                  # get the input-th element of
  f          İf     # fibonacci numbers that satisfy:
   ȯ€      Qd       # one of the subsets of their digits is
     od             # the digits of
       !⁰           # the input-th element of
         İf         # the fibonacci series

Jelly, 11 bytes
1,ÆḞw/ɗ#ÆḞṪ

Try it online!
Heartbroken. This is a 9 byte version that unfortunately fails for \$n = 2\$ which otherwise, I'm really proud of due to the weird chain rules and the byte saves.
How they work
1,ÆḞw/ɗ#ÆḞṪ - Main link. Takes n on the left
      ɗ     - Group the previous three links into a dyad f(k, n):
 ,          -   Pair; [k, n]
  ÆḞ        -   n'th Fib; [fib(k), fib(n)]
     /      -   Run the previous dyad over the list
                with fib(k) on the left and fib(n) on the right:
    w       -     Index of fib(n) in fib(k)'s digits or 0

1      #    - Count up k = 1, 2, 3, ..., until n integers return
              true for f(k, n) and return those k
        ÆḞ  - n'th Fib for each
          Ṫ - Return the last value

And the version that fails for \$n = 2\$:
ÆḞw¥#ÆḞ⁺Ṫ - Main link. Takes n on the left
     ÆḞ   - Yield the n'th Fibonacci number, x
   ¥      - Group the previous 2 links together as a dyad f(k, x):
ÆḞ        -   k'th Fibonacci number
  w       -   Index of x in fib(k)'s digits else 0
    #     - Count up k = n, n+1, n+2, ... until n integers return true
            for f(k, x) and return those k
       ⁺  - Redo the previous link (ÆḞ), yielding the k'th Fibonacci
            number for each k returned by #
        Ṫ - Take the last k

Somehow a bug prevents both japt and jelly from having really short answers here.

Clojure, 99 bytes
(def s(lazy-cat[0 1](map +(rest s)s)))#(nth(filter(fn[i](.contains(str i)(str(nth s %))))s)(dec %))

A basic solution, uses an infinite sequence of Fibonacci numbers s.

NewStack, 14 bytes
N∞ ḟᵢﬁ 'ﬁf Ṗf⁻

The breakdown:
N∞              Add all natural numbers to the stack
   ḟᵢ           Define new function will value of input
     ﬁ          Get the n'th Fibonacci number for ever element n
       'ﬁf      Remove all elements that don't contain the (input)'th Fibonacci number
           Ṗf⁻  Print the (input-1)'th element

In English: (with example of an input of 3)
N∞: Make a list of the natural numbers [1,2,3,4,5,6...]
ḟᵢ: Store the input in the variable f [1,2,3,4,5,6...]
ﬁ: Convert the list to Fibonacci numbers [1,1,2,3,5,8...]
'ﬁf: Keep all elements that contain the fth Fibonacci number [2,21,233...]
Ṗf⁻: Print the f-1th element (-1 due to 0-based indexing) 233

The GitHub seems to contain only a readme and a tutorial. An implementation is referred to, but it's not linked. Although PPCG now allows languages newer than the challenge, I believe we still require a publically available implementation.

@ØrjanJohansen, Ahah thanks for reminding me. I forgot to upload that! It'll be up in a minute.

Your implementation seems to use UTF-8, in which case that's actually 28 bytes (don't mind the Haskell setting, I'm only using TIO to count bytes). Languages like Jelly etc. have their own code pages for this reason.

@ØrjanJohansen Touché, I'm in the works of distributing a table for it's own encoding as we speak.

C#, 35 bytes
int u=1,b=1;for(;b<n;){b+=u;u=b-u;}

Try it
int n=int.Parse(t2.Text);int u=1,b=1;for(;b<n;){b+=u;u=b-u;t.Text+=b.ToString()+" ";}if(b==n){t.Text+="true";}

Welcome on Programming Puzzle and Code-Golf. Answers need to be either a full program or a function, while you only provided a snippet. In particular, you are assuming that the input is in n and you just put the output in b (I think). You could write that take n as arguments and returns b... Also, I'm pretty sure you are not computing what the challenges asks for. Actually, I have no idea what you are computing. Could you please provide use with some code that we can run to verify your solution? (your "Try it" can't be run as is..)

Japt, 16 15 12 bytes
Would be 11 bytes but for a bug in Japt.
@µX¦skN}f!gM

Try it