Mitch Resnick: Let’s teach kids to code

 

It was a Saturday afternoon in May, and I suddenly realized that the next day was Mother’s Day, and I hadn’t gotten anything for my mom, so I started thinking about what should I get my mom for Mother’s Day? I thought, why don’t I make her an interactive Mother’s Day card using the Scratch software that I’d been developing with my research group at the MIT Media Lab? We developed it so that people could easily create their own interactive stories and games and animations, and then share their creations with one another. So I thought, this would be an opportunity to use Scratch to make an interactive card for my mom.

0:55 Before making my own Mother’s Day card, I thought I would take a look at the Scratch website. So over the last several years, kids around the world ages 8 and up, have shared their projects, and I thought, I wonder if, of those three million projects, whether anyone else has thought to put up Mother’s Day cards. So in the search box I typed in “Mother’s Day,” and I was surprised and delighted to see a list of dozens and dozens of Mother’s Day cards that showed up on the Scratch website, many of them just in the past 24 hours by procrastinators just like myself. So I started taking a look at them. (Music) I saw one of them that featured a kitten and her mom and wishing her mom a happy Mother’s Day. And the creator very considerately offered a replay for her mom. Another one was an interactive project where, when you moved the mouse over the letters of “Happy Mom Day,” it reveals a special happy Mother’s Day slogan. (Music) In this one, the creator told a narrative about how she had Googled to find out when Mother’s Day was happening. (Typing) And then once she found out when Mother’s Day was happening, she delivered a special Mother’s Day greeting of how much she loved her mom.

2:22 So I really enjoyed looking at these projects and interacting with these projects. In fact, I liked it so much that, instead of making my own project, I sent my mom links to about a dozen of these projects. (Laughter) And actually, she reacted exactly the way that I hoped that she would. She wrote back to me and she said, “I’m so proud to have a son that created the software that allowed these kids to make Mother’s Day cards for their mothers.”

2:47 So my mom was happy, and that made me happy, but actually I was even happier for another reason. I was happy because these kids were using Scratch just in the way that we had hoped that they would. As they created their interactive Mother’s Day cards, you could see that they were really becoming fluent with new technologies. What do I mean by fluent? I mean that they were able to start expressing themselves and to start expressing their ideas. When you become fluent with language, it means you can write an entry in your journal or tell a joke to someone or write a letter to a friend. And it’s similar with new technologies. By writing, be creating these interactive Mother’s Day cards, these kids were showing that they were really fluent with new technologies.

3:40 Now maybe you won’t be so surprised by this, because a lot of times people feel that young people today can do all sorts of things with technology. I mean, all of us have heard young people referred to as “digital natives.” But actually I’m sort of skeptical about this term. I’m not so sure we should be thinking of young people as digital natives. When you really look at it, how is it that young people spend most of their time using new technologies? You often see them in situations like this, or like this, and there’s no doubt that young people are very comfortable and familiar browsing and chatting and texting and gaming. But that doesn’t really make you fluent.

4:25 So young people today have lots of experience and lots of familiarity with interacting with new technologies, but a lot less so of creating with new technologies and expressing themselves with new technologies. It’s almost as if they can read but not write with new technologies.

4:45 And I’m really interested in seeing, how can we help young people become fluent so they can write with new technologies? And that really means that they need to be able to write their own computer programs, or code.

4:59 So, increasingly, people are starting to recognize the importance of learning to code. You know, in recent years, there have been hundreds of new organizations and websites that are helping young people learn to code. You look online, you’ll see places like Codecademy and events like CoderDojo and sites like Girls Who Code, or Black Girls Code. It seems that everybody is getting into the act. You know, just at the beginning of this year, at the turn of the new year, New York City Mayor Michael Bloomberg made a New Year’s resolution that he was going to learn to code in 2012. A few months later, the country of Estonia decided that all of its first graders should learn to code. And that triggered a debate in the U.K. about whether all the children there should learn to code.

5:53 Now, for some of you, when you hear about this, it might seem sort of strange about everybody learning to code. When many people think of coding, they think of it as something that only a very narrow sub-community of people are going to be doing, and they think of coding looking like this. And in fact, if this is what coding is like, it will only be a narrow sub-community of people with special mathematical skills and technological background that can code.

