Taekwondo Quiz

In the past we at Aalborg Soobak had a Taekwondo Quiz. The game is about translating words form korean to danish in rounds. In each round a word to translate was provided along with a list of possible translation. The player then had to select the correct translation. During the game, the player was awarded points – the game was over at the first wrong answer. To make it a bit more difficult, the answers had to be given within a given time frame.

The quiz, however, has not been available on our web-page for a long time. We have renewed our web-page and the quiz got lost in the modifications. The game has however been requested quite often by other clubs ( but strangely enough by our own membes ) and everytime we responded: “We are aware of it. It will come back eventually. ” – but we never implemented.

One day I received an e-mail asking if the quiz would re-emerge as they were missing it. As mentioned, we already intended to reimplement the quiz and it had just been pushed back in the pile of tasks for ages. Anyway, I had the day off and in classic programmer style thought: “I can do this in two hours – I will be done before lunch” (I started in the morning around ten). I was not finished before lunch – in fact I did not finish before 23.00 in the evening with a reimplementation using the old HTML-code.

I could have been done earlier, had I not spend time focusing creating a decent architecture for the PHP back-end. Something that paid as I two days later – with minimal effort – could change the front-end completely to use bootstrap and be a responsive web-page (comes for free with bootstrap).

I have some improvement planned for the taekwondo quiz, but they will have to wait. The quiz is available here ( only in danish though)

Smart commandline prompt

So in my work I’m developing a tool – Lodin. The program is a simple commandline tool taking an input and query file as parameters – with the small twist that if the query is not given, then the tool enters a prompt asking for the query. The naive way of reading the query in C++ is obviously to do

std::string s; 
std::getline(std::cin,s);

After which the line inputted by the user is contained in the string s. There is however a catch. The user cannot do any editing during inputting: If he makes a typo he has to delete the line to correct the typo (something that bothered me a lot everytime I had to show of the tool). The other day, I finally decided it was about time to fix this and make a proper query prompt.

Continue reading “Smart commandline prompt”