Skip to main content

Questions tagged [syntax]

For challenges related to programming or markup language syntax, including but not limited to checking syntax for validity, converting from one syntax to another or fixing invalid syntax. See also the [balanced-string] tag.

16 votes
6 answers
3k views

Write the shortest program or function that will determine if an input is a valid Go type. Spec This challenge will use the following simplified subset of Go types. For more information, see the ...
bigyihsuan's user avatar
  • 11.5k
9 votes
5 answers
413 views

Given a base type T, this can be augmented with * or [], each meaning pointer and array. For ...
xiver77's user avatar
  • 2,395
53 votes
13 answers
5k views

Background Variable declaration statement in C consists of three parts: the name of the variable, its base type, and the type modifier(s). There are three kinds of type modifiers: Pointer ...
Bubbler's user avatar
  • 79.3k
14 votes
3 answers
562 views

Stack Cats is a reversible, stack-based language. Its reversible nature makes for somewhat weird loops. This challenge is about the conditional loop (...). When ...
Martin Ender's user avatar
10 votes
14 answers
686 views

Unlike most languages, Python evaluates a<b<c as it would be done in mathematics, actually comparing the three numbers, as opposed to comparing the boolean <...
Maltysen's user avatar
  • 25.8k
20 votes
10 answers
4k views

I found it quite hard to achieve a range of numbers as rows in MySQL. For example the range 1-5 is achieved by: ...
Dimgold's user avatar
  • 353
10 votes
2 answers
314 views

Write a program that adds or removes whitespace to format code nicely. Rules for what the code should look like when you're done: No line should contain more than one of ...
tbodt's user avatar
  • 2,504
62 votes
85 answers
11k views

In Haskell the list notation: [a,b,c] Is just syntactic sugar for: a:b:c:[] And the string notation: ...
Wheat Wizard's user avatar
  • 103k
21 votes
6 answers
685 views

Sometimes, I have lists of constant matrices in my code: [ [[1, 0], [0, 1]], [[1, 0], [0,-1]], [[0, 1], [1, 0]], [[0,-1], [1, 0]] ] That's ...
Martin Ender's user avatar
13 votes
2 answers
400 views

This is based off a previous deleted challenge of mine with the same name Introduction You are tasked with writing a program that returns a truthy or falsey value based on if the input has all its ...
Andrew Li's user avatar
  • 1,071
12 votes
1 answer
530 views

Output a full formal poof of such statements such as 1+2=3, 2+2=2*(1+1) etc. Introuction If you know Peano Arithmetic you can ...
spraff's user avatar
  • 891
4 votes
0 answers
216 views

This question wants you to golf batch programms. In Batch you can use set x=averylongbatchcommand %x% arg1 which expands to ...
Linnea Gräf's user avatar
  • 3,079
29 votes
13 answers
2k views

Consider a grammar over the alphabet {0, 1, ?, :} ...
lynn's user avatar
  • 69.7k
10 votes
3 answers
528 views

Your task is to write a RegEx that matches everything inside strings. A string is defined as everything surrounded by (but not including) two unescaped ". A ...
Leaky Nun's user avatar
  • 50.6k
18 votes
8 answers
923 views

Given an input of any valid Glypho program, output its "human-readable" counterpart. Glypho is an interesting esolang idea: The instruction reference is given here. For each instruction, the ...
Doorknob's user avatar
  • 72.1k

15 30 50 per page