6:22 But coding doesn’t have to be like this. Let me show you about what it’s like to code in Scratch. So in Scratch, to code, you just snap blocks together. In this case, you take a move block, snap it into a stack, and the stacks of blocks control the behaviors of the different characters in your game or your story, in this case controlling the big fish. After you’ve created your program, you can click on “share,” and then share your project with other people, so that they can use the project and start working on the project as well.

6:56 So, of course, making a fish game isn’t the only thing you can do with Scratch. Of the millions of projects on the Scratch website, there’s everything from animated stories to school science projects to anime soap operas to virtual construction kits to recreations of classic video games to political opinion polls to trigonometry tutorials to interactive artwork, and, yes, interactive Mother’s Day cards.

7:26 So I think there’s so many different ways that people can express themselves using this, to be able to take their ideas and share their ideas with the world. And it doesn’t just stay on the screen. You can also code to interact with the physical world around you. Here’s an example from Hong Kong, where some kids made a game and then built their own physical interface device and had a light sensor, so the light sensor detects the hole in the board, so as they move the physical saw, the light sensor detects the hole and controls the virtual saw on the screen and saws down the tree.

8:04 We’re going to continue to look at new ways of bringing together the physical world and the virtual world and connecting to the world around us. This is an example from a new version of Scratch that we’ll be releasing in the next few months, and we’re looking again to be able to push you in new directions. Here’s an example. It uses the webcam. And as I move my hand, I can pop the balloons or I can move the bug. So it’s a little bit like Microsoft Kinect, where you interact with gestures in the world. But instead of just playing someone else’s game, you get to create the games, and if you see someone else’s game, you can just say “see inside,” and you can look at the stacks of blocks that control it. So there’s a new block that says how much video motion there is, and then, if there’s so much video motion, it will then tell the balloon to pop.

9:03 The same way that this uses the camera to get information into Scratch, you can also use the microphone. Here’s an example of a project using the microphone. So I’m going to let all of you control this game using your voices.

9:19 (Crickets chirping) (Shouts) (Chomping) (Laughter) (Applause)

9:53 As kids are creating projects like this, they’re learning to code, but even more importantly, they’re coding to learn. Because as they learn to code, it enables them to learn many other things, opens up many new opportunities for learning. Again, it’s useful to make an analogy to reading and writing. When you learn to read and write, it opens up opportunities for you to learn so many other things. When you learn to read, you can then read to learn. And it’s the same thing with coding. If you learn to code, you can code to learn. Now some of the things you can learn are sort of obvious. You learn more about how computers work. But that’s just where it starts. When you learn to code, it opens up for you to learn many other things.

10:42 Let me show you an example. Here’s another project, and I saw this when I was visiting one of the computer clubhouses. These are after-school learning centers that we helped start that help young people from low-income communities learn to express themselves creatively with new technologies. And when I went to one of the clubhouses a couple years ago, I saw a 13-year-old boy who was using our Scratch software to create a game somewhat like this one, and he was very happy with his game and proud of his game, but also he wanted to do more. He wanted to keep score. So this was a game where the big fish eats the little fish, but he wanted to keep score, so that each time the big fish eats the little fish, the score would go up and it would keep track, and he didn’t know how to do that. So I showed him. In Scratch, you can create something called a variable. I’ll call it score. And that creates some new blocks for you, and also creates a little scoreboard that keeps track of the score, so each time I click on “change score,” it increments the score. So I showed this to the clubhouse member — let’s call him Victor — and Victor, when he saw that this block would let him increment the score, he knew exactly what to do. He took the block and he put it into the program exactly where the big fish eats the little fish. So then, each time the big fish eats the little fish, he will increment the score, and the score will go up by one. And it’s in fact working. And he saw this, and he was so excited, he reached his hand out to me, and he said, “Thank you, thank you, thank you.” And what went through my mind was, how often is it that teachers are thanked by their students for teaching them variables? (Laughter) It doesn’t happen in most classrooms, but that’s because in most classrooms, when kids learn about variables, they don’t know why they’re learning it. It’s nothing that, really, they can make use of. When you learn ideas like this in Scratch, you can learn it in a way that’s really meaningful and motivating for you, that you can understand the reason for learning variables, and we see that kids learn it more deeply and learn it better. Victor had, I’m sure, been taught about variables in schools, but he really didn’t — he wasn’t paying attention. Now he had a reason for learning variables. So when you learn through coding, and coding to learn, you’re learning it in a meaningful context, and that’s the best way of learning things.

