RSS

Tag Archives: ruby

ImageCoding Club today.

There’s a chance I may be getting more takers for my ‘Codecademy’ – based coding club at FSCC soon. Several students have shown interest and I look forward to opening up the class towards becoming a more open space with students (including myself) pursuing a number of projects simultaneously. 

If anyone (local, at least) is interested in joining our group, please feel free. We take all comers and look forward to building our numbers with anyone interested in learning, teaching or challenging themselves.

If you’re not local, I’d still be interested in hearing from you if you’d like to start an online learning community tied to codecademy, code school, or any other online resource.

 
Leave a comment

Posted by on August 30, 2013 in Uncategorized

 

Tags: , , , , , , , , , , , ,

New Coding Challenge – The Quincunx!

ImageThe Quincunx – A triangular pegboard that will create a nice normal distribution as balls are dropped from the top and bounce down randomly over the triangular array of pegs.

Society’s greatest achievement, The Price Is Right, demonstrates the use of a plinko board in this video with the most excited player ever.

The coding challenge is to design a quincunx that demonstrates each of the following four points… No animation is required, simply (1)show the board as an array of X’s with a (2) user-determined number of rows (1-20) and the (3)resulting bins filling with integers as a (4)user-determined number of balls (1-100,000) is dropped. This time, I’m awarding prizes to the cleanest, most clearly documented entries in each language represented on Codecademy (Ruby, JS, Python).

As always, the prizes are bragging rights, presentation of your code on my blog with full attribution to you and a promo copy of any of my eBooks on iPad for you to share with the youngster in your life (or keep yourself). Each of my books presents educational material  in the form of a story (Heracles and the Gas Laws, Sisyphus and the Laws of Motion, Zombies and Fractions).

Happy Coding!

(submit your entries as links in the comments below)

 
Leave a comment

Posted by on July 10, 2013 in Uncategorized

 

Tags: , , , , , , , , ,

RubyMonk

ImageI mention codecademy all the time here and rant about how great a way it is to learn a variety of languages and markups online, on your own time and free. I’ve been following both the web programming track and the Ruby tracks aggressively lately (I’m on a 20 day streak presently). However, I have to also mention another free site that does much the same thing. RubyMonk offers free online courses in Ruby (and Python, under PythonMonk). The Monk websites are clean, well structured and provide an element of atmosphere as well.

Unfortunately, RubyMonk does not provide a forum where I can pitch my project challenges – er, I mean Koans. But if you are learning Ruby or Python with the Monk, please feel free to come here from time to time to see if there are any simple programming challenges open.

 
Leave a comment

Posted by on June 28, 2013 in Uncategorized

 

Tags: , , , , , , , , ,

Winding down Coding Challenge I

ImageI’ve received several entries answering my coding challenge to demonstrate / test Goldbach’s Conjecture that all even numbers > 4 are the sum of two primes. So far python has been the language of choice for entries.

 

I will be closing down this challenge as of June 30 at 11:59pm.

Once I take a look at the entries, I’ll award the prize, a copy of my iBook, In Parts to the winner and post the code here with a walkthrough to show how the problem was tackled as well as any interesting comparisons between entrants.

 
Leave a comment

Posted by on June 26, 2013 in Uncategorized

 

Tags: , , , , , , , , , , , , ,

Coding Challenge II: Make Mine a MASTERmind

ImageDon’t worry, Coding Challenge I is still open, but someone was writing about games to develop in the codecademy discussion groups. 

A while ago, when I was first following the JavaScript pathway, there, I decided to write a MasterMind program. Many of the versions I saw prohibited players from using the same number/color more than once, but I felt that was a cop-out. My solution works, but as usual for me, had some tortuous logic.

So, here’s the challenge:

In any language, write a MasterMind game where the computer chooses the numbers and the user deduces them.

1. use numbers (four of them,#s1-4, randomly chosen by the computer), rather than colors

2.  that allows multiple uses of the same numbers, i.e. ‘1122’

3. provides appropriate feedback to the user to help them close in on the correct sequence.

4. keeps track of the number of turns taken

5. (optional) can also be played with 2 users -or- user sets the code and computer guesses

6. (optional) allow user to select # of positions and range of numbers used.

 

simple code trumps tangly code. I prefer languages I can read (C++, javascript, python) but all are welcome.

 
Leave a comment

Posted by on June 22, 2013 in Uncategorized

 

Tags: , , , , , , , ,

Coding Challenge

Recently, there have been a couple new revelations about number theory published in Science Within the article was a pair of theories about prime numbers that I had never heard before, one of which was:

Goldbach’s conjecture, [which] makes two assertions: that every even number greater than 2 is the sum of two primes, and that every odd number greater than 5 is the sum of three primes.

I thought it would be fun to start with the first part of this problem and write a program to accept user input in the form of an even integer > 2  and then look for the two primes whose sum is equal to the user provided:

Goldbach_partitions_of_the_even_integers_from_4_to_28_300pxprime1 + prime2 = user input

where prime1 and prime2 may be any prime number (even the same number twice)

I could easily see this escaping the processing power of my machine if the numbers get high, but I think it shouldn’t be too hard to at least write a code that could look for them and demonstrate whether this worked with known input.

Are you up for a quick challenge?

zombie locker

Learn Fractions with Zombies

If so, submit your documented answer here as a comment. Feel free to use any language you would like (I just did it in C++, but I’m eager to see better answers than my own). My favorite submissions will win a free copy of  my iBook, In Parts, Tales of Fractional Zombies, which you can enjoy yourself or regift to a youngster in your life who wants a fun way to learn the concept of fractions.

You can use these links as resources to help check your work:

prime numbers       prime checker

If you are new to coding and are looking for a coding environment to work in, check out this posting for help setting up a C++ coding environment using Xcode (on your mac)

 
7 Comments

Posted by on June 19, 2013 in Codecademy, Coding

 

Tags: , , , , , , , , , , , , ,

Code School Hall Pass

Code school is currently offering 48 hours of free access to their site. Code School has video classes covering Ruby, JavaScript, iOS and HTML. I just started mine tonight and I’m hoping to get a lot out of it and see if its something I can get more value from. If you’re interested in coding, I highly recommend looking into this site and also Codecademy

 
1 Comment

Posted by on March 18, 2013 in Uncategorized

 

Tags: , , , , ,

Two minutes into my latest coursera lecture….

Two minutes into my latest coursera lecture (introduction to interactive programming in python) the instructor indicated his frustration in javascript programming saying that it’s a terrible language. This may be the case… so far I don’t have a lot to compare against, but I have been enjoying learning JS in codecademy and I’m dying to know why he thinks so.

If you have experience programming in javascript and python (or other languages…ruby?) let me know if you agree with the above statement and what makes you think so. As a new programmer I am interested in learning as much as possible – if I can understand what faults people see in these languages I think that would be very instructive.

Thanks

 
3 Comments

Posted by on October 25, 2012 in Uncategorized

 

Tags: , , , , , , , , ,