Author Archives: Patrick Plattes
Back on programming
Two years ago I stopped completely coding as I took over a new role in the same company with much more responsibilities on the management area. While I don’t want to change the job I’m back on programming just for fun – and “for fun” means Ruby on Rails for meΒ β€οΈ
During the next weeks I want to share resources, ideas and bad code π
<h1>Hello Rails, I'm back</h1>
Q10: Which programming language is it?
Ladies and gentlemen let me proudly present the last question (which is the same since two weeks): Which programming language is it?
Today I implemented the Euclid algorithm to find the greatest common divisor. You can check your answer by using the right compiler :).
Please send your answers to: patrick.plattes@googlemail.com
All user with the right answer ’till 14pm will get the points, but the first one will get +25.
PROC greatest_common_divisor = (INT r, m) INT: (
IF r = 0 THEN
m
ELIF m = 0 THEN
r
ELIF r > m THEN
greatest_common_divisor(m, r MOD m)
ELSE
greatest_common_divisor(r, m MOD r)
FI
);
examples:(
INT a = 512, b = 256;
INT c = 42, d = 8471;
INT e = 8832, f = 847212;
printf(($x"The greatest common divisor of"g" and "g" is "gl$,a,b,greatest_common_divisor(a,b)));
printf(($x"The greatest common divisor of"g" and "g" is "gl$,c,d,greatest_common_divisor(c,d)));
printf(($x"The greatest common divisor of"g" and "g" is "gl$,e,f,greatest_common_divisor(e,f)))
)
Points: 50
Q9: Which programming language is it?
The last but one question π To give you the chance to change more on the results you’ll get a 25 point bonus today for the first answer. And ’cause the question is (hopefully) challenging 50 Points, but no hint ^^
Let me thank you again for participation it was a great and fun thing for me and it was so nice to see more people at Reply interested in development. Imho we are a technology company and dev skills are really important π
Please send your answers to: patrick.plattes@googlemail.com
All user with the right answer ’till 14pm will get the points, but the first one will get +25.
"uoy evol I" > v
,
:
^ _ @
Points: 50
Q8: Which programming language is it?
Hmmm.. yesterday I thought that go was very difficult to see, but unfortunately you are much better than I thought. Today I’m really sure it is π
All user with the right ’till 14pm answer will get the points, but the first one will get +5.
PLEASE NOTE THAT UNICORNS ARE IN YOUR ROOM
DO READ OUT #2
DO .10 <- #1
PLEASE COME FROM (23)
DO .11 <- !10$#1'~'#32767$#1'
DO .12 <- #1
PLEASE COME FROM (16)
Hint: GOTO is as descripted “Go To Statement Considered Harmful” from Edsger W. Dijkstra http://www.u.arizona.edu/~rubinson/copyright_violations/Go_To_Considered_Harmful.html a really harmful thing. In this language there is an interesting way to avoid it
Points got this challenge: 40
Q7: Which programming language is it?
Yesterday a lot of people knew the answer to the challenge: it was BASIC. Shame on you! π
Today it will be very hard, but because of the prizes (and to show other people, that you are the best dev the world has seen) you should try it. I would be very happy if at least one person knows it. Probably you are able to manage it, but again, very challenging today π
All user with the right ’till 14pm answer will get the points, but the first one will get +5.
Please send your answers to: patrick.plattes@googlemail.com
func cp(u int) float64 {
c := make(chan float64)
for p := 0; p <= u; p++ {
go term(c, float64(p))
}
fn := float64(0.0)
for p := 0; p <= u; p++ {
fn += <-c
}
return fn
}
func term(c chan float64, h float64) {
c <- 4 * math.Pow(-1, h) / (2*h + 1)
}
func main() {
fmt.Println(cp(240))
}
Hint: There exists a board game with the same name, but this was not the reason to give the language this name.
Points got this challenge: 35
Q6: Which programming language is it?
Good morning to all hackers, geeks, nerds and programming languages fetishists π
At first I want to thank you for the last week. It was great for me and I hope it was fun to you too. I’m currently work on getting a prize for the winner of this little quiz, so I have to push Marco to get a positive feedback π If anyone else want to spend some cool stuff send me a message π
Please send your answers to: patrick.plattes@googlemail.com
All user with the right answer ’till 14pm will get the points, but the first one will get +5.
Type: full program
10 print βhelloβ
20 goto 10
Hint: Bill Gates wrote a famous letter to the developer community, cause they have βstolenβ his program
Points got this challenge: -5
Q5: Which programming language is it?
Thank God It’s Friday!
Have a really relaxed weekend, but at first try this challenge π
Please send your answers to: patrick.plattes@googlemail.com
All user with the right answer ’till 14pm will get the points, but the first one will get +5.
Type: full function/method
sort([Pivot|K]) ->
sort([ B || B <- K, B < Pivot])
++ [Pivot] ++
sort([ B || B <- K, B >= Pivot]);
sort([]) -> [].
Hint: no hint – let’s make it more challenging today π
Points for this challenge: 25
[Update]The dot at the end of the last line is important. Sorry for the typo π³ [/Update]
Q4: Which programming language is it?
βThis must be Thursday,’ said Arthur to himself, sinking low over his beer. ‘I never could get the hang of Thursdays.β
At least we have a nice language for this Thursday π
Please send your answers to: patrick.plattes@googlemail.com
All user with the right ’till 14pm answer will get the points, but the first one will get +5.
Type: snippet
Caramel Sauce.
Ingredients.
1 cup white sugar
1 cup brown sugar
1 vanilla bean
[...]
Method.
[...]
Put vanilla bean into mixing bowl. Refrigerate.
Hint: the design principal of this language is, programs should be correct and delicious
Points for this challange: 15
Q3: Which programming language is it?
This is an easy one today for all the wizards of operating system history – for everyone else, good luck with: Q3
Please send your answers to: patrick.plattes@googlemail.com
All user with the right ’till 14pm answer will get the points, but the first one will get +5.
Type: full program
PARSE ARG M
call Fib M, "Fibonacci"
EXIT
Fib:
PARSE ARG N, subroutinename
say subroutinename||"("||N||")"
i = 3
a = 1
b = a
IF N<1 THEN
say "N("||N||") must be equal or larger than 1"
IF N>=1 THEN
say "Nr[1] "||a
IF N>=2 THEN
say "Nr[2] "||b
DO WHILE N >= i
tmp = a
a = a+b
b = tmp
say "Nr["||i||"] "||a
i = i+1
END
RETURN
Hint: This language was created for mainfames, but later ported to an operating system developed by Microsoft and a company that produced card puncher and punch cards in the early days.
Points for this challenge: 20