13:21 So as kids like Victor are creating projects like this, they’re learning important concepts like variables, but that’s just the start. As Victor worked on this project and created the scripts, he was also learning about the process of design, how to start with the glimmer of an idea and turn it into a fully-fledged, functioning project like you see here. So he was learning many different core principles of design, about how to experiment with new ideas, how to take complex ideas and break them down into simpler parts, how to collaborate with other people on your projects, about how to find and fix bugs when things go wrong, how to keep persistent and to persevere in the face of frustrations when things aren’t working well. Now those are important skills that aren’t just relevant for coding. They’re relevant for all sorts of different activities.

14:17 Now, who knows if Victor is going to grow up and become a programmer or a professional computer scientist? It’s probably not so likely, but regardless of what he does, he’ll be able to make use of these design skills that he learned. Regardless of whether he grows up to be a marketing manager or a mechanic or a community organizer, that these ideas are useful for everybody. Again, it’s useful to think about this analogy with language. When you become fluent with reading and writing, it’s not something that you’re doing just to become a professional writer. Very few people become professional writers. But it’s useful for everybody to learn how to read and write. Again, the same thing with coding. Most people won’t grow up to become professional computer scientists or programmers, but those skills of thinking creatively, reasoning systematically, working collaboratively — skills you develop when you code in Scratch — are things that people can use no matter what they’re doing in their work lives.

15:18 And it’s not just about your work life. Coding can also enable you to express your ideas and feelings in your personal life. Let me end with just one more example. So this is an example that came from after I had sent the Mother’s Day cards to my mom, she decided that she wanted to learn Scratch. So she made this project for my birthday and sent me a happy birthday Scratch card. Now this project is not going to win any prizes for design, and you can rest assured that my 83-year-old mom is not training to become a professional programmer or computer scientist. But working on this project enabled her to make a connection to someone that she cares about and enabled her to keep on learning new things and continuing to practice her creativity and developing new ways of expressing herself.

16:11 So as we take a look and we see that Michael Bloomberg is learning to code, all of the children of Estonia learn to code, even my mom has learned to code, don’t you think it’s about time that you might be thinking about learning to code? If you’re interested in giving it a try, I’d encourage you to go to the Scratch website. It’s scratch.mit.edu, and give a try at coding.

16:35 Thanks very much. (Applause)

Advertisements

Learn to Code : VBA for Powerpoint di Jawa Tengah + Tutorial membuat quiz pilihan ganda

Sebelum saya paparkan (dalam video) tentang bagaimana membuat quiz pilihan ganda (variasi lain), saya ingin bercerita sedikit tentang penggunaan visual basic for application di kalangan guru – guru di  jawa tengah (khususnya dalam lomba multimedia pembelajaran).

36525_10200287541057456_263781926_nJuri – juri lomba multimedia pembelajaran interaktif LPMP Jawa Tengah tahun 2012

Tahun 2006 LPMP Jawa Tengah menyelenggarakan lomba pembuatan bahan ajar berbasis komputer untuk pertama kalinya, saat itu yang menjadi juara adalah karya multimedia pembelajaran interaktif (MPI) dari guru yang menggunakan perangkat lunak macromedia flash. Di kalangan guru pembuat MPI  pada saat itu (mungkin sampai sekarang) perangkat lunak macromedia/adobe flash  adalah yang paling populer dan yang paling diminati untuk dipelajari. Namun berdasarkan pemgamatan saya dari banyak pelatihan yang diselenggarakan di jawa tengah  hanya sedikit guru yang bisa benar-benar menguasai perangkat lunak tersebut, apalagi jika dengan “actionscript” nya. Dalam lomba bahkan pemenang pun (yang jelas-jelas menggunakan actionscript) jika diminta untuk mendemonstrasikan bagaimana membuat simulasi dengan actionscript hampir sebagian besar gagal, dan seringkali berdalih bahwa mereka membuatnya mengikuti tutorial dari buku.  Singkatnya, bagi sebagian besar guru di jawa tengah macromedia/adobe flash adalah perangkat lunak yang sangat mempesona tapi sulit untuk dikuasai dan dipelajari.

