Mad Libs Generator Coding Challenge 

Simon has completed Daniel Shiffman’s Mad Libs Generator Coding Challenge – a fun word game where one fills in a google form and the words filled in are then used by the algorithm to create sentences. The sentences generated are really funny.

 

 

 

 

 

To make the game work Simon wrote three codes (in JavaScript, text and HTML):

Wolfram in RaspberryPi 

Simon tried out a new language Wolfram on his RaspberryPi. Wolfram is a programming language that can be used to program 3D print sketches. “With different functions and constants you can do it exactly the way you want”, Simon says. In the video below he used Wolfram in a simple terminal.

Simon later also used Wolfram in Mathematica, a text editor pre-installed on RaspberryPi.

wp-image-1173566453jpg.jpeg

Wolfram can be used to program objects for 3D printing.

Atom.io

Simon has found a new text editor he really likes: Atom.io

He says he likes it because of its special searcher function, which can use regex (regular expressions). A regular expression is a sequence of characters which can find something. In JavaScript they are strings that are not between quotes but between forward slashes. Simon learned about regular expressions in Daniel Shiffman’s tutorial.

In the following example Simon is looking for one or more concatenated lower case or upper case letters (the pipe stands for the logic OR and combining this logic OR with parentheses means alternation). “In this case, I’ve combined alternation with character classes”, Simon adds:

And in this example Simon is looking for lower case letters only:

And this is the result he gets within the sentence he had typed:

wp-image-1167396000jpg.jpeg

This is a program that defines math functions. The list comes from the JS Math tutorial on the w3schools website:

Here Simon got stuck following a Flexbox (CSS) tutorial with LearnWebCode:

He also started working on Daniel Shiffman’s Maze Generator Coding Challenge:

Word Interactor and Word Counter

The JavaScript Word Interactor changes word details (colour, background colour, text). The Word Counter counts how often a word appears in a text. Simon learned about Word Interactor and Word Counter from Daniel Shiffman’s Coding Challenges 38 and 40.1-40.3

Simon gave a whiteboard presentation about both interactor and counter during our Christmas visit to his grandparents. He added that it is especially cool when the word counter is used together with the Sentiment Analysis web app. This way AI can make a more accurate judgement about the sentiment a text conveys.

Word Interactor:

 

Word Counter:

Trying MAMP and WordPress

It’s been really difficult to install WordPress and try to work with it in local host. Only on day three (several hours trying to get everything to work) we managed to start the servers in MAMP and got connected through the 8888 port. Sadly, all the PHP code written by Simon still doesn’t get interpreted in the right way, so we’re not where we want to be yet. But we’ll get there.