Weekend Programming Challenge – Week #38 Center of mass

Image

Problem:

Above picture is 100×100 pixels and have black object on white background. Make code which calculates the center of mass and display it.

The rules:

You can code the solution in any programming language during the weekend and have to submit it to info@olimex.com latest on Sunday December 22th.

On Monday we will upload the solutions on GitHub https://github.com/OLIMEX/WPC

You can play with your real name or with nick if you want to be anonymous, we will not disclosure your personal info if you do not want to.

Weekend Programming Challenge – Week #24 – combinatorics

Image

Problem:

Write code which calculate the number of ways you can express positive natural number N as sum of positive natural numbers.

Example:

for N=1 we have 1 way

for N=3 we have 3 ways

1+1+1
1+2
3

etc.

The rules:

You can code the solution in any programming language during the weekend and have to submit it to info@olimex.com latest on Sunday September 15th.

On Monday we will upload the solutions on GitHub https://github.com/OLIMEX/WPC

You can play with your real name or with nick if you want to be anonymous, we will not disclosure your personal info if you do not want to.

Weekend Programming Challenge – Week #23 – Evil code

Image

Problem:

Invent something small and evil which to be almost invisible and to cause lot of troubles to catch like:

#define struct union

#define double float

#define floor ceil

#define true (__LINE__&42) !=42

#define private public

The rules:

You can code the solution in any programming language during the weekend and have to submit it to info@olimex.com latest on Sunday September 8st.

On Monday we will upload the solutions on GitHub https://github.com/OLIMEX/WPC

You can play with your real name or with nick if you want to be anonymous, we will not disclosure your personal info if you do not want to.

Weekend Programming Challenge – Week #22 Plagiarism detector

Image

Problem:

Make code which compare two texts and output the % of similarities between the two texts i.e. if they have same words even if the words are in different order.

More advanced version may take care for synonyms ,

The rules:

You can code the solution in any programming language during the weekend and have to submit it to info@olimex.com latest on Sunday September 1st.

On Monday we will upload the solutions on GitHub https://github.com/OLIMEX/WPC

You can play with your real name or with nick if you want to be anonymous, we will not disclosure your personal info if you do not want to.

Weekend Programming Challenge – Issue #21 Words Puzzle

Image

Problem:

Aoccdrnig to a rscheearch at Cmabrigde Uinervtisy, it deosn’t mttaer in waht oredr the ltteers in a wrod are, the olny iprmoetnt tihng is taht the frist and lsat ltteer be at the rghit pclae. The rset can be a toatl mses and you can sitll raed it wouthit porbelm. Tihs is bcuseae the huamn mnid deos not raed ervey lteter by istlef, but the wrod as a wlohe.

You can see original text here: http://www.mrc-cbu.cam.ac.uk/people/matt.davis/Cmabrigde/

Write code which takes as input normal text and shuffles the letters inside the words to make text like this one above.

The rules:

You can code the solution in any programming language during the weekend and have to submit it to info@olimex.com latest on Sunday August 25th.

On Monday we will upload the solutions on GitHub and review https://github.com/OLIMEX/WPC .

You can play with your real name or with nick if you want to be anonymous, we will not disclosure your personal info if you do not want to.

Good Luck and Have fun!

Weekend Programming Challenge – Issue #20 Solutions

Image

Image

First I would like to appologize for the late update on this issue, but our vacation began and I had no good internet while outside office.

We got 10 solutions on the Anagram words problem:

1. Javier Donaire - Ruby
2. Laurent HAAS - AWK
3. Marek Vasut - Bash
4. Antal Koos - Python
5. Ping-Panther - AWK
6. Kris Godart - PHP
7. Avishay Orpaz - Python
8. OhmOhm - Python
9. eins78 - JavaScript/Node.js
10. Richard Park - Python

The WPC is running for 20 weeks already and we wanted to celebrate this round number with something – for these who follow our blog they already know that we made ranking of the people who participated https://olimex.wordpress.com/2013/07/23/weekend-programming-challenge-ranking/