Berdasarkan pengalaman (kegagalan) di lomba pertama untuk menjadi pemenang, di mana saat itu saya menggunakan perangkat lunak macromedia/adobe director. Saya memutuskan untuk menggunakan powerpoint di lomba yang sama pada tahun 2007, di event lomba MPI seperti ini, siapa yang memperhitungkan powerpoint untuk menjadi juara? –  powerpoint untuk   melawan karya-karya MPI yang menggunakan flash ibaratnya kisah nabi Daud melawan Jalut (atau David vs Goliath). Pada tahap final, dipilihlah 10 karya dari sekitar 200 an karya yang mengikuti lomba.  Dan 9 dari karya yang lolos ke final semuanya dibuat dengan perangkat lunak flash, satunya-satunya powerpoint yang lolos adalah karya saya. Alhamdulillah, pada saat pengumuman para juara, karya saya menempati rangking 1. Sejak saat itu muncullah joke “lebih baik menggunakan powerpoint bercita rasa flash, daripada menggunakan flash tapi mirip powerpoint”. Pada lomba ini, pada bagian evaluasi/test saya sudah menggunakan visual basic for application (vba) for powerpoint sehingga setelah menyelesaikan test siswa/pengguna dapat melihat hasilnya.

Setelah 6 tahun berlalu, kini setiap tahun di lomba – lomba pembuatan multimedia pembelajaran interaktif di jawa tengah yang diselenggarakan oleh LPMP atau BPTIKP, karya MPI  yang menggunakan powerpoint dengan vba nya sudah tidak asing lagi. Meskipun saya tidak pernah bisa untuk ikut lomba lagi di Jawa Tengah, karena selalu ditunjuk menjadi juri 🙂 baik di LPMP ataupun BPTIKP Jawa Tengah. Era saya sebagai guru peserta lomba di Jawa Tengah memang harus berakhir, sebagai gantinya dengan “track record” sebagai juara lomba MPI tahun 2007, saya mengisi workshop-worskhop di LPMP, BPTIKP dan di sekolah-sekolah.

P1010286

Berikut ini adalah cuplikan materi yang saya sampaikan di Workshop “VBA for Powerpoint ” pada tanggal 2, 16, 23 Februari 2013 di SMAN 3 Pekalongan.

Membuat Quiz Pilihan Ganda dalam Satu Slide

download : video tutorial quiz pilihan ganda

Script VBA untuk membuat quiz pilihan ganda dalam satu slide.

‘===================

‘Pilih Jawaban no. 1

‘===================

Sub pilihA1()
ActivePresentation.Slides(1).Shapes(“jawab1”).TextFrame.TextRange.Text = “A”
End Sub
Sub pilihB1()
ActivePresentation.Slides(1).Shapes(“jawab1”).TextFrame.TextRange.Text = “B”
End Sub
Sub pilihC1()
ActivePresentation.Slides(1).Shapes(“jawab1”).TextFrame.TextRange.Text = “C”
End Sub
Sub pilihD1()
ActivePresentation.Slides(1).Shapes(“jawab1”).TextFrame.TextRange.Text = “D”
End Sub
Sub pilihE1()
ActivePresentation.Slides(1).Shapes(“jawab1”).TextFrame.TextRange.Text = “E”
End Sub

‘===================

‘Pilih Jawaban no. 2

‘===================

Sub pilihA2()
ActivePresentation.Slides(1).Shapes(“jawab2”).TextFrame.TextRange.Text = “A”
End Sub
Sub pilihB2()
ActivePresentation.Slides(1).Shapes(“jawab2”).TextFrame.TextRange.Text = “B”
End Sub
Sub pilihC2()
ActivePresentation.Slides(1).Shapes(“jawab2”).TextFrame.TextRange.Text = “C”
End Sub
Sub pilihD2()
ActivePresentation.Slides(1).Shapes(“jawab2”).TextFrame.TextRange.Text = “D”
End Sub
Sub pilihE2()
ActivePresentation.Slides(1).Shapes(“jawab2”).TextFrame.TextRange.Text = “E”
End Sub

‘===================

‘Pilih Jawaban no. 3

‘===================

