text:
Make me some curry
Having a function f that takes arguments x1, x2, …, xn
                                               – ie.  f : X1 × X2 × … × Xn → Y
– currying redefines f as a function taking a single argument a1 which maps to yet another function. This technique is useful for partial application, for example with a curried pow function we could write exp = pow(e).
Example
Assuming we have the following function f taking three arguments (f : X1 × X2 × X3 → Y):
def f(a,b,c):
  return a + b * c

Currying this function leaves us with f_curry: X1 → (X2 → (X3 → Y)), if we would now call that function twice with f_curry(1)(2) we would get a function (h) equivalent to the following returned:
def h(c):
   return 1 + 2 * c

The curried function f could be written like this (Python 3):
def f_curry(a):
  def g_curry(b):
    def h(c):
      return a + b * c
    return h
  return g_curry

Try it online!
Challenge
Your challenge will be to curry a function as described above, here are the rules:

Input will be a blackbox function which takes at least 2 arguments
The input function will always have a fixed number of arguments (unlike printf or similar, note: you need to support functions with any number of arguments ≥2)
If your language uses curried functions by default (eg. Haskell), you may expect the input function to be defined over N-tuples, instead of a "higher-order function"
You may take the number of arguments as input
Output will be the input's curried equivalent*
You may assume that the output function will only ever be:

called with less or equal to the number of arguments that the input function takes
called with arguments of the right type

* This would mean for an input f with N arguments and an output h that for all valid arguments a1,…,aN it holds that f(a1,a2,…,aN) == h(a1)(a2)…(aN).

Related.

so the input is def f(a,b,c):   return a + b * c and the output is def f_curry(a):   def g_curry(b):     def h(c):       return a + b * c     return h   return g_curry?

@DanielIndie: If you're taking that example the input would be f (which is defined somewhere) and the output should be something equivalent to f_curry. Or the input would be lambda a,b,c: a+b*c and the output a function equivalent to f_curry.

This is hard to do in most statically typed languages ... I guess you need type functions for this.

@PaŭloEbermann: True, some languages won't be able to solve this task (note the tag [tag:functional-programming]). However some statically typed languages might be able to use function pointers which would be a valid I/O, that's mainly the reason I allowed taking the number of arguments as additional input.

That was no complaint, I just tried to do it in Ceylon, and noted that it is impossible to even write the type of this function. (A "just first argument" curry function is already built in.)

Aside re. “instead of a higher order function”, a curried function type like A -> (B -> C) isn’t higher-order (meaning order > 1): its order is 1. A type like (A -> B) -> C is order-2, since it has an order-1 function as a parameter—basically order refers to the nesting depth to the left of function arrows. See: What is a higher-kinded type?

@PaŭloEbermann: Ah, I was thinking you meant languages like C or C++.. I don't know Ceylon but maybe you can define something like a type class, if you haven't seen it you should definitely check out Lynn's Idris answer.

@JonPurdy: I think you linked the wrong SO question, that one talks about kinded types which is different. However I see your point, the wikipedia article about higher-order functions states that my usage is disputed, so I put it in quotes. I think it's clear what it means, however feel free to edit in a better explanation.

@BMO: I linked that answer of mine because it gives examples of function orders (0: A, 1: A -> B, 2: (A -> B) -> C, 3: ((A -> B) -> C) -> D, …) and what “higher-” specifically means. It’s presented as a way to explain kinds (0: *, 1: * -> *, 2: (* -> *) -> *, …), but these are closely related to orders, as are ranks for that matter (1: forall a. a -> a, 2: (forall a. A a -> B a) -> C, 3: ((forall a. A a -> B a) -> C) -> D, …). Just wanted to offer clarification. The use of “higher-” is “folk knowledge” in the PLT/CS world, so it’s not surprising that Wikipedia is unclear.

@JonPurdy: I see, that makes sense. It's basically (as is often the case) the same concept as in higher-order logic, right? But in my defense, I didn't try to be too formal about all this ;P I had bad luck with keeping things too formal and making challenges/answers not accessible to everyone. I think in the end I wouldn't even be able to post a challenge like this, as I don't think there's a (good) objective way of testing the validity of submissions (ie. proving/testing the equivalence of two functions).

For Haskell-like languages, must it specifically be defined in terms of a tuple, or is a fixed-length list acceptable? Specifically in this case, the size of a tuple is part of the type and it isn't possible to deconstruct them without pattern matching which can't dynamically extend to an arbitrary number of members.

@Οurous: Sure that should be fine! The main aspects should be, that it is of fixed size and - unless a language only has one type - that the chosen representation allows for heterogeneous types.

The challenge would be seemingly impossible in Haskell, if you give function over n-tuples, as certain tuples are simply not defined in Haskell. Also, the polymorphism required to make it work for all sizes requires either Template Haskell or a crazy amount of type families etc.

For an answer in assembly, I need some way to know the type (or actually just the size) of the arguments. May I assume all arguments are of some constant size or may I get a list of argument sizes as extra argument?

JavaScript (ES6), 35 bytes
f=g=>g.length<2?g:a=>f(g.bind(f,a))

Idris, 204 bytes
import Data.HVect
C:(a:Vect n Type)->(HVect a->Type)->Type
C[]T=T[]
C(h::t)T=(x:h)->C t(T .(x::))
c:{a:Vect n Type}->{T:HVect a->Type}->((b:HVect a)->T b)->C a T
c{a=[]}f=f[]
c{a=h::t}f=\v=>c(\u=>f(v::u))

Try it online!
Sounds like a job for dependent types! Well, maybe.

C is a currying type function. Given a vector of types a = [t1, t2, … tn] and a type function T : HVect a → Type, it returns a new type:

　　　　　　　　　　　(x1 : t1) → (x2 : t2) → … → (T [x1, x2, … xn])

Here, HVect is the heterogeneous vector type from the Idris Prelude — the type of n-tuples whose elements are of n different types.
c is a function that takes a and T as implicit arguments, and then converts an uncurried function f of type ((b : HVect a) → T b) into a curried one of type C a T.
(C simply describes what we wish to do; c actually does it. But we can't get away with not defining C, as Idris demands that every top-level definition have a type signature.)

The TIO link gives a usage example. If we define a function on 3-tuples (Nat, Nat, String) as follows:
uncurried : HVect [Nat, Nat, String] -> String
uncurried [a, b, c] = show (a*a + b*b) ++ c

then uncurried [3, 4, "th"] yields the same result as c uncurried 3 4 "th". Idris infers the arguments a=[Nat, Nat, String] and T=const String for us, I believe.
I based this code on this gist by timjb.

In my opinion, tuples in Haskell and Idris should actually be HVect by default—HVect is essentially a tuple that you can uncons.

Python 3, 54 53 bytes
c=lambda n,f,*x:lambda y:(f,c)[n>1](*1%n*(n-1,f)+x,y)

Try it online!

R, 96 bytes
y=function(f,n=length(formals(f)),p=list())function(x,u=c(p,x))`if`(n<2,do.call(f,u),y(f,n-1,u))

Try it online!

Previous version (97 bytes)
-1 byte thanks to @JayCE

I don't see how to fundamentally shorten it. You can golf away three bytes by getting rid of the braces and the space at the end of the first line. And two more due to the convention here of not including the name of the function in the byte count. TIO

@ngm The function name must be included when it's recursive.

@ngm: I put the if statement inside the sub-function saving a tenth of bytes :)

Coconut, 54 bytes
def c(f,*a):
 try:return f(*a)
 except:return c$(f,*a)

Try it online!

Coconut, 40 bytes
Port of Erik's Python answer.
def c(f,n,*a)=n and c$(f,n-1,*a)or f(*a)

Try it online!

C++17 20, 214 200 189 184 bytes
#include<regex>
template<class R,class A,class...B>auto c(std::function<R(A,B...)>f){if constexpr(sizeof...(B))return[=](A a){return c<R,B...>({std::bind_front(f,a)});};else return f;}

