Hey
If you ask how they managed to draw the thing in the text editor :
You need an expression parser , its like parsing math expression in any general purpose language compiler. I suggest you read about lexers and parsers. And ones you have the Expression tree or so called (AST) you give values to these variables like (game_time and random) and you generate points on the "Y" axis . And you connect those points . And for the spline there is basically a few types of splines so everything is in normal code with variables there is no parsing and of course the rendering is the same you generate a lot of points to make it look like a curve and not "boxy" looking.
But if you ask how they took this text and draw a graph from it ... yea you have to parse it to expression tree.
Search for parser generators.
dgi