Sub pilihA3()
ActivePresentation.Slides(1).Shapes(“jawab3”).TextFrame.TextRange.Text = “A”
End Sub
Sub pilihB3()
ActivePresentation.Slides(1).Shapes(“jawab3”).TextFrame.TextRange.Text = “B”
End Sub
Sub pilihC3()
ActivePresentation.Slides(1).Shapes(“jawab3”).TextFrame.TextRange.Text = “C”
End Sub
Sub pilihD3()
ActivePresentation.Slides(1).Shapes(“jawab3”).TextFrame.TextRange.Text = “D”
End Sub
Sub pilihE3()
ActivePresentation.Slides(1).Shapes(“jawab3”).TextFrame.TextRange.Text = “E”
End Sub

‘===================

‘Pilih Jawaban no. 4

‘===================

Sub pilihA4()
ActivePresentation.Slides(1).Shapes(“jawab4”).TextFrame.TextRange.Text = “A”
End Sub
Sub pilihB4()
ActivePresentation.Slides(1).Shapes(“jawab4”).TextFrame.TextRange.Text = “B”
End Sub
Sub pilihC4()
ActivePresentation.Slides(1).Shapes(“jawab4”).TextFrame.TextRange.Text = “C”
End Sub
Sub pilihD4()
ActivePresentation.Slides(1).Shapes(“jawab4”).TextFrame.TextRange.Text = “D”
End Sub
Sub pilihE4()
ActivePresentation.Slides(1).Shapes(“jawab4”).TextFrame.TextRange.Text = “E”
End Sub

‘===================

‘Procedure periksa jawaban

‘===================

Sub periksa()
Dim jawaban, kunciJawab, rBenar, rSalah As Variant
Dim i As Integer
Dim nilai As Integer
Dim j1, j2, j3, j4 As String
j1 = ActivePresentation.Slides(1).Shapes(“jawab1”).TextFrame.TextRange.Text
j2 = ActivePresentation.Slides(1).Shapes(“jawab2”).TextFrame.TextRange.Text
j3 = ActivePresentation.Slides(1).Shapes(“jawab3”).TextFrame.TextRange.Text
j4 = ActivePresentation.Slides(1).Shapes(“jawab4”).TextFrame.TextRange.Text
jawaban = Array(j1, j2, j3, j4)
kunciJawab = Array(“A”, “A”, “A”, “A”)
rBenar = Array(“responBenar_1”, “responBenar_2”, “responBenar_3”, “responBenar_4”)
rSalah = Array(“responSalah_1”, “responSalah_2”, “responSalah_3”, “responSalah_4”)
For i = 0 To 3
If jawaban(i) = kunciJawab(i) Then
nilai = nilai + 25
ActivePresentation.Slides(1).Shapes(rBenar(i)).Visible = True
ActivePresentation.Slides(1).Shapes(rSalah(i)).Visible = False
Else
nilai = nilai + 0
ActivePresentation.Slides(1).Shapes(rBenar(i)).Visible = False
ActivePresentation.Slides(1).Shapes(rSalah(i)).Visible = True
End If
Next
ActivePresentation.Slides(1).Shapes(“nilaiAnda”).TextFrame.TextRange.Text = nilai
ActivePresentation.Slides(1).Shapes(“periksa_btn”).Visible = False
ActivePresentation.Slides(1).Shapes(“reset_btn”).Visible = True
End Sub

‘===================

‘Procedure Reset

‘===================

Sub reset()
Dim jawab, rBenar, rSalah As Variant
Dim i As Integer
jawab = Array(“jawab1”, “jawab2”, “jawab3”, “jawab4”)
rBenar = Array(“responBenar_1”, “responBenar_2”, “responBenar_3”, “responBenar_4”)
rSalah = Array(“responSalah_1”, “responSalah_2”, “responSalah_3”, “responSalah_4”)
For i = 0 To 3
ActivePresentation.Slides(1).Shapes(jawab(i)).TextFrame.TextRange.Text = “”
ActivePresentation.Slides(1).Shapes(rBenar(i)).Visible = False
ActivePresentation.Slides(1).Shapes(rSalah(i)).Visible = False
Next
ActivePresentation.Slides(1).Shapes(“nilaiAnda”).TextFrame.TextRange.Text = “0”
ActivePresentation.Slides(1).Shapes(“periksa_btn”).Visible = True
ActivePresentation.Slides(1).Shapes(“reset_btn”).Visible = False
End Sub