Try it on Wandbox (TIO doesn't support gcc 9+ which is needed for std::bind_front)
This is a template function that takes an std::function of any arity/type and returns a curried lambda expression. Uses constexpr if FTW. If any template gurus have any idea how to eliminate or reduce the need for std::function let me know.
Edit: replaced inner lambda with std::bind_front.
Edit: replaced include with shorter <regex>
Ungolfed version:
#include <functional>

template <class R, class A, class... B>
auto curry(std::function<R(A, B...)> f) {
    if constexpr(sizeof...(B) > 0) {
        return [=](A a) {
            return curry(std::function<R(B...)>{std::bind_front(f, a)});
        };
    } else {
        return f;
    }
}

@ceilingcat ah of course, good old recursive includes. I'm not sure how standard-compliant that is, but apparently the implicit int-to-bool conversion in a constexpr is already nonstandard (clang rejects it) so as long as gcc doesn't complain I'll take it.

Python 2, 60 bytes
c=lambda f,n,l=[]:lambda a:n-1and c(f,n-1,l+[a])or f(*l+[a])

Try it online!
The footer is a tester which uses STDIN in the following way per line:

The function itself
The number of the function's arguments, ≥2
A list of the arguments ([a,b,...])

Note that, while a list of the arguments is given as input in the tester, in reality, the curried equivalent gets prepended to the list and the list is reduced by function call.
A similar 55-byte version has been kindly provided by ovs:
c=lambda f,n,*l:lambda a:n-1and c(f,n-1,*l,a)or f(*l,a)

Try it online!

Attache, 5 bytes
Curry

Try it online!
Simple built in, largely uninteresting. But, here's a version from scratch:
Attache, 35 bytes
{If[#__2<#_,Fold[`&:,$'__],_@@__2]}

Explanation:
{If[#__2<#_,Fold[`&:,$'__],_@@__2]}
{                                 }    lambda
 If[       ,              ,      ]     if
    #__2                                 the number of parameters after the first
        <#_                              is less than the arity of the first
            Fold[   ,    ]             then fold:
                 `&:                     right-function bonding
                     $                     over this function
                      '__                  paired with the rest of the parameters
                          ,            otherwise:
                           _@@           call the first parameter
                              __2        with the rest of them

Rust, 73 69 bytes
macro_rules!c{($f:tt$(($n:tt:$a:ty))*)=>{$(move|$n:$a|)*$f($($n),*)}}

Try it online!
Rust is statically typed and because of this taking in a function with an unknown number of arguments is not allowed. Fortunately, macros have no such restrictions. This macro takes in a function of the form name(arg1:type1)(arg2:type2)...(argN:typeN). and outputs a function that outputs an appropriately long chain of impl FnOnces that ends with the desired function call. I shaved a few bytes by changing the input form to something more natural with the question. Ungolfed version:
macro_rules! c{       //declare a macro named c
  (                   //match on
    $f:tt             //A token tree (should be an ident, but this is codegolf)
    $(                //followed by zero or more sequences of
      ($n:tt : $a:ty) //a token tree (again, should be ident) colon type in parentheses
    )*                //end repetition
  )=>{                //replace with
    $(move|$n:$a|)*   //FnOnce closure heads for every matched name:type
    $f(               //call initially matched function
      $($n),*         //with a comma separated list of closure argument names
    )                 //end call
  }                   //end rule
}                     //end macro

Cauliflower, 84 bytes
(:= c(\($f$n(@a))(if$n(\($a)(call c(cat(list$f(-$n 1))@a(list$a))))else(call$f@a))))

Try it online!

Mmm, Cauliflower curry. Delicious. ^_^

@DLosc there aren't enough answers to this challenge in langauges with food-related names :P (although I guess most of them don't actually have functions)

Java 8, 19 + 126 = 145 bytes
This is a curried (hah) lambda taking a function and an argument count and returning the curried function.
import java.util.*;

f->p->new C(){List a=new Stack();public Object f(Object r)throws Throwable{a.add(r);return a.size()<p?this:f.f(a.toArray());}}

Try It Online
Submission type
The submission defines appropriate functional interfaces for the input and output functions.  The definitions of the interfaces aren't included in the byte count because they only provide type information and don't contribute any code to the solution.  (In fact, both of them are general enough that they could well have been included in the set of functional interfaces in the standard library.)  For more details see the TIO.
Usage
Because the submission returns a function (instance of C), the output may be invoked directly (with f), but subsequent intermediate return values must be cast to an appropriate type before being invoked. Consult the TIO for a usage example.
Note that in Java functions (i.e. methods) are not first-class objects. Thus the syntax used in the output bullet of the challenge description is meaningless in Java. Rather than f(a1, a2, a3) we have f.f(a1, a2, a3), and rather than f(a1)(a2)(a3) we have f.f(a1).f(a2).f(a3) (modulo typecasting).
Limitations
When an intermediate result is applied (an argument added), the result is actually a mutated copy of the original result.  This violates the spirit of currying, but meets the specific requirement stated in the challenge.
The form of input functions is limited by the decision to use functional interfaces, since a fully general functional interface has to use variadics or otherwise pack function parameters, and as a result the implementors of the interface must do so as well rather than listing parameters in the standard fashion.  Technically this might disqualify the solution, since it is possible to support fully general non-variadic multi-parameter input functions by invoking them using reflection.  My solution using this strategy (taking a java.lang.reflect.Method instead of an instance of a functional interface thanks to @user) is a bit longer, so I stick with this one.
Ungolfed
f -> p -> new C() {
    List a = new Stack();
    public Object f(Object r) throws Throwable {
        a.add(r);
        return a.size() < p ? this : f.f(a.toArray());
    }
}

Acknowledgments

-211 bytes thanks to ideas from KrystosTheOverlord

I love the use of Function<> in your answer! Rather than using reflection though wouldn't it be easier to just use ternary statements and casting? I submitted my own answer doing just that above

Would it be possible to use a Method as the input instead?

@user Good idea.  I wrote up a solution using Method and I think it is quite a bit shorter than my original solution.  It ends up longer than my latest solution that uses custom functional interfaces and doesn't support writing input functions as lambda expressions, but it does support multi-parameter input functions unlike any functional interface approach.  I might add that Method solution here later for completeness.

Python 2, 78 bytes
c=lambda f,*a:f.func_code.co_argcount>len(a)and(lambda x:c(f,*a+(x,)))or f(*a)

Try it online!

Perl 6, 42 40 bytes
my&c={.count>1??{c(.assuming($^a))}!!$_}

Try it online!
-2 bytes thanks to Brad Gilbert b2gills.

You don't need to use a trailing *, it is only necessary if there is something after it like .assuming(*,1).

Haskell, 211 209 189 163 bytes
Flags:
-XMultiParamTypeClasses
-XFlexibleInstances

Actual code (119 bytes):
class C a b c where c::(a->b)->c
instance C()b b where c f=f()
instance C a b c=>C(d,a)b(d->c)where c a b=c(\d->a(b,d))

Try it online!
The input type of the function to be curried is a nested tuple in a cons-like structure. The uncurried version of a function that adds 3 numbers together would look something like this, where it ends in an empty tuple.
myAdd :: (Int, (Int, (Int, ()) ) ) -> Int
myAdd (a, (b, (c, _))) = a + b + c

It works from the bottom up. There's an instance to curry a function of type () -> r that just applies the empty tuple to the function. Then there's another instance of C that can curry a function of type (a,b)->c if there is already an instance of C for b -> c.
Here's an uncurr function to accompany the currying function:
class Uncurry a b c d where
  uncurr :: (a->b)->c->d

instance Uncurry a r (a,()) r where
  uncurr f (a,()) = f a

instance Uncurry a b c d => Uncurry e (a->b) (e,c) d where
  uncurr f (e,c) =(uncurr(f e) c)

Try it online!

Wolfram Language (Mathematica), 5 bytes
Good ol' Mathematica built-ins
Curry

Takes 2 arguments, the function and the number of arguments.
Try it online!

Julia 1.0, 40 bytes
f>n=n<2 ? f : ((x...)->y->f(x...,y))>n-1

Try it online!

APL (Dyalog Classic), 58 57 bytes
∇r←(a f g)x
:If a[1]=≢a
r←g 1↓a,x
:Else
r←(a,x)f g
:End
∇

Try it online!
Calling syntax (with curried function g, arguments x1 through x3, and number of arguments n):
((n x1 f g) x2) x3
Requires ⎕IO←1

Julia 0.6, 48 bytes
c=(f,n,a=[])->n>1?x->c(f,n-1,[a;x]):x->f(a...,x)

Try it online!
Port of @EricTheOutgolfer's Python answer.

Dotty, 345 ... 221 186 bytes
def>[F,T,X](f:F)(using? :F TupledFunction T,e:T=>X)=e(?tupled f)
given[A]as((EmptyTuple=>A)=>A)=_(Tuple())
given[A<:Tuple,B,C,D](using t:(A=>B)=>C)as((D*:A=>B)=>D=>C)=f=>h=>t(c=>f(h*:c))

Try it in Scastie
This will not work in Scala 3.0 as TupledFunction will be removed. However, it may be added back later.
This one doesn't do any unsafe casting or other trickery.
> is the method to call. The type parameters F, T, and X represent the type of the input function, the type of the input function if it took a single tuple instead of multiple arguments, and the type of the resulting curried function, respectively. The first parameter, f, is the function to be curried. There are also two implicit parameters, ? and e. ? is a TupledFunction object that can convert between F and T, i.e., tuple and untuple a function. It is provided in the standard library automatically, and makes it easier for e to do its work.
e operates on the tupled form of f. There's a base implicit function that takes an a function EmptyTuple=>A and returns an A by just passing an empty tuple to that function. Another given builds on top of that by deconstructing f into D *: A => B (D is the type of the first parameter of f, A is the type of the rest of the parameters as a tuple, and B is the type of f's result). It uses another implicit function of type (A => B) => C, where C is the curried version of A => B. This second case returns a function taking a D and then applying t to a new function where the D from before is cons-ed to an A before applying f to it.
Dotty, 144 bytes
def a[T](x:Any)=x.asInstanceOf[T]
def c[T,R](f:T=>R,n:Int):Any=>Any=h=>a(n match{case 1=>f(a(Tuple1(h)))case _=>c(t=>f(a(h*:a[Tuple](t))),n-1)})

Try it in Scastie
Requires function to be tupled beforehand.

Java 8... Using lambda insanity, 152 bytes
Ok so I know that there is already a java 8 answer, but I wanted to use one using almost entirely lambdas without the use of java's Function<> class.
Here is the functional interface for the lambda expressions
interface K{Object f(int...x);}

And here is the actual expression
a->a.length==2?(K)c->a[0]+a[1]*c[0]:a.length==3?a[0]+a[1]*a[2]:(K)b->(b.length == 1)?(K)c->a[0]+b[0]*c[0]:a[0]+b[0]*b[1];

Yeah, so I know this looks really crazy, but the latter is mainly just using ternary operators to distinguish different number of arguments to what needs to be returned.
Given the submitted function
K function = a->a.length==2?(K)c->a[0]+a[1]*c[0]:a.length==3?a[0]+a[1]*a[2]:(K)b->(b.length == 1)?(K)c->a[0]+b[0]*c[0]:a[0]+b[0]*b[1];

function(a, b, c) is function.f(a, b, c), function(a)(b)(c) is ((K)((K)function.f(a)).f(b)).f(c)
Basically any situation that results in a curried result, the answer must be cast to (K) so then it can have a function called on it, otherwise the result is an integer. You can even do the following! (function(a))(a,b) which would be ((K)function.f(a)).f(b,c) etc...
This probably took me way too long, and we already have a java 8 answer, but I feel like it is still an interesting way to go about it.

I like the idea of creating a variadic functional interface!  I wonder if that would be useful for reducing the length of my solution too.  I think I get what you're doing here, but I'm not sure you have a full solution yet.  What I see are functions that take int args, not a function that takes a function.  It looks like what you've done is curried the example input function from the challenge description rather than implementing a function that itself curries.

Oh I must've misunderstood, I am still new to functional programming and am fascinated with it. So how would giving it a function as a parameter work then? And where could I find some resources to guide me in the right direction?

Yeah, no worries!  It looks like you're familiar with lambdas and functional interfaces, and those are the main things you'll need.  The most helpful resource in this case might actually be my Java 8 answer since it demonstrates a way to write a solution that both takes a function and returns one.  Your functional interface K would be a good starting point too, since it's an appropriate type for the input function.

I'm happy to provide some more help or answer further questions, but probably best to open a chat room for it.

Alrighty I have made a room -> https://chat.stackexchange.com/rooms/113053/java-8-functional-currying, I think I get the gist, I'll have to look over your code alot more closely

Lispy, 169 bytes
(define f(lambda A(begin(define G(lambda(X)(if(>=(length X)C)(proc:apply(head A)X)(lambda Args(G(concat X Args))))))(define C(length(lambda:args(head A))))(G(tail A)))))

Implements the generic abritrary ES5 currying algorithm on Rosetta Code.
Ungolfed and test:
(begin
;; f is a lambda that captures all arguments
(define f (lambda Arguments (begin            ;; function extraCurry(f) {
    (define F (head Arguments))
    (define A (tail Arguments))
    (define _curry (lambda (XS)               ;; function _curry(xs) {
        (if (>= (length XS) intArgs)          ;; xs.length >= intArgs ?
            (proc:apply F XS)                 ;;   f.apply(null, xs)
            (lambda Args                      ;; : function() {
                (_curry (concat XS Args)))    ;; return _curry(xs.concat([].slice.apply(arguments)))
        )
    ))
    (define intArgs (length (lambda:args F))) ;; intArgs = f.length
    (_curry A)                                ;; return _curry([].slice.call(arguments, 1))
)))

(define product3 (lambda (a b c) (* a b c)))

;; [14, 28, 42, 56, 70, 84, 98, 112, 126, 140]
(print (map [1 2 3 4 5 6 7 8 9 10] (((f product3) 7) 2))))

Try online link coming soon.

Factor, 6 bytes
ncurry

Try it online!
Builtin.
A non-trivial implementation might be:
[ [ curry ] times ]

Currying is a pretty uncomplicated affair in a concatenative language. :)

Ruby, 12 bytes
Ruby has a built-in method curry which can be called on a lambda that gives the desired behavior. The below code returns a lambda that calls curry on its argument.
proc &:curry

Attempt This Online!


text:
Hexadecimal, octal, binary, oh my!
This is a code golf puzzle: shortest byte count wins. The program should do the following (standard loopholes obviously forbidden):

Input a hexadecimal number
Convert to octal
Then interpret the digits as if in decimal (765 octal -> 765 decimal)
Divide the number by two
Convert to hexadecimal

Example:
Input: 4a3d
Output: 5809.8
4a3d -> 45075 -> 45075 -> 22537.5 -> 5809.8

What's with the downvote?

Welcome to PPCG! I'm not the downvoter, but personally I'd vote this as a duplicate of base-conversion challenge, since that's the same, just repeated. I'd suggest you to use our sandbox next time, it can help detect potential problems in the challenge.

Hello, welcome to the site.  I downvoted this challenge because it is a series of tasks, with no real motivation.  I don't think the challenge is interesting.  That being said don't feel discouraged to keep writing questions.  Just because I think this challenge is bad doesn't mean I think you won't write good challenges in the future.

@WhatWizard what would you consider to be an interesting challenge?

The most recent challenge I have upvoted was this.  The main criteria I look for in a question are 1) Whether the challenge offers something new I haven't seen before 2) Whether the challenge is cohesive, that is whether its internal parts make sense with one another. 3) an arbitrary do I think it is fun criterion.  If you want to get good at writing challenges I would suggest reading this.  You might also look at this.

I think it's nothing related to the pointed dup. A possible dup should do some base converting, though maybe no division

@l4m2 But the duplicate target does involve base conversion...

@user202729 the target only do one per call. Also it matters the char order while here doesn't

@SriotchilismO'Zaic It's been about a year since I created this question. Thanks for the feedback you gave, as it really helped me in future questions to avoid this mistake!

Perl 6, 30 bytes
{(:16($_).base(8)/2).base(16)}

Try it online!

Javascript,56 53 52 bytes
-3 bytes thanks to @ovs
-1 byte thanks to @Arnauld
p=parseInt,a=>(p(p(a,16)[s='toString'](8))/2)[s](16)

toString on an integer converts the integer to a string in that base.
Try it online!

Had no idea the .toString(base) thing existed. Upvote for teaching me something new!

source: Stack Exchange

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

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

sort: votes


text:
Ordinal string check
Description :
Given a string as input, check if it is a valid ordinal number in English or not. If it is valid return truthy value otherwise return falsy value. (Suggested by @Arnauld. Thanks . Also by @JoKing)
For users who want to know about ordinal numbers go here :
https://www.mathsisfun.com/numbers/cardinal-ordinal-chart.html (Suggestion by : qwr)
Possible inputs :
21st ---> true
12nd ---> false
1nd ---> false
....

This is a code golf challenge so shortest code in each language will be the winner.
Examples :

console.log('12th' , true) // This evaluates to true
console.log('1st' , true) // also evaluates to true
console.log('21nd' , false) // returns false
console.log('11st' , false) // returns false
console.log('111199231923819238198231923213123909808th' , true) // true

Since a lot of people asked the question regarding whether input will be only valid strings or not :
All inputs will always be valid. i.e they will be in the form of string and consist of a digit (or number of digits) along with one of the four suffixes :
st , nd , rd , th

Can you clarify the rules of ordinal numbers? Or at least put a link to what the rules you are following.

They are normal rules. I changed nothing.  But thanks for the input , I added a link

@Jonathan Allan Ordinal numbers start from 1st, negative ordinals do not exist - https://english.stackexchange.com/questions/309713/ordinal-form-of-negative-numbers-especially-1-2-3

@JonathanAllan OP says "Input is going to be valid ordinal pattern." which means no negatives

I updated the description.

@JonathanAllan : Yes I mean that every given input will be in the format 1st so digit along with one of the four st , nd , rd , th.

@JonathanAllan : The question has been updated

I'd recommend changing true/false values to truthy/falsey values and removing the excess part about output being a string or array (unless you actually mean input??)

@JoKing : I don't remember it being here. I will remove that. as for number 1 ok will do that too

You say the inputs will always be valid but I think a better term would be well formed. Both 12th and 12nd are well formed but only the former is valid.

When an ordinal is written we tend to see the suffix and assume it's an ordinal without checking whether that suffix is correct. I often write things like "4rd" just to see if anybody notices.

Python,  56  53 bytes
-3 thanks to  (use unique letter inclusion instead of penultimate character equality)
lambda v:'hsnrhhhhhh'[(v[-4:-3]!='1')*int(v[-3])]in v

An unnamed function.
Try it online!
How?
Since all input (here v) is guaranteed to be of the form \d*[st|nd|rd|th] we can just test whether a character exists in v which we expect to be there if it were correct (s, n, r, or h, respectively) - that is <getExpectedLetter>in v.
The last digit usually determines this:
v[-3]: 0 1 2 3 4 5 6 7 8 9
v[-2]: h s n r h h h h h h

...except when the penultimate digit is a 1, when all should end with th and hence our expected character must be h; to evaluate this we can take a slice (to avoid an index error occurring for inputs with no -4th character) v[-4:-3]. Since 0 maps to h already we can achieve the desired effect using multiplication prior to indexing into 'hsnrhhhhhh'.

st, nd, rd and th all have a unique letter so you can just test if it occurs in the string 53 bytes

@AsoneTuhid nice golf - thanks!

@AsoneTuhid - also saved three on my Jelly answer, so double the thanks!

Bash + GNU utilities, 54
Regex matching seems to be a straightforward way to go.  I'm pretty sure this expression could be shortened more:
egrep '((^|[^1])(1st|2nd|3rd)|(1.|(^|[^1])[^1-3])th)$'

Input from STDIN.  Output as a shell return code - 0 is truthy and 1 is falsey.
Try it online!

What ? this is not outputting the correct answer.

@MuhammadSalman That's because it's a test suite. Take a look at the exit codes for 1st and 1th.

egrep is capable of addition and primality testing (in unary), so I think you can make this an egrep answer.

I am sorry but my bash sucks as in I have no idea about a thing in it. I got bored so used a diff checker to check for difference between input and output. I see your point. So I have one question now @Dennis : Does Bash have booleans ?

Maybe the test cases would be more clear if egrep would be executed separately for each input to get matching exit code for each: Try it online!.

@MuhammadSalman Bash is a scripting language; it has exit codes. if egrep '((^|[^1])(1st|2nd|3rd)|(1.|(^|[^1])[^1-3])th)$' can be used in conditionals.

I still fail to see why he is not outputting "true" or "false" instead of what he is doing. And I just checked and Bash does have booleans. so return true or false instead of deleting them. But whatever I guess this works as well. Thanks @Dennis for explanation. Would you like to answer I would like to see yours.

@MuhammadSalman Please read https://codegolf.meta.stackexchange.com/questions/11924/new-users-guides-to-golfing-rules-in-specific-languages/12026#12026 and https://codegolf.meta.stackexchange.com/questions/2190/interpretation-of-truthy-falsey

Thanks but no thanks , like I said I ain't got a clue when it comes to Bash I have already accepted this as an acceptable answer.

this is under the assumption that the input is valid ordinal pattern. if its not the case changes need to be made
JavaScript (Node.js),97 92 78 bytes
s=>("tsnr"[~~((n=(o=s.match(/(\d{1,2})(\D)/))[1])/10%10)-1?n%10:0]||'t')==o[2]

Try it online!
Explanation
s=>
   ("tsnr"                                // all the options for ordinal - 4-9 will be dealt afterwards
      [~~(                                //floor the result of the next expression
        (n=(                              //save the number (actually just the two right digits of it into n
          o=s.match(/(\d{1,2})(\D)/))[1]) //store the number(two digits) and the postfix into o (array)
        /10%10)-1                         //if the right most(the tenths digit) is not 1 (because one is always 'th')
          ?n%10:0]                        //return n%10 (where we said 0-3 is tsnr and afterwards is th
            ||'t')                        // if the result is undefined than the request number was between 4 and 9 therefor 'th' is required
    ==o[2]                                // match it to the actual postfix

_____________________________________________________________________
port of @Herman Lauenstein
JavaScript (Node.js), 48 bytes
s=>/1.th|(^|[^1])(1st|2nd|3rd|[^1-3]th)/.test(s)

Try it online!

If the assumption reg solution can also be ***.

If not assumed it's /\d*(st|nd|rd|th)/ input, 1sta pass the reg test; if assumed, /1.th|(^|[^1])(1s|2n|3r|[^1-3]t)/ work

Java 8, 54 51 bytes
s->s.matches(".*1.th|(.*[^1])?(1s|2n|3r|[^1-3]t).")

Explanation:
Try it online.
s->  // Method with String parameter and boolean return-type
  s.matches(".*1.th|(.*[^1])?(1s|2n|3r|[^1-3]t).")
     //  Validates if the input matches this entire regex

Java's String#matches implicitly adds ^...$.
Regex explanation:
^.*1.th|(.*[^1])?(1s|2n|3r|[^1-3]t).$
^                                          Start of the regex
 .*1.                                       If the number ends in 11-19:
     th                                      it must have a trailing th
       |                                    If not:
        (.*    )?                            Optionally it has leading digits,
           [^1]                              excluding a 1 at the end
                 (1s|2n|3r         .      followed by either 1st, 2nd, 3rd,
                          |[^1-3]t).      0th, 4th, 5th, ..., 8th, or 9th
                                    $   End of the regex

Retina, 35 31 bytes
-4 bytes thanks to @Asone Tuhid
Thanks to @Leo for finding a bug
1.th|(^|[^1])(1s|2n|3r|[04-9]t)

Outputs 1 for true and 0 for false. This assumes the input is in ordinal format with a valid suffix (ends with st, nd, rd or th).
Try it online!

Pyth, 49 60 bytesSBCS
Js<2zK%J100I||qK11qK12qK13q>2z"th".?qz+J@c."dt8¸*£tÎðÎs"2J

Test suite
SE ate some unprintables in the code (and in the below explanation) but they're present in the link.
Explanation:
Js<2zK%J100I||qK11qK12qK13q>2z"th".?qz+J@c."dt8¸*£tÎðÎs"2J # Code
Js<2z                                                         # J= the integer in the input
     K%J100                                                   # K=J%100
           I||qJ11qJ12qJ13                                    # IF K is 11, 12, or 13:
                          q>2z"th"                            #  Print whether the end of the input is "th"
                                  .?                          # Otherwise:
                                    qz                        #  Print whether the input is equal to
                                      +J                      #   J concatenated with
                                        @                   J #    The object at the Jth modular index of
                                          ."dt8¸*£tÎðÎs"   #     The string "thstndrdthththththth"
                                         c                 2  #      Chopped into strings of length 2 as a list

Python 3 translation:
z=input();J=int(z[:-2]);K=J%100
if K==11or K==12or K==13:print(z[-2:]=="th")
else:print(z==str(J)+["thstndrdthththththth"[2*i:2*i+2] for i in range(10)][J%10])

Python 2, 92 82 74 68 bytes
-8 thanks to Chas Brown
-6 thanks to Kevin Cruijssen
lambda s:(a+'t'*10+a*8)[int(s[-4:-2]):][:1]==s[-2:-1]
a='tsnr'+'t'*6

Constructs a big string of ths, sts, nds, and rds for endings 00 to 99. Then checks to see if it matches.

Jelly,  25  22 bytes
-3 bytes thanks to an observation made in a comment made by  on my Python entry.
ḣ-2VDṫ-’Ạ×ɗ/«4ị“snrh”e

A monadic link.
Try it online! Or see the test-suite.
How?
ḣ-2VDṫ-’Ạ×ɗ/«4ị“snrh”e - Link: list of characters   e.g. "213rd" or "502nd" or "7th"
ḣ-2                    - head to index -2                "213"      "502"      "7"
   V                   - evaluate                         213        502        7
    D                  - cast to decimal list            [2,1,3]    [5,0,2]    [7]
     ṫ-                - tail from index -1                [1,3]      [0,2]    [7]
           /           - reduce with:                                          (no reduction since already length 1)
          ɗ            -   last 3 links as a dyad:
       ’               -     decrement (the left)           0         -1        x
        Ạ              -     all? (0 if 0, 1 otherwise)     0          1        x
         ×             -     multiply (by the right)        0          2        x
            «4         - minimum of that and 4              0          2        4
              ị“snrh”  - index into "snrh"                 'h'        'n'      'h'
                     e - exists in? (the input list)        0          1        1

Perl 5 -n, 57 bytes
/..$/;say$&eq(th,st,nd,rd,(th)x6)[$_%100-$_%10-10&&$_%10]

Try it online!

Haskell, 100 bytes
f('1':_:a@[_,_])=a=="th"
f(a:b)|length b>2=f b
f(a:"th")|a>'3'=1>0
f x=elem x$words"0th 1st 2nd 3rd"

Try it online!

90 bytes: Try it online!

GeoGebra, 56 bytes
s="1nd"
b=Ordinal(FromBase(Take(s,1,Length(s)-2),10))==s

Try It On GeoGebra!
Input is s, Output is b. b is true if s is a valid ordinal, false otherwise.
I just realized that GeoGebra has string support, so I had to try it.
Explanation:
Ordinal(FromBase(Take(s,1,Length(s)-2),10))==s
                 Take(s,1,Length(s)-2)                s without the last two characters
        FromBase(                     ,10)            Convert the string to a number
Ordinal(                                  )           Convert the number to ordinal form
                                           ==s        Is it equal to s?

Vyxal, 7 bytes
₌Ǎ⌊∆o$c

Try it Online!
Because we have a built-in for that.
Explained
₌Ǎ⌊∆o$c
₌Ǎ⌊     # Push the letters and numbers of the input
∆o      # Push the corresponding ordinal string
$c      # are the letters of the string contained in the ordinal string?

Factor + math.text.english, 37 bytes
[ 2 cut* swap dec> ordinal-suffix = ]

Explanation
                ! "121th"
2 cut*          ! "121" "th"
swap            ! "th" "121"
dec>            ! "th" 121
ordinal-suffix  ! "th" "st"
=               ! f

Scala, 51 bytes
Port of @Kevin Cruijssen's Java answer in Scala.
Try it online!
s=>s.matches(".*1.th|(.*[^1])?(1s|2n|3r|[^1-3]t).")

Python 2, 94 82 77 73 70 bytes
lambda s:'tsnrthtddh'[min(4,int(s[-3])*(('0'+s)[-4]!='1'))::5]==s[-2:]

Try it online!

05AB1E, 24 bytes
0ìþR2£`≠*.•’‘vê₅ù•sèsáнQ

Try it online!
or as a Test suite
Explanation
0ì                         # prepend 0 to input
  þ                        # remove letters
   R                       # reverse
    2£                     # take the first 2 digits
      `≠                   # check if the 2nd digit is false
        *                  # and multiply with the 1st digit
         .•’‘vê₅ù•         # push the string "tsnrtttttt"
                  sè       # index into this string with the number calculated
                    sáн    # get the first letter of the input
                       Q   # compare for equality

Ruby, 42 39 bytes
Lambda:
->s{s*2=~/1..h|[^1](1s|2n|3r|[4-90]t)/}

Try it online!
User input:
p gets*2=~/1..h|[^1](1s|2n|3r|[4-90]t)/

Try it online!
Matches:

1(anything)(anything)h - 12th
(not 1)1s - (1st)
(not 1)2n - (2nd)
(not 1)3r - (3rd)

Because [^1] (not 1) doesn't match the beginning of a string, the input is duplicated to make sure there's a character before the last.

Ruby -n, 35 bytes
p~/1..h|([^1]|^)(1s|2n|3r|[4-90]t)/

Try it online!
Same idea as above but instead of duplicating the string, this also matches the start of the string (^).

Excel, 63 bytes
=A1&MID("thstndrdth",MIN(9,2*RIGHT(A1)*(MOD(A1-11,100)>2)+1),2)

(MOD(A1-11,100)>2) returns FALSE when A1 ends with 11-13
2*RIGHT(A1)*(MOD(A1-11,100)>2)+1 returns 1 if it's in 11-13 and 3,5,7,etc. otherwise
MIN(9,~) changes any returns above 9 into 9 to pull the th from the string
MID("thstndrdth",MIN(~),2) pulls out the first th for inputs ending in 11-13, st for 1, nd for 2, rd for 3, and the last th for anything higher.
=A1&MID(~) prepends the original number to the ordinal.

Posting as wiki since I am not the author of this. (Source)

Wolfram Language (Mathematica), 122 bytes
Unlike most of the other answers on here, this will actually return false when the input is not a "valid ordinal pattern", so it will correctly return false on input like "3a23rd", "monkey" or "╚§+!".  So I think this works for the entire set of possible input strings.
StringMatchQ[((d=DigitCharacter)...~~"1"~(e=Except)~d~~(e["1"|"2"|"3",d]~~"th")|("1st"|"2nd"|"3rd"))|(d...~~"1"~~d~~"th")]

Try it online!

Wolfram Language (Mathematica), 65 59 bytes
SpokenString@p[[#]]~StringTake~{5,-14}&@@ToExpression@#==#&

Try it online!
Of course Mathematica has a built-in (although undocumented) for converting to ordinal number. Source.
(for the 65-byte version: according to that it seems that v9 and before doesn't need calling Speak before so it may be possible to save some more bytes)
Also check out KellyLowder's answer for a non-builtin version.

PCRE (Perl-compatible regular expression), 29 bytes
1.th|(?<!1)(1s|2n|3r)|[4-90]t

We accept th after any "teen" number, or after any digit other than 1..3.  For 1..3, we use a negative lookbehind to accept st, nd, or rd only when not preceded by 1.
Test program
#!/usr/bin/bash

ok=(✓ ❌)

for i
do grep -Pq '1.th|(?<!1)(1s|2n|3r)|[4-90]t' <<<"$i"; echo $i ${ok[$?]}
done

Results
1st ✓
1th ❌
2nd ✓
2th ❌
3rd ✓
3th ❌
4st ❌
4th ✓
11th ✓
11st ❌
12nd ❌
12th ✓
13th ✓
13rd ❌
112nd ❌
112th ✓
21nd ❌
32nd ✓
33rd ✓
21th ❌
21st ✓
11st ❌
111199231923819238198231923213123909808th ✓

x86 machine code, 65 bytes
00000000: 31c0 4180 3930 7cfa 8079 0161 7ef4 8079  1.A.90|..y.a~..y
00000010: ff31 7418 31db 8a19 83eb 308a 9300 0000  .1t.1.....0.....
00000020: 0031 db43 3851 010f 44c3 eb0a 31db 4380  .1.C8Q..D...1.C.
00000030: 7901 740f 44c3 c374 736e 7274 7474 7474  y.t.D..tsnrttttt
00000040: 74                                       t

Assembly:
section .text
	global func
func:					;the function uses fastcall conventions
					;ecx=first arg to function (ptr to input string)
	xor eax, eax			;reset eax to 0
	read_str:
		inc ecx			;increment ptr to string

		cmp byte [ecx], '0'
		jl read_str		;if the char isn't a digit, get next digit
		cmp byte [ecx+1], 'a'
		jle read_str		;if the char after the digit isn't a letter, get next digit
		cmp byte [ecx-1], '1'
		je tens 		;10-19 have different rules, so jump to 'tens'
		xor ebx, ebx		;reset ebx to 0
		mov bl, byte [ecx]  	;get current digit and store in bl (low byte of ebx)
		sub ebx, 0x30		;convert ascii digit to number
		mov dl, [lookup_table+ebx] ;get correct ordinal from lookup table
		xor ebx, ebx		;reset ebx to 0
		inc ebx			;set ebx to 1
		cmp byte [ecx+1], dl	;is the ordinal correct according to the lookup table?
		cmove eax, ebx		;if the ordinal is valid, set eax (return reg) to 1 (in ebx)
		jmp end			;jump to the end of the function and return

		tens:
		xor ebx, ebx		;reset ebx to 0
		inc ebx			;set ebx to 1
		cmp byte [ecx+1], 't'	;does it end in th?
		cmove eax, ebx		;if the ordinal is valid, set eax (return reg) to 1 (in ebx)

	end:
	ret				;return the value in eax
section .data
	lookup_table db 'tsnrtttttt'

Try it online!

PHP, 60 bytes
boring: regexp once more the shortest solution
<?=preg_match("/([^1]|^)(1st|2nd|3rd|\dth)$|1\dth$/",$argn);

empty output for falsy, 1 for truthy.
Run as pipe with -nF or try it online. (TiO wrapped as function for convenience)

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

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


text:
Count the number of ways of putting balls into bins
In this task you are given an odd number of white balls and the same number of black balls. The task is to count all the ways of putting the balls into bins so that in each bin there is an odd number of each color.
For example, say we have 3 white balls. The different ways are:
(wwwbbb)
(wb)(wb)(wb)

for the two different possibilities.
If we have 5 white balls the different ways are:
(wwwwwbbbbb)
(wwwbbb)(wb)(wb)
(wwwb)(wbbb)(wb)
(wb)(wb)(wb)(wb)(wb)

You can take the input, which is a single integer, in any way you like.  The output is just a single integer.
Your code must be fast enough so that you have seen it complete for 11 white balls.
You can use any language or library that you like.

Please clarify, can our output be just the number of different ways? That is, a single number as output?

@orlp I think that is what Lembik meant. There are also only 705432 possible combinations disregarding the rules of odd numbers only for 11 balls of each colour

@orlp Yes a single number. Having said that, it would be very interesting to see the  list of possible assignments of balls in bins if anyone wanted to show those too.

I assume this is from https://math.stackexchange.com/questions/2736933/how-many-ways-to-get-an-odd-number-of-each-color-in-each-bin You should cite it @Lembik

I think you should take out the speed criterion or make it more specific. "Fast enough" is too vague.

You know that PPCG users are crazy enough that they would rather spending money on using a supercomputer to compute it for 11 than taking 1 more byte? So why wasting their money? :)

rather spending money on using a supercomputer only apply for [tag:code-golf], though

relevant to current conversation

(remark: It's possible to calculate P function efficiently with a complicated formula. It may be possible to calculate this function too, with a suitable formula.)

I have added this to the On-Line Encyclopedia of Integer Sequences (OEIS) as sequence A302919.

Pari/GP, 81 bytes
p=polcoeff;f(n)=p(p(prod(i=1,n,prod(j=1,n,1+(valuation(i/j,2)==0)*x^i*y^j)),n),n)

For more efficiency, replace 1+ with 1+O(x^(n+1))+O(y^(n+1))+ (the first O term alone already helps a lot).
Try it online! (earlier 86 byte version with a pair of unneeded parens and without the p= abbreviation)
Old version, 90 bytes
f(n)=polcoeff(polcoeff(taylor(1/prod(i=0,n,prod(j=0,n,1-x^(2*i+1)*y^(2*j+1))),x,n+1),n),n)

Computing f(11) needs a bigger stack size, the error message will tell you how to increase it. It's more efficient (but less golfy) to replace the two n that appear as second arguments to prod with (n-1)/2.

Works up to 13 for me!

I guess that is with the version using (n-1)/2?

Yes, good point.

Out of interest, do you think it's possible to compute f(500)?

It takes a few minutes to compute f(500)=214621724504756565823588442604868476223315183681404

Python 3, 108 bytes
C=lambda l,r,o=():((l,r)>=o)*l*r%2+sum(C(l-x,r-y,(x,y))for x in range(1,l,2)for y in range(1,r,2)if(x,y)>=o)

Recursively enumerates all sets, making sure to not get duplicates by always generating the sets in order. Reasonably fast when memoized using C = functoools.lru_cache(None)(C), but this is not necessary for n = 11.
Call C(num_white, num_black) to get your result. First couple of n:
1: 1
3: 2
5: 4
7: 12
9: 32
11: 85
13: 217
15: 539
17: 1316
19: 3146
21: 7374

To generate the results:
def odd_parts(l, r, o=()):
    if l % 2 == r % 2 == 1 and (l, r) >= o:
        yield [(l, r)]

    for nl in range(1, l, 2):
        for nr in range(1, r, 2):
            if (nl, nr) < o: continue
            for t in odd_parts(l - nl, r - nr, (nl, nr)):
                yield [(nl, nr)] + t

E.g. for (7, 7):
[(7, 7)]
[(1, 1), (1, 1), (5, 5)]
[(1, 1), (1, 1), (1, 1), (1, 1), (3, 3)]
[(1, 1), (1, 1), (1, 1), (1, 1), (1, 1), (1, 1), (1, 1)]
[(1, 1), (1, 1), (1, 1), (1, 3), (3, 1)]
[(1, 1), (1, 3), (5, 3)]
[(1, 1), (1, 5), (5, 1)]
[(1, 1), (3, 1), (3, 5)]
[(1, 1), (3, 3), (3, 3)]
[(1, 3), (1, 3), (5, 1)]
[(1, 3), (3, 1), (3, 3)]
[(1, 5), (3, 1), (3, 1)]

Very nice indeed.

Python 3, 180 172 bytes
def f(n):
 r=range;N=n+1;a=[N*[0]for _ in r(N)];R=r(1,N,2);a[0][0]=1
 for i in R:
  for j in R:
   for k in r(N-i):
    for l in r(N-j):a[k+i][l+j]+=a[k][l]
 return a[n][n]

Try it online!
Straightforward implementation of the generating function. Long but (somewhat) efficient. O(n4) time, O(n2) memory.
The resulting array a contains all results of all sizes up to n, although only a[n][n] is returned.

What does your code calculate for even n, out of interest?  As in a[4][4].

This is the fastest solution so far too!

@Lembik a[4][4] = Number of ways to put 4 white balls and 4 black balls into bins, each bin has an odd number of white balls and an odd number of black balls. Exacly as in the defintion.

Python 2, 168 181 bytes
from itertools import*
r,p=range,product
def f(n):
 a,R=eval(`[[0]*n]*n`),r(1,n,2);a[0][0]=1
 for i,j in p(R,R):
  for k,l in p(r(n-i),r(n-j)):a[k+i][l+j]+=a[k][l]
 return a[-1][-1]

Try it online!

Based on user202729's answer.
Edit: Made it an independent function.
Saved 2 bytes thanks to user202729.

This is a snippet (assumes n contains the input) You should either add def f(n): or n=input() (to make it a function/full program resp.)

And... this is Python 2, you can use a tab instead of two spaces. Saves a byte. The a can be eval(\[[0]*n]*n`)(where`stands forrepr`).


text:
Generate a Walsh Matrix
A Walsh matrix is a special kind of square matrix with applications in quantum computing (and probably elsewhere, but I only care about quantum computing).
Properties of Walsh matrices
The dimensions are the same power of 2. Therefore, we can refer to these matrices by two's exponent here, calling themW(0), W(1), W(2)...
W(0) is defined as [[1]].
For n>0,  W(n) looks like:
[[W(n-1)  W(n-1)]
 [W(n-1) -W(n-1)]]

So W(1) is:
[[1  1]
 [1 -1]]

And W(2) is:
[[1  1  1  1]
 [1 -1  1 -1]
 [1  1 -1 -1]
 [1 -1 -1  1]]

The pattern continues...
Your task
Write a program or function that takes as input an integer n and prints/returns W(n) in any convenient format. This can be an array of arrays, a flattened array of booleans, a .svg image, you name it, as long as it's correct.
Standard loopholes are forbidden.
A couple things:
For W(0), the 1 need not be wrapped even once. It can be a mere integer.
You are allowed to 1-index results—W(1) would then be [[1]].
Test cases
0 -> [[1]]
1 -> [[1  1]
      [1 -1]]
2 -> [[1  1  1  1]
      [1 -1  1 -1]
      [1  1 -1 -1]
      [1 -1 -1  1]]
3 -> [[1  1  1  1  1  1  1  1]
      [1 -1  1 -1  1 -1  1 -1]
      [1  1 -1 -1  1  1 -1 -1]
      [1 -1 -1  1  1 -1 -1  1]
      [1  1  1  1 -1 -1 -1 -1]
      [1 -1  1 -1 -1  1 -1  1]
      [1  1 -1 -1 -1 -1  1  1]
      [1 -1 -1  1 -1  1  1 -1]]

8 -> Pastebin
This is code-golf, so the shortest solution in each language wins! Happy golfing!

Sandbox

Can the results be 1-indexed? (e.g. W(1) returns [[1]], W(2) returns [[1,1],[1,-1]...)

@Leo Yep, they can. Edited in.

Perl 6, 63 44 40 bytes
{map {:3(.base(2))%2},[X+&] ^2**$_ xx 2}

Try it online!
Non-recursive approach, exploiting the fact that the value at coordinates x,y is (-1)**popcount(x&y). Returns a flattened array of Booleans.
-4 bytes thanks to xnor's bit parity trick.

MATL, 4 bytes
W4YL

Try it online!
How it works:
W       % Push 2 raised to (implicit) input
4YL     % (Walsh-)Hadamard matrix of that size. Display (implicit)

Without the built-in: 11 bytes
1i:"th1M_hv

Try it online!
How it works:
For each Walsh matrix W, the next matrix is computed as [W W; W −W], as is described in the challenge. The code does that n times, starting from the 1×1 matrix [1].
1       % Push 1. This is equivalent to the 1×1 matrix [1]
i:"     % Input n. Do the following n times
  t     %   Duplicate
  h     %   Concatenate horizontally
  1M    %   Push the inputs of the latest function call
  _     %   Negate
  h     %   Concatenate horizontally
  v     %   Concatenate vertically
        % End (implicit). Display (implicit)

Ugh... and here I am trying to use kron. ;)

Haskell, 57 56 bytes
(iterate(\m->zipWith(++)(m++m)$m++(map(0-)<$>m))[[1]]!!)

Try it online! This implements the given recursive construction.
-1 byte thanks to Ørjan Johansen!

You can save a byte with (iterate(\m->zipWith(++)(m++m)$m++(map(0-)<$>m))[[1]]!!).

Octave with builtin, 18 17 bytes
@(x)hadamard(2^x)

Try it online!
Octave without builtin, 56 51 47 bytes
function r=f(x)r=1;if x,r=[x=f(x-1) x;x -x];end

Try it online! Thanks to @Luis Mendo for -4.
Octave with recursive lambda, 54 53 52 48 bytes
f(f=@(f)@(x){@()[x=f(f)(x-1) x;x -x],1}{1+~x}())

Try it online! Thanks to this answer  and this question for inspiration.

If the function is defined in a file the second end is not needed. So you can move it to TIO's header and thus remove it from the byte count

APL (Dyalog Unicode), 12 bytes
(⍪⍨,⊢⍪-)⍣⎕⍪1

Try it online!
Output is a 2-dimensional array.

Python 2, 75 71 bytes
r=range(2**input())
print[[int(bin(x&y),13)%2or-1for x in r]for y in r]

Try it online!
The Walsh Matrix seems to be related to the evil numbers. If x&y (bitwise and, 0-based coordinates) is an evil number, the value in the matrix is 1, -1 for odious numbers. The bit parity calculation int(bin(n),13)%2 is taken from Noodle9's comment on this answer.

Intuitively, the sign at (x, y) is flipped as many times as there are levels of recursion on which (x, y) is in the lower-right quadrant of the (2^k × 2^k) matrix, which occurs when x and y both have a 1 in the k-th bit. Using this fact, we can simply count the 1-bits in x&y to determine how many times to flip the sign.

R, 61 56 53 50 bytes
w=function(n)"if"(n,w(n-1)%x%matrix(1-2*!3:0,2),1)

Try it online!
Recursively calculates the matrix by Kronecker product, and returns 1 for n=0 case (thanks to Giuseppe for pointing this out, and also to JAD for helping to golf the initial version).
Additional -3 bytes again thanks to Giuseppe.

Dunno if returning 1 rather than matrix(1) is valid, but if it is you can golf this down, and there's a 61 byte Reduce approach as well: try it!

I am also unsure about the format for n=0 case, most other answers wrap it in [[1]], but not all...

You can replace matrix(1) with t(1).

@JAD, thanks, this greatly reduces the cost of "sticking to the format".

Question has been edited. You can return an integer rather than a matrix.

1-2*!3:0 is shorter than c(1,1,1,-1) by three bytes.

Haskell, 41 bytes
(iterate([id<>id,id<>map(0-)]<*>)[[1]]!!)

Try it online!
The version of Haskell on TIO doesn't yet have (<>) in Prelude so I import it in the header.

Jelly, 14 bytes
1WW;"Ð€,N$ẎƊ⁸¡

Try it online!
Change the G to ŒṘ in the footer to see the actual output.

JavaScript (ES6), 77 bytes
n=>[...Array(1<<n)].map((_,i,a)=>a.map((_,j)=>1|-f(i&j)),f=n=>n&&n%2^f(n>>1))

The naive calculation starts by taking 0 <= X, Y <= 2**N in W[N]. The simple case is when either X or Y is less than 2**(N-1), in which case we recurse on X%2**(N-1) and Y%2**(N-1). In the case of both X and Y being at least 2**(N-1) the recursive call needs to be negated.
If rather than comparing X or Y less than 2**(N-1) a bitmask X&Y&2**(N-1) is taken then this is non-zero when the recursive call needs to be negated and zero when it does not. This also avoids having to reduce modulo 2**(N-1).
The bits can of course be tested in reverse order for the same result. Then rather than doubling the bitmask each time we he coordinates can be halved instead, allowing the results to be XORed, whereby a final result of 0 means no negation and 1 means negation.

Pari/GP, 41 bytes
f(n)=if(n,matconcat([m=f(n-1),m;m,-m]),1)

Try it online!

K (ngn/k), 18 bytes
{x{(x,x),'x,-x}/1}

Try it online!

Um, why is the interpreter not on GitHub?

@EriktheOutgolfer I prefer not to publish the code too widely at this time.

Hm, then how did you add it to TIO?

@EriktheOutgolfer I asked politely :) There are other proprietary languages on TIO - Mathematica, Dyalog.

Husk, 13 bytes
!¡§z+DS+†_;;1

Try it online!
1-indexed.
Explanation
!¡§z+DS+†_;;1
 ¡        ;;1    Iterate the following function starting from the matrix [[1]]
  §z+              Concatenate horizontally
     D               The matrix with its lines doubled
      S+†_           and the matrix concatenated vertically with its negation
!                Finally, return the result after as many iterations as specified
                 by the input (where the original matrix [[1]] is at index 1)

Wolfram Language (Mathematica), 39 bytes
Nest[ArrayFlatten@{{#,#},{#,-#}}&,1,#]&

Try it online!
Almost directly copied from this answer of mine.

Jelly, 8 bytes
Ø+ṗ&P¥þ`

Try it online!
Ø+ṗ         Take the Cartesian product of [1, -1] with itself n times.
      þ`    Table that with itself by:
   &        vectorizing bitwise AND (i.e. logical AND of sign bits!)
    P¥      then multiply the results.

A cell is -1 iff it has an odd number of 1 bits in the bitwise AND of its 0-indices. This effectively computes [0 .. 2^n), tables that with itself by bitwise-AND-then-popcount, and raises -1 to each resulting power, but shortcuts all of those steps by representing 0 bits as 1 and 1 bits as -1 to begin with: ṗ provides the desired range without having to explicitly compute 2^n, and the product is -1 iff there are an odd number of -1s, while thanks to the magic of zipwith-vectorization and two's complement representation the bitwise AND of two sign-list integers is still their bitwise AND as sign-list integers.

Nibbles, 10 bytes
.;`,^2$.@^-1+``@`&

Attempt This Online!
Uses the formula \$W_{i,j} = \left(-1\right)^{\operatorname{popcount}(\operatorname{bitand}(i,j))}\$.

JavaScript (Node.js),100 89 79 bytes
f=n=>n?[...(m=F=>r.map(x=>[...x,...x.map(y=>y*F)]))(1,r=f(n-1)),...m(-1)]:[[1]]

Try it online!

05AB1E, 16 bytes
oFoL<N&b0м€g®smˆ

Try it online!
Explanation
oF                 # for N in 2**input do:
  oL<              # push range [1..2**input]-1
     N&            # bitwise AND with N
       b           # convert to binary
        0м         # remove zeroes
          €g       # length of each
            ®sm    # raise -1 to the power of each
               ˆ   # add to global array

I wish I knew a shorter way to compute the Hamming Weight.
1δ¢˜ is the same length as 0м€g.

Stax, 20 bytes
àΩ2┤â#╣_ê|ª⌐╦è│╞►═∞H

Run and debug it at staxlang.xyz!
Thought I'd give my own challenge a try after some time. Non-recursive approach. Not too competitive against other golfing languages...
Unpacked (24 bytes) and explanation
|2c{ci{ci|&:B|+|1p}a*d}*
|2                          Power of 2
  c                         Copy on the stack.
   {                  }     Block:
    c                         Copy on stack.
     i                        Push iteration index (starts at 0).
      {           }           Block:
       ci                       Copy top of stack. Push iteration index.
         |&                     Bitwise and
           :B                   To binary digits
             |+                 Sum
               |1               Power of -1
                 p              Pop and print
                   a          Move third element (2^n) to top...
                    *         And execute block that many times.
                     d        Pop and discard
                       *    Execute block (2^n) times

Python 2, 80 79 bytes
f=lambda n:n<1and[[1]]or[r*2for r in f(n-1)]+[r+[-x for x in r]for r in f(n-1)]

Try it online!

0**n*[[1]] for -1 byte

Python 2, 49 bytes
Showcasing a couple of approaches using additional libraries.
This one relies on a built-in in Scipy:
lambda n:hadamard(2**n)
from scipy.linalg import*

Try it online!
Python 2, 65 bytes
And this one only uses Numpy, and solves by Kronecker product, analogously to my R answer:
from numpy import*
w=lambda n:0**n or kron(w(n-1),[[1,1],[1,-1]])

Try it online!


text:
Escape from the tarpit (Cops)
This is a cops-and-robbers challenge based around defining languages and proving they are Turing complete.
This is the cops' thread. The robbers' thread is here.
Cops
As a cop, you will prepare two things:

A formal specification of a programming language, or other computational system. (Computational systems are defined below.)

A proof that your system is Turing complete, according to the somewhat strict definition below.

You will post your specification of your language, and the robbers will try to "crack" it by proving its Turing completeness. If your submission is not cracked within one week you can mark it as safe and post your proof. (Your answer can be invalidated if someone finds a flaw in your proof, unless you can fix it.)
This is a popularity-contest, so the winner will be the answer that has the most votes, and which is not cracked or invalidated. The challenge is open-ended - I won't be accepting an answer.
For the sake of this challenge, a computational system will be defined as four things:

A "program set" P. This will be a countably infinite set, e.g. strings, integers, binary trees, configurations of pixels on a grid, etc. (But see the technical restriction below.)

An "input set" I, which will also be a countably infinite set, and need not be the same set as P (although it can be).

An "output set" O, which similarly will be a countably infinite set, and may or may not be the same as P or I

A deterministic, mechanistic procedure for producing an output o from program p and input i, where p, i and o are members of P, I and O respectively. This procedure should be such that it could, in principle, be implemented on a Turing machine or other abstract model of computation. The procedure may, of course, fail to halt, depending on the program and its input.

The sets P, I and O must be such that you can express them as strings in a computable manner. (For most sensible choices this will not matter; this rule exists to prevent you from choosing strange sets, such as the set of Turing machines that don't halt.)
Turing completeness will be defined as the following:

For any computable partial function f from I to O, there exists a program p in P such that given p and input i, the output is f(i) if f(i) has a value. (Otherwise the program doesn't halt.)

The word "computable" in the above definition means "can be computed using a Turing machine".
Note that neither rule 110 nor bitwise cyclic tag are Turing-complete by this definition, because they don't have the required input-output structure. Lambda calculus is Turing complete, as long as we define I and O to be the Church numerals. (It is not Turing-complete if we take I and O to be lambda expressions in general.)
Note that you don't have to provide an implementation of your language, but you are welcome to include one in your answer if you like. However, you shouldn't rely on the implementation to define the language in any way - the spec should be complete in itself, and if there is a contradiction between the spec and the implementation this should be treated as a bug in the implementation.

Sandbox.

Sorry guys, but [tag:popularity-contest] is an objective winning criterion. Being a pop-con does not make a challenge off topic, and never has done. The most recent meta discussion has a consensus of +27 in favour of this, so although the five of you might prefer it to be different you really have no leg to stand on. Since this question has been closed against agreed policy, I request that it be reopened.

(note that WhatWizard closed it for a different reason.)

Please do not use close votes as an "I disagree" or an "I don't like this" button. Close votes are to be used to enforce site policy. If you disagree with a policy, take it to meta - don't close challenges that are on-topic by community consensus.

@Mego I voted to close this as too broad, but I also think that this is off-topic by our existing rules for pop-cons.  We expect popularity contests to have a "A clear specification of the goal that must be achieved", this question is a do X in the most creative way.  It is clear to me that there is no objective other than to be a valid answer and that the pop-con tag is attached just to keep it open.

@WhatWizard the goal that must be achieved is being non-obviously Turing complete, with non-obviousness assessed by not being cracked within a week. Is that not clear?

@Nathaniel I would argue that the win condition is really the cops & robbers in this case, where a set time period is required. Pop-con is more of a whichever post gets the most votes is the winner.

Blindfolded Arithmetic
Possibly a fairly easy language to start off with, relatively
speaking.  (There are limits on how difficult a language I can make
because I have to prove it Turing-complete myself!)
For this language, the program set is the set of Blindfolded
Arithmetic programs as given in the section "program" below, the input
set is the set of positive integers, and the output set is the set of
integers (the entire set, not just the positive integers).
This language is fairly interesting – maybe even practically useful –
because it has a more or less total lack of control flow, being
entirely based on computations on numbers you can't see.  That makes
it potentially useful as a language for implementing programs inside
homomorphic encryption
systems.
Specification
Blindfolded Arithmetic is an esoteric programming language with the
following specifications:
Data storage
A state of a running Blindfolded Arithmetic program consists of six
variables, each of which can store an integer.  (There are no limits
on how large or small these integers can get; in particular, they can
go negative.)  The variables are called a, b, c, d, e, and
i.
At the start of the program, a to e inclusive are each initialised
to 0, and i is initialised to a positive integer taken from user
input.  (If no input is available, i is initialised to 1.)
If the program ceases execution (this can only occur due to division
by zero), the value of i immediately before the division was
attempted is used as the program's output.
Program
A Blindfolded Arithmetic program is a list of commands, each of which
has one of the following forms (where v can be replaced by any
variable name, potentially a different name each time it's used):

v = v + v
v = v - v
v = v * v
v = v / v

Note that each operand of the commands must be a variable; this
language does not allow the use of literal integers.
Execution of the program is performed by running each of the commands
in sequence, and then looping back to the start and continuing to run
the commands in sequence again, ad infinitum (or until there's an
attempt to divide by zero, which ends the program).
Each command has the same semantics as you'd expect from the notation,
which is no different from that used by most practical programming
languages: the values of the second and third variables metioned in
the command are taken, an arithmetic operation
(add/subtract/multiply/divide respectively for the four forms of
command) is applied to them, and the resulting value stored into the
first variable.  Division here is integer division, rounding
towards 0.
There is no control flow of any kind, other than program exit; the
commands always cycle in sequence, up until a division by zero (if
any) occurs and ends the program.  In particular, there's no way to
directly read variables, only to use them as a source of calculations
whose results impact the values assigned to other variables.

Can you check if my answer is missing anything?

@user202729: (commenting here as I don't have the rep to comment there) You can't simulate a "move if false" out of a "flip" and a "move if true" because you can't undo the flip after you move. So you'll need some other way to handle that (e.g. a way to invert tests, that shouldn't be hard). More notably, though, that's a Turing-completeness proof in terms of halt behaviour, but the definition in the question requires you to be able to do I/O as well, so you need to prove you can do that.

I hope the I/O part (now) are ok. As for the other issue, I realize that the inner if are not even necessary, intermediate states solve all problem (although I'm not sure how to word that)

@user202729: it's still not perfectly right (e.g. the question requires you to be able to output negative numbers, and you'd also need to change the purpose of i so that the state number – which will always be "halt" – won't be part of the output), but it's close enough that I'm not going to mark this as safe, as you'd clearly get a full crack given enough time and with sufficient clarification of the rules. I don't want to win this challenge on technicalities.

This is very close to the restrictions that http://www.de.ioccc.org/years-spoiler.html#1992_buzzard.1 uses. That implementation uses fixed size integers and so isn't Turing-complete, and this one is seriously restricted in the number of variables you have, but I think the proof is nevertheless similar.


text:
Escape from the tarpit (Robbers)
This is a cops-and-robbers challenge based around defining languages and proving they are Turing complete.
This is the robbers' thread. The cops' thread is here.
Robbers
The cops will post definitions of Turing-complete languages. Your task is to crack them by proving that they are indeed Turing complete. See the cops' challenge for more details and formal specifications.

ais523's answer - Blindfolded Arithmetic
(I hope my proof is understandable. I can't check my own proof e.g. with a Try it online! link so I'm not sure)
All code in this post will be Python pseudocode, with rep n: repeat n times. All conditionals must be either 0 or 1.
It's provable that the value of i is always >0 in the program execution, so i/i always give 1.
Define some building blocks:
if c: a = a + b is equivalent to d = b * c; a = a + d; assuming d is unused.
So, let (statement) be if c: statement where c can be some condition.
b = b * 2**N (where N is a compile-time constant) is equivalent to
rep N: b = b + b

b = a / 2**N is equivalent to
b = i / i
b = b * 2**N
b = a / b

b = a % 2**N is equivalent to
b = a / 2**N
b = b * 2**N
b = a - b

Any 2-symbol Turing machine with N states can be written like this:
while True:
    if state == 0:
        # process state 0
    if state == 1:
        # process state 1
    .
    .
    .
    if state == HALTING_STATE:
        0 / 0
    .
    .
    .
    if state == N-1:
        # process state N-1
    state = newstate

where each # process state block looks like this
# optional (not all states need this)
tape.move_left()

# optional
tape.move_right()

# optional
tape.flip()

new_state = a if tape.value() else b

This needs to be translated to BFA compatible code.

Two variables i and a will be used to represent the tape and state (and tape as well)
The content of i at each wraparound:

N least significant bits are equal to 2**state (i.e., the state'th significant bit is on, all other bits are off)
The rest of bits form the right half of the tape.

The content of a at each wraparound:

The left half of the tape.

The tape pointer is on the least significant bit of a.

At the beginning of each loop, N bits are inserted between the tape part and the state part in i:
d = i / 2**N
d = d * 2**N
i = i - d
d = d * 2**N
i = i + d

At each # process state i block, the structure of i is:

M-N least significant bits: the remaining part of the old value of state (state >> i). (where M = 2*N - i)
N next LSB: (partial) value of new_state (or 0 if it's not defined yet in that loop)
Rest: Tape.

Of course M is a compile time constant.
(as an exception, the "process halting state" block can be implemented as
if i%2: b = b - b; b = b / b;

or equivalently (assume c isn't used)
c = i % 2; b = i / i; if c: b = b - b; b = b / b;

)

More rewriting:

(tape.move_left()) (the outer () stands for conditional, as always)
# allocate a free bit on (i)
b = i / 2**M
(i = i + b)
# copy that bit from (a) to (i)
b = a % 2
b = b * 2**M
(i = i + b)
# remove a byte from (a)
b = i/i
(b = b + b)
a = a / b

(tape.move_right())
# allocate (M+1) bits at the end of (a)
(a = a * 2**(M+1))

# copy that from (i) to (a)
b = i % 2**(M+1)
(a = a + b)

# remove the (M) bits from (a) that is over-copied from (i)
b = i/i # now b==1
rep M: (b = b + b)
a = a / b # if the conditional fails a = a / 1 is a no-op.

# clear that bit on (i)
b = a % 2
b = b * 2**M
(i = i - b)

# remove the bit from (i)
b = i / 2**(M+1)
b = b * 2**M
(i = i - b)

(tape.flip())
b = a % 2
b = b * 2
(a = a - b)
b = i/i
(a = a + b)

(new_state = a if tape.value() else b)

TODO

There are 2 remaining issues:

Only the bits to the left of the pointer is outputted, and
if not tape_value(): tape.move_left() (and the equivalent move_right) is not directly supported.

To solve those problems,

A TM with only a half of the tape is still TC.

You can interlace the positive-index cells with the negative-index ones, and replace every movement with a double-movement (doubling the number of states). You'll also need to mark two cells at the left with special symbols so you know to shift by one and turn around (1 extra symbol; 1 extra state), and you'll need to have a reversed copy of every state for when you're in negative-land and every movement is backwards (again doubling the number of states).

(source)
So, it's possible to:

Make the tape from 2 interleaving infinite tapes.
One of them only have one 1 denoting the right end of the tape. The other is used to store data.
At program halt, instead of immediately exiting, move right until hit the end of the tape.

So the whole tape are stored in the right half (i.e., i) and readable at program termination.

Am I still missing something?

(See comments on the robbers' thread for discussion of this answer)


text:
Generate Men of Culture
This challenge is inspired by the meme Men of Culture.
The meme involves blanking out parts of the original caption,

Ah, I see you're a man of culture as well.

to make it appear as if the character is saying something else.
Your challenge is to write a program that, given an input, show how the original sentence can be blanked out to achieve the input string.
Rules:

Use a - character to represent a blanked out character.
You must not add additional letters to achieve the input string
You may treat string comparisons as case-insensitive
You may ignore whitespace in string comparisions
If no substitution is possible, output a falsy value.
You may substitute redundant whitespace with a - as well, although not required.
Where multiple solutions are possible, you may output any of them.

Test cases:
Basic:
Example Meme 1
Ah, I see you're a well.
> Ah, I see you're a --- -- ------- -- well.

Example Meme 2
Ah, I see well.
> Ah, I see ------ - --- -- ------- -- well.

Edge case 1:
What did you just say about me, you little
> false

Edge case 2 (edited):
*no input*
> --- - --- ------ - --- -- ------- -- -----

Intermediate:
Example Meme 3
Ah, I see you're Orwell.
> Ah, I see you're - --- o- -----r- -- well.

Example Meme 4
Ah, ymca.
> Ah, - --- y----- - m-- -- c------ a- ----.

Example Meme 5
Ah, a manual.
> Ah, - --- ------ a man -- -u----- a- --l-.
OR: > Ah, - --- ------ a man -- -u----- a- ---l.

Harder:
Example Meme 6
tea.
> --- - --- ------ - --- -- ---t--e a- ----.

Example Meme 7
eeeee
> --- - -ee -----e - --- -- ------e -- -e---

TL;DR: Given an input string, output a string which represents how the original string should be modified to fit the input string, by using a "-" to represent a blanked out character. If a substitution is not possible, output a falsy value.
Code golf, so shortest code in bytes wins.
Edit: Clarifications

Ignore whitespace in string comparisions means you can strip away whitespace before you compare strings. For instance, the inputs Ah, a manual and Ah ,      a   manual are treated as equal. Other punctuation , ' . must be preserved. Similarly for output, Ah, a manual is equal to Ah, amanual.
substitute redundant whitespace refers to the spaces present in the original caption. You don't need to replace them with "-", but if replacing nets you more points then go ahead.

Your "Orwell" output seems wrong: you've changed an 'f' to an 'r' in the first one.

What exactly is the "original string"? With or without the trailing .? How is it capitalized?

What output should "Ah,<5 SPACES HERE>a manual." yield?

If a substitution is not possible, output a falsy value. Well, requiring input validation is highly discouraged.

You may treat string comparisons as case-insensitive does that mean we must treat the input as case-insensitive or that we're able to take input in whatever case we want? Also, by You may ignore whitespace in string comparisions, do you mean we must ignore spaces? And what is "redundant whitespace"?

Do we need to have the sentence "Ah, I see you're a Man of Culture as well" in the source code, or can we get the user to pass it as a parameter? Also, following from @EriktheOutgolfer says, do they have to be case insensitive inputs, or can we use case sensitive?

I've edited the question for clarification.

Because it's not enforced that the comparison must be case-insensitive, can we return falsy value for Orwell?

@user202729 Yes, but if you do make it case-sensitive, make sure "orwell" works.

(By the way, I feel that your challenge has too many optional features. That's (generally) not good. At least they are not bonuses.)

(and the input/output are a bit hard to parse)

I think "input validation," if you could call it that, makes sense here @EriktheOutgolfer

><>, 94 bytes
"vAh, I see you're a Man of Culture as well.
0/i~ <r
!\:?!^:}=0={:@*:@"-"$?$~}$:@?
<>~i+0)?;>o

Try it online!
Case-sensitive, doesn't ignore whitespace or punctuation and outputs an empty string if the input is invalid. If you want to try other strings, you can just modify the first line after the "v, as long as it doesn't contain a " or a null byte.

Jelly, 58 55 48 45 bytes
“¬²Ẉ,ȷCIbƝɼeỴƤ/ɓIŒ;ṫṚS⁶_ŀỤ ṂB⁾÷ƈ»Ḣ”-1ị⁼ɗ?@€xṆ

Try it online!

More readable version:
“Ah, I see you're a man of culture as well.”Ḣ”-1ị⁼ɗ?@€xṆ

String compression breakdown:
Ah, I{short: see}{short: you}'re a{short: man} of{long: culture} as{short: we}ll.

Retina 0.8.2, 117 bytes
^.
¶Ah, I see you're a Man of Culture as well.¶$&
{+i`¶(\W|(\w))(.*¶)(?(2)\W*\2)
$1¶$3
}1`¶\w
-¶
.*¶.*¶.*\w.*|¶.*¶.*

Try it online! Could save 1 byte by requiring case-sensitivity. Could save 3 bytes by returning --, - --- ---'-- - --- -- ------- -- ----. on empty input. Explanation:
^.
¶Ah, I see you're a Man of Culture as well.¶$&

Prepend the desired text to the input.
{+i`¶(\W|(\w))(.*¶)(?(2)\W*\2)
$1¶$3

Move as many characters from the desired text to the result as possible. If the character is a letter then it also needs to match the next letter in the input, which is then deleted.
}1`¶\w
-¶

If there is no matching letter in the input, change it to a - and try again.
.*¶.*¶.*\w.*|¶.*¶.*

If there are still letters left in the input, delete everything, otherwise delete the remainder of the input.

Python 2, 126 114 bytes
i=input()
r=''
for c in"Ah, I see you're a man of culture as well.":x=c==i[:1];r+=c*x or'-';i=i[x:]
print(i=='')*r

Try it online!

Python 2, 108 106 bytes
Input is a list of chars.
lambda i:''.join(c==`i`[2:3]and i.pop(0)or'-'for c in"Ah, I see you're a man of culture as well.")*(i==[])

Try it online!

Could (i=='') not be (i<' ') (using a tab, the lowest printable character)?

@JonathanFrech this is possible, but it is both 7 bytes

Well, you have got a point there ...

JavaScript (Node.js), 135 bytes
x=>!!x&&(t="Ah, I see you're a Man of Culture as well.".replace(/./g,c=>c>' '?/^(.)\1/i.test(c+x)?(x=x.slice(1).trim(),c):'-':c),!x&&t)

Try it online!
If "may" mean either do or not do is okay, then
JavaScript (Node.js), 106 bytes
x=>x&&(t="Ah, I see you're a Man of Culture as well.".replace(/./g,c=>c==x[0]?(x=x.slice(1),c):'-'),!x&&t)

Try it online!

JavaScript (Node.js), 122 120 bytes
x=>"Ah, I see you're a Man of Culture as well.".replace(/./g,c=>c>' '?/^(.)\1/i.test(c+x)?(x=x.slice(1).trim``,c):'-':c)

Try it online!
Explanation :
x =>                 // It takes in 'x' as parameter for function a string
    "Ah, I see you're a Man of Culture as well.". // What the actual is
            .replace(                             // Now we are gonna replace
                    /./g,     // selects everything
                    c =>      // lambda function with param c
                        c > ' ' ?
                        /^(.)\1/i.test(           // does it all
                            c + x ) ?            // checks if there is a match
                            (x=x.slice(1). // returns everything from 1 to end in an array
                                trim`` ,   // removes whitespaces
                            c : '-' : c)   // and done

Can be reduced further but replaces whitespaces with '-' as well. If this is acceptable then
JavaScript (Node.js), 112 bytes
x=>"Ah, I see you're a Man of Culture as well.".replace(/./g,c=>/^(.)\1/i.test(c+x)?(x=x.slice(1).trim``,c):'-')

Try it online!
Reduced even further , only replaces whitespaces that are after the given string with '-'.
JavaScript (Node.js), 105 bytes
x=>"Ah, I see you're a Man of Culture as well.".replace(/./g,c=>/^(.)\1/i.test(c+x)?(x=x.slice(1),c):'-')

Try it online!

Don't pass What did you just say about me, you little

I'm not getting correct output for your code for the What did you just say about me, you little test case. Your program produces --- - --- ------ - --- -- ------- -- w---- as output which is not what the challenge spec requires.

Haskell, 182 174 172 171 170 169 bytes
import Data.Char
t=toLower
a!b=(b:)<$>a
""%l=Just$'-'<$l
l@(a:b)%(c:d)|t a==t c=b%d!c|1>0=l%d!'-'
_%_=mempty
(%"Ah, I see you're a man of culture as well.").concat.words

Try it online!
Ungolfed:
import Data.Char

template = "Ah, I see you're a man of culture as well."

-- strip spaces
preprocess :: String -> String
preprocess = filter (/=' ')

-- case-insensitive character comparison
a#b = (toLower a) == (toLower b)

strike' :: String -> String -> Maybe String
strike' "" "" = Just ""  -- base case
strike' _ "" = Nothing   -- chars are exhausted, impossible to convert
strike' "" rem = Just $ '-' <$ rem  -- full match, strike rest of chars
strike' cur@(x:xs) (r:rs)
    | x # r     =   (r:) <$> strike' xs rs  -- character matches; pop a char
    | otherwise = ('-':) <$> strike' cur rs -- no match; strike char, don't pop

strike :: String -> Maybe String
strike xs = strike' (preprocess xs) template

Brain-Flak, 764 600 bytes
(((<>)))([]((((((([][][]()){}[]){})[][]){}))[[]()])[][]())([[]](([][](([][]){})[]){}())[[]])(([()()][]([[]]([()]([[]](((([()][][][])[]){}[]())[])[]))()()()))[[]])((([[][][]]((([](([()()()][]){})){})(()()()()){}())[[]])[]){})((((()((([][]){}())((()()()){}){})[[][][]]))){}{}())((()(((([]()()()())())){}{}()())[[][]]){}[])(([(()()()){}](((((()()()()){}[]))){}{}))((()()){}()){})(([()][][]([()()()][])))(((([][][]())[([]()()){}()])[]())[[]])([[]]((([]()())(()()()()){}){})()()()){([{}]<>({})){(<{}(((((()()()()())){}{})){}{})>)}{}(<({}<(<()>)<>{({}<>)<>}>{})>)<>{({}<>)<>}{}<>}{}<>{{{}}<>}<>{({}<>)<>}<>

Try it online!
Big improvements thanks to Jo King, especially in the string construction but also a few logical tweaks in the main body. Explanation from him
It's case-sensitive (so "Ah, I see you're Orwell." doesn't match but "Ah, I see you're orwell." does), whitespace in input is not ignored, and unmatched whitespace in original string is converted to -. By my understanding, all of those are valid options.
Explanation:
(476 bytes of much improved stack manipulation) #Push string

{ #While string
  ([{}]<>({})) #Check whether the top characters are equal
  {(<{}(((((()()()()())){}{})){}{})>)}{}  #If characters are not equal, push - on top of input
  (<({}<(<()>)<>{({}<>)<>}>{})>)<>{({}<>)<>}{}<>  #Take top of input (either - or matched char) and add to output
}{}
<>{{{}}<>} #Pop both stacks if input is left over
<>{({}<>)<>}<> #Reverse output

You know, there was a question earlier to help automate producing arbitrary test for Brain-Flak. My own submission can (with a couple of modifications) get the text down to 506 bytes

With a couple of other improvements, I got the total down to 604 bytes

Explanation

A nice and round 600 bytes

@JoKing you're very good at improving my Brain-Flak it seems

Prolog (SWI), 109 bytes
[]+[]+[].
I+[B|X]+[C|O]:-(I=[B|J],B=C;I=J,C=45),J+X+O.
I-O:-I+`Ah, I see you're a man of culture as well.`+O.

Try it online!
Case-sensitive and whitespace sensitive. The -/2 predicate is the main predicate with its first argument being the input string and the second argument being the output string.

JavaScript (Node.js), 103 bytes
s=>!s[i=0,r="Ah, I see you're a man of culture as well.".replace(/./g,c=>c==s[i]&&++i||c-1?c:'-'),i]&&r

Try it online!
Case sensitive.

Pyth, 78 bytesSBCS
V." y°äz ÂµÿéiSs¾ýØC[ócõ!ó5§n"=b.x@zZkIqbN=+kN=hZ.?=+k\-))I<Zlz!z.?k

Test suite
Unprintable characters present in code, see link for correct version.
Case sensitive, does not ignore whitespace.

Perl 5 -F, 192 bytes
@q="Ah, I see you're a man of culture as well."=~/./g;while($x=shift@F){$x=~/\w/||next;while($_=shift@q){push@r,/\W/?$_:/\Q$x/i?$_:'-';$r[-1]=~/\w/i&&last}@q||last}say!$x&&@r,map/\w/?'-':$_,@q

Try it online!


text:
Render a monospaced bitmap font from image
Input is in this format:
image fontwidth fontheight rowwidth xoffset yoffset xgap ygap non-existent charstart thetextitself

thetextitself: The text that should be rendered from the image.
image: The image filename. Implementation may vary; it could be either the filename from your computer, an image URL, or something else, as long as it's possible to use any picture.
fontwidth, fontheight: self explanatory
rowwidth: How many characters a row of characters contains in the image?
xoffset: The starting x coordinate of the character table.
yoffset: The starting y coordinate of the character table.
xgap: The horizontal gap between characters.
ygap: The vertical gap between characters.
non-existent: The character code for the character rendered if the character is (fully or partially) outside the image, hexadecimal of any length.
charstart: The hexadecimal first character any length.
thetextitself: The text to render. The previous parameters are used to find the characters. It's at the end, so that any space included doesn't clash with the next parameter.
So, the appropriate input for this image  would be:
https://i.stack.imgur.com/E8FBP.png 7 11 8 3 5 2 1 00000000 00000 <Test>

which would render as . The exact pixel colors are preserved.
Word wrapping is not needed, but if you use word wrapping, there must be at least 16 characters of horizontal space.
-10 bytes if the code renders tabs (U+0009) correctly (jumps to the next position divisible by 8).
-10 bytes if the code renders Microsoft Windows newlines (U+000D000A) correctly (extends the output image height and jumps to the beginning of the last line).
-10 bytes if the code interprets the combining and zero–width characters as zero–width, but combining characters overlapping their glyph to the next (or the previous; I don't know how Unicode combining characters work) character.
The code must support Unicode characters up to U+FFFF. If the code allows for characters above, -10 bytes.
It's , so the lowest code size wins.

You may want to get rid of the bonuses - effectively, you're asking people to make 2^4 different programs and only post the shortest.

What are the units for fontwidth, xoffset xgap etc? Are there any bounds on their range? If not, how should text be displayed with e.g. fondwith=2 and fontheight=100?

The units are in pixels, and there should be no bounds on their range, aside from limitations like the fact that a byte can only go up to 255.

Embedding is done.

This needs more clarification. 1 Get rid of the bonuses please. See Sanchises' comment above. 2 Which image formats must be supported?

One of the following formats must be supported: bmp, png.


text:
Generate lowest degree polynomial from sequence
Introduction
A sequence of numbers is passed in as the input. The program has to generate the lowest degree polynomial possible. This was my first programming project in college and it would be interesting to see how much smaller the solution could have been.
Challenge
The input is a list of integers separated by a comma. The output is simply the equation that generates that sequence. The exact output of the equation is up to you i.e. no spaces are required between terms of the polynomial but it has to be human readable. The equation has to be expressed with the variable x. The first integer in the supplied sequence will correspond with x = 1, the second integer supplied would be x = 2 etc.
i.e.

x^2

would result in the sequence

1,4,9,16 NOT 0,1,4,9

Example Input and Output
Input:

5,14,27,44

Output:

2x^2 + 3x

Edit
I marked the questions as duplicate, thanks for the head up.

Related,

"it has to be human readable" is very subjective. Can you please elaborate on what you mean?

Related.

@EriktheOutgolfer as a human, I don't mind reading a polynomial in list of coefficients format

@EriktheOutgolfer as long as another program is not required to understand the output, it's fine. For example, 3x^2 - 3x + 6 could be written as (3,2,-3,1,6,0) as long as you mention how the output is formatted in your post.

Duplicates: this and with less restrictive I/O this. I don't think just supplying the vector [1..n] adds much to the existing challenges.

@JorisGuex Sorry, but "as long as another program is not required to understand the output" is still very subjective, since then you can just output the input exactly and do the hard work yourself as a human to understand what the output really is.

@BMO (Linked right above. Whether people would VTC is up to them.)

@EriktheOutgolfer That's a fair point. Let me try to be more specific. The coefficient and exponent of each term in the polynomial has to be output in order from largest to smallest to avoid any ambiguity. For example, 2 + 4x^2 - 6x would have to be output as 4,2,-6,1,2,0 making sure the coefficient comes before the exponent for each term. No calculations should be needed to get the final answer

@user202729: Ah I missed those, but I voted to close and left a comment justifying my decision.

Now it's linked three times.. @ASCII-only: You should probably answer the other one and not this one if you think this is a duplicate..

@BMO that's a close vote auto-comment

@BMO Also the VTC was after the answer. I guess ASCII-only only read your comment after posting the answer.

And have anyone mentioned that? Welcome to PPCG! Next time you can use the sandbox for proposed challenges. (note that because of lack of people visiting the sandbox it takes a while to get feedback)

@user202729: That's not preventing them from answering the other one or at least deleting this one.

Pari/GP, 28 bytes
l->polinterpolate([1..#l],l)

Try it online!

Wolfram Language (Mathematica), 30 bytes
InterpolatingPolynomial[##,x]&

Try it online!

Not to mention that this does not use infix notation. :/

@user202729 does it need to?