Grime MC is a natural language like lyric esolang inspired by Shakespeare. It evolved from a typo of a much less palatable and more obscure music-genre language, which may remain unpublished. Grime MC implements the same example algorithms in a more accessible, less offensive, form.
Grime MC uses lyrics in patois influenced UK / London slang to describe computable algorithms in a (hopefully) Grime-like style.
Apologies to the real Grime MCs who influenced this idea. To protect the innocent they shall remain nameless.
Shout outs / Hold tight / Big ups before beginning a verse are a way to load constants or pre-defined macros.
Global massive is a macro for Hello World. Airhorn
BRAAAP executes a macro. Since Grime is a UK genre, multiple macros are stored in a queue, not a stack.
Other available builtin macros include:
Hold tight Stella!/
Hold tight Red Stripe!** MC attested: check Skream's Stella sessions (Dubstep set / producer dabbling in Grime)
Hold tight the Global massive! BRAAAP!!!!!
Wa' ju say, I spit back a'ju Na gwan stop till wi a'fru
This one's a bit rubbish, but Cat programs are in general... Note the Th-fronting of an Essex accent, and non-specifc halt condition for an infinite loop.
Collatz (Eskibeat) Sequences
Yo! Wasteman! Wa gwan? I bisect your wasteman styles, seen? an' if ya leftovers na dutty I _accept_ dat else you da original wasteman _three_-times, and I gon' have fi _raise_ dat Sorry fam, I have fi _say_ dat An' now m'gwan fi have fi _jump_ back, Repeating lines till I _hit_ one.
# Intro: Declare variable # Prompt for input # Verse: 'bisect': /2 # 'leftovers'/'scraps': remainder, 'na': not, 'dutty': truthy # 'accept dat' set primary variable (wasteman) to result of last operation before test: the quotient # else original var * 3 # 'raise'/'rise' etc: +=1 # 'say'/'tell'/'spit' etc: output current variable # 'jump back'/'repeat' etc: loop current verse # halt condition: when current variable 'hit one': == 1
# Yo! Wasteman! # Wa gwan? wasteman = int(input('Wa gwan, wasteman? ')) while True: # I bisect your wasteman styles, seen? quotient = wasteman // 2 remainder = wasteman % 2 # an' if ya leftovers na dutty if not remainder: # I _accept_ dat wasteman = quotient # else you da original wasteman _three_-times, else: wasteman *= 3 # and I gon have fi _raise_ dat wasteman += 1 # Sorry fam, I have fi _say_ dat print(wasteman) # An' now m'gwan fi have fi _jump_ back, # repeating lines till I _hit_ one if wasteman == 1:break
Yo! Wasteman! Wa gwan? 5 * 5 76 38 19 58 29 88 44 22 11 34 17 52 26 13 40 20 10 5 16 8 4 2 1
Calculates and returns the greatest common divisor of two integers: Likkle MCs, and Big Man. Obviously, Big Man is intended to be the bigger integer, but in fact it does not matter. The lyrics are smart enough to figure out the real gangsta, just as the MC claims. Can't fool Euclid.
Yo! Likkle MCs, Big Man! Wa gwan? How many likkle MCs worth a Big Man like me? Likkle MCs act all gangsta, dem a' act like Big Man, but likkle MCs are just scrap dem m'gwan repeat dis till none a' left standin' Then I'm a tell who da real gangsta is, fam.
# Intro: # Declare multiple variables # Prompt for input for each var # Verse: divide 'Big Man' by 'Likkle MCs' # x 'acts' tmp_var: reverse assignment tmp_var = x # as above, x 'acts' y: y = x # x 'are' 'scrap': standard assignment x = remainder # 'repeat': loop current verse, until 'none left standing': current var == 0 # Final verse: 'tell': output named variable, gangsta
# Yo! likkle_MCs = int(input('Wa gwan, Likkle MCs? ')) big_man = int(input('Wa gwan, Big Man? ')) while True: # How many likkle MCs worth a Big Man like me? quotient = big_man / likkle_MCs remainder = big_man % likkle_MCs # Likkle MCs act all gangsta, gangsta = likkle_MCs # dem a act like Big Man, big_man = likkle_MCs # but likkle MCs are just scrap dem likkle_MCs = remainder # m'gwan repeat dis till none a' left standin' if not remainder: break # Then I'm a tell who da real gangsta is, fam. print(gangsta)
Wa gwan, Likkle MCs? 462 Wa gwan, Big Man? 1071 21
The output should probably display the lyrics as it executes, since it is meant to be a lyrical language. That would make Grime MC Quines trivially easy.
Looking for Grime producers with bangin' productions fi proove Turing Completeness, seen?.