download : file latihan membuat quiz pilihan ganda dalam satu slide

Learn to Code : Hitung Penjumlahan Interaktif dengan Powerpoint

Bagaimanakah caranya membuat hitung penjumlahan interaktif dengan  powerpoint? Simak dan ikuti tutorial pada video ini.

download : video tutorial penjumlahan

‘Script VBA  untuk tombol soal baru

Sub Soalbaru()
ActivePresentation.Slides(1).Shapes(“bilangan1”).TextFrame.TextRange.Text = Int((999999 – 111111) * Rnd + 111111)
ActivePresentation.Slides(1).Shapes(“bilangan2”).TextFrame.TextRange.Text = Int((999999 – 111111) * Rnd + 111111)
Slide1.TextBox1.Text = “”
End Sub

‘Script VBA  untuk tombol periksa

Sub periksa_penjumlahan()
If Slide1.TextBox1.Text = _
Val(ActivePresentation.Slides(1).Shapes(“bilangan1”).TextFrame.TextRange.Text) + Val(ActivePresentation.Slides(1).Shapes(“bilangan2”).TextFrame.TextRange.Text) Then
MsgBox (“Jawaban kamu benar”)
Else
MsgBox (“Jawaban kamu salah”)
End If
End Sub

download : file latihan membuat hitung penjumlahan

Learn to Code : Hitung Perkalian dengan Powerpoint

Bagaimanakah caranya membuat hitung perkalian dengan  powerpoint? Simak dan ikuti tutorial pada video ini.

download : video tutorial hitung perkalian

Script VBA ‘Hitung Perkalian”

‘script untuk tombol soal baru

Sub Soalbaru()
ActivePresentation.Slides(1).Shapes(“bilangan1”).TextFrame.TextRange.Text = Int((999999 – 111111) * Rnd + 111111)
ActivePresentation.Slides(1).Shapes(“bilangan2”).TextFrame.TextRange.Text = Int((999999 – 111111) * Rnd + 111111)
ActivePresentation.Slides(1).Shapes(“hasilkali”).TextFrame.TextRange.Text = “”
End Sub

‘script untuk tombol hitung

Sub hitung_perkalian()
ActivePresentation.Slides(1).Shapes(“hasilkali”).TextFrame.TextRange.Text = _
Val(ActivePresentation.Slides(1).Shapes(“bilangan1”).TextFrame.TextRange.Text) * Val(ActivePresentation.Slides(1).Shapes(“bilangan2”).TextFrame.TextRange.Text)
End Sub

download : file latihan untuk membuat hitung perkalian

Learn to Code : Membuat Simulasi Mengenal Bilangan (VBA for Powerpoint)

Bagaimana caranya membuat simulasi mengenal bilangan  pada powerpoint? Simak dan ikuti tutorial pada video ini.

download : tutorial membuat simulasi mengenal bilangan

‘Script pada module 1

Sub hideMobil()
For i = 1 To 10
ActivePresentation.Slides(1).Shapes(i).Visible = msoFalse
Next
End Sub

‘Script pada Slide 1

Private Sub SpinButton1_Change()
hideMobil
For i = 1 To Val(SpinButton1)
ActivePresentation.Slides(1).Shapes(i).Visible = msoTrue
Next
ActivePresentation.Slides(1).Shapes(“angka”).TextFrame.TextRange.Text = Val(SpinButton1)
End Sub

download : file contoh membuat simulasi mengenal bilangan

 

Learn to Code : Membuat Simulasi Penyelesaian Sistem Persamaan Linear Dua Variabel (Powerpoint)

Bagaimana caranya membuat simulasi penyelesaian sistem persamaan linear dua variabel pada powerpoint? Simak dan ikuti tutorial pada video ini.

download : video tutorial membuat simulasi SPLDV

Script VBA untuk Simulasi Penyelesaian Sistem Persamaan Linear Dua Variabel
‘script  untuk tombol hapus
Sub hapus()
Slide1.TextBox1.Text = “-”
Slide1.TextBox2.Text = “-”
Slide1.TextBox3.Text = “-”
Slide1.TextBox4.Text = “-”
Slide1.TextBox5.Text = “-”
Slide1.TextBox6.Text = “-”
ActivePresentation.Slides(1).Shapes(“nilaiX”).TextFrame.TextRange.Text = “…”
ActivePresentation.Slides(1).Shapes(“nilaiY”).TextFrame.TextRange.Text = “…”
End Sub