Above on the blog you see our specially designed T-shirt for the Weekend Programming Challenge. We will send three T-shirts to the top 3 in the ranking list and reset the counter from Issue #21, so everything starts over from 0.

Note these T-shirts are not for sale, the only way to got one is to submit solutions to WPC challenges 🙂

code as always is at GitHub https://github.com/OLIMEX/WPC/tree/master/ISSUE-20

Weekend Programming Challenge Issue #20 – Anagrams

Image

An anagram is a type of word play, the result of rearranging the letters of a word or phrase to produce a new word or phrase, using all the original letters exactly once; for example orchestra can be rearranged into carthorse.

Problem: Find all anagram words in text file

You can use as word source our well known: http://fiction.eserver.org/novels/alice_in_wonderland.html

The rules:

You can code the solution in any programming language during the weekend and have to submit it to info@olimex.com latest on Sunday August 4th.

On Monday we will upload the solutions on GitHub and review https://github.com/OLIMEX/WPC .

You can play with your real name or with nick if you want to be anonymous, we will not disclosure your personal info if you do not want to.

Good Luck and Have fun!

Weekend Programming Challenge Issue #19 – Pattern match

Image

Problem:

Make function match() which takes as input input_string and pattern_string, the input strings may contain any ASCII codes

there are two special codes for use in the pattern-string: ?-replaces 1 character and * – replaces any character(s)

The function should print all words from the input-string which match the pattern-string

words can be separated by any of these characters: ‘ ” . , : ;

if the input-string have this content “The big black cat jump over the window”

if pattern-string is “b*” should print
big
black

if pattern-string is “*c*” should print
black
cat

if pattern-string is “?i*” should print
big
window

The rules:

You can code the solution in any programming language during the weekend and have to submit it to info@olimex.com latest on Sunday July 28th.

On Monday we will upload the solutions on GitHub and review https://github.com/OLIMEX/WPC .

You can play with your real name or with nick if you want to be anonymous, we will not disclosure your personal info if you do not want to.

Good Luck and Have fun!

Weekend Programming Challenge Issue-18 Solutions

Image

We have two heroes for WPC Issue-18. Seems the short time maked it difficult for many to participate and we got just two submissions:

Antal Koos and Teodor Nikodimov – you can see their solutions at https://github.com/OLIMEX/WPC/tree/master/ISSUE-18

Weekend Programming Challenge Issue-18 – Console Text Editor

Image

Problem: create simple text editor for VT100 terminal

Many of us remember Borland’s Turbo Pascal V3.0 which in 39K had compiler, linker, run-time library and minimal WordStar type text editor.

BAS-INT is freeware tiny Basic interpreter with the bare minimum for BASIC scripting language. It works with external files only and is with Basic Stamp like syntax.

The Challenge today is to write minimal console editor which to complement BAS-INT and to perform some very basic commands:

List – list the program in memory with numbers
Delete N(-M) – deletes line N or N to M from memory
Insert N – inserts line on number N
Run – runs the BASIC program in memory (this code is already available)

if one wants to make it even more advanced he may make also the
Edit N – prints the content of line N and allow it to be edited

Remember this is console application and you have just serial in and serial out, no fancy graphics and windows in this editor.

The BAS-INT template is uploaded on GitHub https://github.com/OLIMEX/WPC/tree/master/ISSUE-18/BAS-INT

The rules:

You can code the solution in any programming language (well obviously as you have to integrate BAS-INT which is written in C this any language for this problem must be C) during the weekend and have to submit it to info@olimex.com latest on Sunday July 21th.

On Monday we will upload the solutions on GitHub and review https://github.com/OLIMEX/WPC .

You can play with your real name or with nick if you want to be anonymous, we will not disclosure your personal info if you do not want to.

Good Luck and Have fun!

Previous Older Entries