
From Beginner to Intermediate Programming
This is a brief post about a subject I’d like to write about more in depth. I saw this “How to draw an Owl” guide on Twitter a long time […]
This is a brief post about a subject I’d like to write about more in depth. I saw this “How to draw an Owl” guide on Twitter a long time […]
On January 19, 2016 I gave a talk at the Iowa Ruby Brigade, a group that meets once a month in central Iowa to talk about the Ruby computer programming […]
This map is still a work in progress. There are two versions of it. Click here to see the first version. The first version has plain JavaScript buttons that you click […]
Click here to go to the link of the Syria/Iraq Slideshow I made. Depending on your internet connection, it might take a long time to load all the maps. I recommend […]
After completing Spanish for English speakers on Duolingo.com, I decided to try Portuguese for Spanish speakers. I wrote this Ruby code to help keep track of my progress:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
# Portugués para hablantes de español # Portugues for Spanish speakers partOneRows = Array.new(5) partOneRows[0] = 3 partOneRows[1] = 5 + 3 partOneRows[2] = 5 partOneRows[3] = 2 + 4 + 5 partOneRows[4] = 3 + 1 PART_1_TOTAL = partOneRows.inject(:+) print 'Part 1: ' puts PART_1_TOTAL puts '' partTwoRows = Array.new(5) partTwoRows[0] = 4 partTwoRows[1] = 1 + 2 partTwoRows[2] = 10 partTwoRows[3] = 1 + 8 partTwoRows[4] = 9 PART_2_TOTAL = partTwoRows.inject(:+) print 'Part 2: ' puts PART_2_TOTAL puts '' partThreeRows = Array.new(7) partThreeRows[0] = 3 + 2 partThreeRows[1] = 8 partThreeRows[2] = 8 + 2 partThreeRows[3] = 10 partThreeRows[4] = 10 + 10 partThreeRows[5] = 9 + 9 partThreeRows[6] = 2 + 7 PART_3_TOTAL = partThreeRows.inject(:+) print 'Part 3: ' puts PART_3_TOTAL puts '' partFourRows = Array.new(21) partFourRows[0] = 2 + 7 partFourRows[1] = 2 + 9 partFourRows[2] = 10 + 10 + 2 partFourRows[3] = 9 partFourRows[4] = 4 + 10 + 2 partFourRows[5] = 7 partFourRows[6] = 2 + 6 + 4 partFourRows[7] = 7 + 6 partFourRows[8] = 5 + 10 partFourRows[9] = 6 partFourRows[10] = 9 + 9 partFourRows[11] = 9 partFourRows[12] = 9 + 9 partFourRows[13] = 6 + 3 + 10 partFourRows[14] = 6 + 6 partFourRows[15] = 8 + 2 partFourRows[16] = 4 partFourRows[17] = 6 + 7 partFourRows[18] = 6 + 7 partFourRows[19] = 8 + 4 partFourRows[20] = 3 + 9 PART_4_TOTAL = partFourRows.inject(:+) print 'Part 4: ' puts PART_4_TOTAL puts '' ALL_LESSONS_TOTAL = PART_1_TOTAL + PART_2_TOTAL + PART_3_TOTAL + PART_4_TOTAL print 'All lessons: ' puts ALL_LESSONS_TOTAL puts '' completed = 31 lessonsLeft = ALL_LESSONS_TOTAL - completed print ' ' print completed puts ' lessons completed' print lessonsLeft puts ' lesson left' |
There […]
I’ve been looking at these different solutions to the FizzBuzz problem. Larry Wall, the creator of the Perl programming language, said “Either a programming language fits your way of thinking or it […]