‘script untuk tombol hitung

Sub hitungX_Y()
Dim a, b, p, c, d, q As Integer
a = Val(Slide1.TextBox1.Text)
b = Val(Slide1.TextBox2.Text)
p = Val(Slide1.TextBox3.Text)
c = Val(Slide1.TextBox4.Text)
d = Val(Slide1.TextBox5.Text)
q = Val(Slide1.TextBox6.Text)

If a * d – b * c <> 0 Then
ActivePresentation.Slides(1).Shapes(“nilaiX”).TextFrame.TextRange.Text = (d * p – b * q) / (a * d – b * c)
ActivePresentation.Slides(1).Shapes(“nilaiY”).TextFrame.TextRange.Text = (a * q – c * p) / (a * d – b * c)
Else
MsgBox (“Solusi SPLDV tidak tunggal”)
End If
End Sub

 

download : file latihan membuat simulasi SPLDV

Learn to Code : Membuat simulasi warna RGB (Red – Green – Blue) pada powerpoint

Pada posting kali ini, akan dijelaskan bagaimana membuat simulasi warna RGB (Red – Green – Blue) pada powerpoint menggunakan visual basic for application.

download : video tutorial membuat simulasi warna RGB

Script VBA untuk membuat simulasi warna RGB

Private Sub SpinButton1_Change()
ActivePresentation.Slides(1).Shapes(“kotakRGB”).Fill.BackColor.RGB = RGB(Val(SpinButton1), Val(SpinButton2), Val(SpinButton3))
ActivePresentation.Slides(1).Shapes(“kotakRGB”).Fill.ForeColor.RGB = RGB(Val(SpinButton1), Val(SpinButton2), Val(SpinButton3))
ActivePresentation.Slides(1).Shapes(“kotakRed”).Fill.BackColor.RGB = RGB(Val(SpinButton1), 0, 0)
ActivePresentation.Slides(1).Shapes(“kotakRed”).Fill.ForeColor.RGB = RGB(Val(SpinButton1), 0, 0)
ActivePresentation.Slides(1).Shapes(“angkaRed”).TextFrame.TextRange.Text = Val(SpinButton1)
End Sub

Private Sub SpinButton2_Change()
ActivePresentation.Slides(1).Shapes(“kotakRGB”).Fill.BackColor.RGB = RGB(Val(SpinButton1), Val(SpinButton2), Val(SpinButton3))
ActivePresentation.Slides(1).Shapes(“kotakRGB”).Fill.ForeColor.RGB = RGB(Val(SpinButton1), Val(SpinButton2), Val(SpinButton3))
ActivePresentation.Slides(1).Shapes(“kotakGreen”).Fill.BackColor.RGB = RGB(0, Val(SpinButton2), 0)
ActivePresentation.Slides(1).Shapes(“kotakGreen”).Fill.ForeColor.RGB = RGB(0, Val(SpinButton2), 0)
ActivePresentation.Slides(1).Shapes(“angkaGreen”).TextFrame.TextRange.Text = Val(SpinButton2)
End Sub

Private Sub SpinButton3_Change()
ActivePresentation.Slides(1).Shapes(“kotakRGB”).Fill.BackColor.RGB = RGB(Val(SpinButton1), Val(SpinButton2), Val(SpinButton3))
ActivePresentation.Slides(1).Shapes(“kotakRGB”).Fill.ForeColor.RGB = RGB(Val(SpinButton1), Val(SpinButton2), Val(SpinButton3))
ActivePresentation.Slides(1).Shapes(“kotakBlue”).Fill.BackColor.RGB = RGB(0, 0, Val(SpinButton3))
ActivePresentation.Slides(1).Shapes(“kotakBlue”).Fill.ForeColor.RGB = RGB(0, 0, Val(SpinButton3))
ActivePresentation.Slides(1).Shapes(“angkaBlue”).TextFrame.TextRange.Text = Val(SpinButton3)
End Sub

download : file latihan membuat simulasi warna RGB