Universitas Sumatera Utara

Similar documents
HELP - VB TIPS. ANIMATE AN IMAGE BOX Insert a module. In this module, create a global variable: Global x

Project : Version : Date : 11/04/2016 Author : Freeware, for evaluation and non-commercial use only Company : Comments:

Human Factors Engineering Short Course Topic: A Simple Numeric Entry Keypad

IS 320 Spring 96 Page 1 Exam 1. Please use your own paper to answer the following questions. Point values are shown in parentheses.

Function: function procedures and sub procedures share the same characteristics, with

An InputBox( ) function will display an input Box window where the user can enter a value or a text. The format is

DATABASE AUTOMATION USING VBA (ADVANCED MICROSOFT ACCESS, X405.6)

Please answer questions in the space provided. Question point values are shown in parentheses.

Programming with visual Basic:

My first game. 'function which adds objects with bug tag to bugarray array. Saturday, November 23, :06 AM

CMPT 110 MIDTERM OCTOBER 18, 2001

VISUAL BASIC SERVER INTERFACE CODE. Visual Basic 6 Graphical Interface 103. Visual Basic Module rtsscomm.bas Code.115

2-26 Learn Visual Basic 6.0

Remainder Cordial Labeling of Graphs

IS 320 A/B Spring 97 Page 1 Exam 1

Download the files from you will use these files to finish the following exercises.

PROGRAM 1: SIMPLE CALCULATOR

AIM To analyze, design and develop code for Online Course Reservation System using Rational Rose software

Visual Basic 6 Lecture 7. The List Box:

C:\MasterPageWeb\HAPR\docu\HAPR_VB6_version15sept06.rtf 19/10/08. HARP_VB projet en VB6

University of Technology Laser & Optoelectronics Engineering Department Visual basic Lab. LostFocus Resize System event

Mr.Khaled Anwar ( )

Relational Operators. > greater than < less than >= greater than or equal to <= less than or equal to <> not equal to = equal to

Simply Access Tips. Issue April 26 th, Welcome to the twelfth edition of Simply Access Tips for 2007.

Revision for Final Examination (Second Semester) Grade 9

IS 320 A/B Winter 1998 Page 1 Exam 1

CPS Plus Data Acquisition Software ActiveX interface

PG-MSR207 manual swipe magnetic card Reader/Writer User s Guide

Respond to Data Entry Events

The Control Properties

Tutorial, Source code, Request Program Visual Basic

Universitas Sumatera Utara

REFERENCE MATERIALS. Assignment, Display, and Input Evaluates expression and assigns the result to the variable a.

ต วอย างการสร างฟอร ม เมน การใช งาน

Visual Basic for Applications

S.2 Computer Literacy Question-Answer Book

TABLE OF CONTENTS ADVANCED VISUAL BASIC

LAMPIRAN A : LISTING PROGRAM


Contents Introduction Getting Started Visual Basic Form Configuration Entering the VB Code

ADVANCED ALGORITHMS TABLE OF CONTENTS

Learning VB.Net. Tutorial 19 Classes and Inheritance

Department of Computer and Mathematical Sciences. Lab 7: Selection

Complete program to solve a 2 nd degree equation

End Sub. Sub Kunci() Dim i As Integer For i = 0 To 4 Txtfield(i).Locked = True Next i grddatagrid.enabled = False End Sub

Sub Programs. To Solve a Problem, First Make It Simpler

Save and Load Searches in Access VBA

EGR1301_Linear_Equation_Solver_ docx. 1. Select Options 2. Select Add Ins. 3. Select Solver Add in and press OK.

NOTES: Procedures (module 15)

LISTING PROGRAM. 1. Form Login. Private Sub BATAL_Click() End End Sub

LAMPIRAN FORM 1 Universitas Sumatera Universitas Utara

Operating Software Instruction Manual for MCC Series of Motion Controllers

DroidBasic Syntax Contents

MIS 216 SPRING 2018 PROJECT 4

Objectives. Introduce the core C# language features class Main types variables basic input and output operators arrays control constructs comments

Financial Functions (all with subtypes: Normal, Stairs, Points, Height, Hollow, Colors, Marks, No Border except where indicated):

IS 320 A-C Page 1 Spring 99 Exam 2

UNIT 1. Introduction to Microsoft.NET framework and Basics of VB.Net

The SudokuPuzzle Class


PROJECT ELECTRONIC CONTROL GAS INJECTION SYSTEM

Recap. ANSI C Reserved Words C++ Multimedia Programming Lecture 2. Erwin M. Bakker Joachim Rijsdam

Visual Basic. The Integrated Development Environment. Menu Bar

1. Create your First VB.Net Program Hello World

LISTING PROGRAM. 1. Menu Utama

ElseIf: Another Conditional Statement

AP Computer Science Principles Exam Reference Sheet

20. VB Programming Fundamentals Variables and Procedures

How to use JS Automation I/O driver

Beginning Programming (Pascal) Lecture 75. Figure 1. type-declarations. simple-type. pointer-type. array-type. file-type. set-type.

Visual Basic Visual Basic

Using BasicX to Derive Acceleration From GARMIN GPS Text Data

JAVA MOCK TEST JAVA MOCK TEST II

Flow Control. CSC215 Lecture

5 When a program calls a function, in which type of data structure is memory allocated for the variables in that function?

Computing Science Unit 1

Higher Computing Science Software Design and Development - Programming Summary Notes

That means circular linked list is similar to the single linked list except that the last node points to the first node in the list.

Propose a mathematical formula to verify the authenticity of any product of the integers using a scale (9) and verified using computer

Quick Reference Guide

Beispiel Joystick. Code frm_joytest

LISTING PROGRAM. Form Splash

The following are required to duplicate the process outlined in this document.

Mr. Giansante. Visual Basic. Adventure Game


Basics of Java: Expressions & Statements. Nathaniel Osgood CMPT 858 February 15, 2011

2. (16) Salesperson bonuses are paid based on a combination of total unit sales and the number of new accounts according to the following table:

CSC Java Programming, Fall Java Data Types and Control Constructs

I101/B100 Problem Solving with Computers

Statements and Operators

Procedures. This is a common situation -- there is some functionality that computers should have that the do not the solution is to write a procedure

Functions and Procedures. Functions. Built In Functions. Built In Functions in VB FIT 100 FIT 100

2Practicals Visual Basic 6.0

Unit 4. Lesson 4.1. Managing Data. Data types. Introduction. Data type. Visual Basic 2008 Data types

CSC 112 :: Test #2 Study Guide with Answers April 25, 2012 Short Answer Questions

VBA Handout. References, tutorials, books. Code basics. Conditional statements. Dim myvar As <Type >

NATIONAL DIPLOMA IN COMPUTER TECHNOLOGY

Angel International School - Manipay 1 st Term Examination November, 2015

Chapter 4 The If Then Statement

Random numbers program

Transcription:

43 L A M P I R A N

44 Penulisan Kode Program Aplikasi Game Tetris A. Kode program aplikasi game tetris untuk form1 ( MainF.frm ) adalah sebagai berikut. Dim BANK As Database Dim RS As DAO.Recordset Private Sub C_GotFocus(Index As Integer) KeyDownC.SetFocus End Sub Private Sub Check1_Click() KeyDownC.SetFocus End Sub Private Sub Check1_KeyDown(KeyCode As Integer, Shift As Integer) KeyDownC.SetFocus End Sub Private Sub Command1_Click() RS.MoveFirst RS.Edit RS("hiscoref") = 0

45 RS.Update HIS.Caption = "Hi Score : " + CStr(RS("hiscoref")) If KeyDownC.Enabled Then KeyDownC.SetFocus End Sub Private Sub Form_GotFocus() KeyDownC.SetFocus End Sub Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 39 Then Call MOVErigth If KeyCode = 37 Then Call MOVEleft End Sub Private Sub Form_Load() 'KeyDownC.SetFocus Set BANK = DBEngine.OpenDatabase(App.Path + "\hiscore.mdb") Set RS = BANK.OpenRecordset("his") RS.MoveFirst HIS.Caption = "Hi Score : " + CStr(RS("hiscoref")) BEGflag = True If SND.Value = 1 Then j = sndplaysound(app.path + "\startgame.wav", 0) nextshape BEGflag1 = True

46 MAINtimer.Enabled = True End Sub Private Sub Form_Unload(Cancel As Integer) If SND.Value = 1 Then j = sndplaysound(app.path + "\gameover.wav", SND_ASYNC Or SND_LOOP) End Sub Private Sub KeyDownC_KeyPress(KeyCode As Integer) KeyDownC.Caption = KeyAscii 'Form1.BackColor = GRRc.BackColor If KeyCode = 48 Then If SELshape = 4 Then SELshape = 1 Else SELshape = SELshape + 1 If KeyCode = 48 Then Call ROTATEshape If KeyCode = 54 Then Call MOVErigth If KeyCode = 52 Then Call MOVEleft If KeyCode = 53 Then Call MOVEdown 'If KeyCode = 51 Then Call nextshape If KeyCode = 32 Then FASTdownFLAG = True

47 Call MOVEdown If KeyCode = 112 Or KeyCode = 80 Then Call pousekey End Sub Function GetMEi() 'If BEGflag Then ' ' BEGflag = False Call GetMEi ' COLORt = S(6) 'PRi = i 'rewflag = True Randomize Timer pishi1 = Rnd * 1000 For i = 1 To 8 If pishi1 > i * 142-142 And pishi1 <= i * 142 Then Exit For Next i TEMPi = PRi DEFshape If Not BEGflag Then PRi = i

48 Call PRIshape Else BEGflag = False Call GetMEi i = TEMPi 'BEGflag = False End Function Function nextshape() KeepFLAG = True MainI = 4 SELshape = 1 'For k = 1 To 160 ' MM(k) = False 'Next k If KeepFLAG = True Then GetMEi DEFshape For j = 0 To 3 MM(MainI + S(j)) = S(6) Next j For cleaner = 1 To 160 If MM(cleaner) <> 0 Then

49 If MM(cleaner) = 1 Then C(cleaner).BackColor = BCOLOR(1).BackColor If MM(cleaner) = 2 Then C(cleaner).BackColor = BCOLOR(2).BackColor If MM(cleaner) = 3 Then C(cleaner).BackColor = BCOLOR(3).BackColor If MM(cleaner) = 4 Then C(cleaner).BackColor = BCOLOR(4).BackColor If MM(cleaner) = 5 Then C(cleaner).BackColor = BCOLOR(5).BackColor If MM(cleaner) = 6 Then C(cleaner).BackColor = BCOLOR(6).BackColor If MM(cleaner) = 7 Then C(cleaner).BackColor = BCOLOR(7).BackColor Else C(cleaner).BackColor = BLAKc.BackColor Next cleaner If SND.Value = 1 Then j = sndplaysound(app.path + "\falldown.wav", SND_ASYNC Or SND_LOOP) End Function Private Sub LEVEL_KeyPress(KeyAscii As Integer) If KeyAscii = 112 Then Call pousekey End Sub Private Sub MAINtimer_Timer() MOVEdown End Sub

50 Function ROTATEshape() KeepFLAG = True 'MainI = 4 For j = 0 To 3 MM(MainI + S(j)) = 0 Next j 'If KeepFLAG = True Then 'GetMEi DEFshape ' temp = MainI Mod 10 If temp = 0 Then temp = 10 row = ((MainI - (temp)) / 10) + 1 If MainI > S(4) + ((row - 1) * 10) Then fillflag = True For q = 0 To 3 If MM(MainI + S(q)) Then fillflag = True Next q If fillflag Then If SELshape = 1 Then SELshape = 4 Else SELshape = SELshape - 1 DEFshape

51 fillflag = False For j = 0 To 3 MM(MainI + S(j)) = S(6) Next j For cleaner = 1 To 160 If MM(cleaner) <> 0 Then If MM(cleaner) = 1 Then C(cleaner).BackColor = BCOLOR(1).BackColor If MM(cleaner) = 2 Then C(cleaner).BackColor = BCOLOR(2).BackColor If MM(cleaner) = 3 Then C(cleaner).BackColor = BCOLOR(3).BackColor If MM(cleaner) = 4 Then C(cleaner).BackColor = BCOLOR(4).BackColor If MM(cleaner) = 5 Then C(cleaner).BackColor = BCOLOR(5).BackColor If MM(cleaner) = 6 Then C(cleaner).BackColor = BCOLOR(6).BackColor If MM(cleaner) = 7 Then C(cleaner).BackColor = BCOLOR(7).BackColor Else C(cleaner).BackColor = BLAKc.BackColor Next cleaner End Function Function MOVErigth() KeepFLAG = True For j = 0 To 3 MM(MainI + S(j)) = False Next j MainI = MainI + 1

52 temp = MainI Mod 10 If temp = 0 Then temp = 10 row = ((MainI - (temp)) / 10) + 1 If MainI > S(4) + ((row - 1) * 10) Then MainI = MainI - 1 If i = 7 And (SELshape = 2 Or SELshape = 4) And temp = 1 Then MainI = MainI - 1 For q = 0 To 3 If MM(MainI + S(q)) Then fillflag = True Next q If fillflag Then MainI = MainI - 1 fillflag = False For j = 0 To 3 MM(MainI + S(j)) = S(6) Next j For cleaner = 1 To 160 If MM(cleaner) <> 0 Then If MM(cleaner) = 1 Then C(cleaner).BackColor = BCOLOR(1).BackColor If MM(cleaner) = 2 Then C(cleaner).BackColor = BCOLOR(2).BackColor If MM(cleaner) = 3 Then C(cleaner).BackColor = BCOLOR(3).BackColor If MM(cleaner) = 4 Then C(cleaner).BackColor = BCOLOR(4).BackColor If MM(cleaner) = 5 Then C(cleaner).BackColor = BCOLOR(5).BackColor If MM(cleaner) = 6 Then C(cleaner).BackColor = BCOLOR(6).BackColor If MM(cleaner) = 7 Then C(cleaner).BackColor = BCOLOR(7).BackColor Else C(cleaner).BackColor = BLAKc.BackColor

53 Next cleaner End Function Function MOVEleft() KeepFLAG = True For j = 0 To 3 MM(MainI + S(j)) = 0 Next j MainI = MainI - 1 row = ((MainI - (MainI Mod 10)) / 10) + 1 If MainI < 1 + ((row - 1) * 10) Then MainI = MainI + 1 For q = 0 To 3 If MM(MainI + S(q)) <> 0 Then fillflag = True Next q If fillflag Then MainI = MainI + 1 fillflag = False 'If KeepFLAG = True Then '******************************** 'GetMEi ' DEFshape ' For j = 0 To 3 MM(MainI + S(j)) = S(6) Next j For cleaner = 1 To 160 If MM(cleaner) <> 0 Then

54 If MM(cleaner) = 1 Then C(cleaner).BackColor = BCOLOR(1).BackColor If MM(cleaner) = 2 Then C(cleaner).BackColor = BCOLOR(2).BackColor If MM(cleaner) = 3 Then C(cleaner).BackColor = BCOLOR(3).BackColor If MM(cleaner) = 4 Then C(cleaner).BackColor = BCOLOR(4).BackColor If MM(cleaner) = 5 Then C(cleaner).BackColor = BCOLOR(5).BackColor If MM(cleaner) = 6 Then C(cleaner).BackColor = BCOLOR(6).BackColor If MM(cleaner) = 7 Then C(cleaner).BackColor = BCOLOR(7).BackColor Else C(cleaner).BackColor = BLAKc.BackColor Next cleaner End Function Function MOVEdown() Dim lineflag As Boolean SCORE.Text = Val(SCORE.Text) + 5 'If MAINtimer.Interval < 200 Then ' MAINtimer.Interval = 500 ' LEVEL.Text = Val(LEVEL.Text) + 1 ' 'MAINtimer.Interval = MAINtimer.Interval - 2 'If SND.Value = 1 Then j = sndplaysound(app.path + "\falldown.wav", SND_ASYNC) KeepFLAG = True

55 For j = 0 To 3 MM(MainI + S(j)) = 0 Next j MainI = MainI + 10 'If MainI > S(5) Then 'p = i ' For q = 0 To 3 If MM(MainI + S(q)) <> 0 Then fillflag = True Next q If S(5) < MainI Or fillflag Then MainI = MainI - 10 For p = 0 To 3 MM(MainI + S(p)) = S(6) Next p fillflag = False If MainI < 10 And Not BEGflag1 Then MAINtimer.Enabled = False If Val(SCORE.Text) > RS("hiscoref") Then RS.Edit RS("hiscoref") = Val(SCORE.Text) RS.Update HIS.Caption = "Hi Score : " + CStr(RS("hiscoref")) C(44).BackColor = Smile.BackColor

56 C(47).BackColor = Smile.BackColor C(62).BackColor = Smile.BackColor C(73).BackColor = Smile.BackColor C(84).BackColor = Smile.BackColor C(85).BackColor = Smile.BackColor C(86).BackColor = Smile.BackColor C(87).BackColor = Smile.BackColor C(78).BackColor = Smile.BackColor C(69).BackColor = Smile.BackColor If SND.Value = 1 Then j = sndplaysound(app.path + "\gameover.wav", SND_ASYNC Or SND_LOOP) MsgBox "YOU LOSE THE GAME! " KeyDownC.Enabled = False Exit Function BEGflag1 = False For w = 0 To 15 lineflag = True For e = 1 To 10 If MM(w * 10 + e) = 0 Then lineflag = False Next e If lineflag = True Then SCORE.Text = Val(SCORE.Text) + 100 For r = w To 1 Step -1 For t = 1 To 10

57 MM(r * 10 + t) = MM((r - 1) * 10 + t) MM((r - 1) * 10 + t) = 0 'If MM(r * 10 + t) Then C(r * 10 + t).backcolor = GRRc.BackColor Else C(r * 10 + t).backcolor = BLAKc.BackColor Next t Next r 'GoTo 1 If SND.Value = 1 Then j = sndplaysound(app.path + "\LINEFILL.wav", SND_ASYNC) Next w For cleaner = 1 To 160 If MM(cleaner) <> 0 Then If MM(cleaner) = 1 Then C(cleaner).BackColor = BCOLOR(1).BackColor If MM(cleaner) = 2 Then C(cleaner).BackColor = BCOLOR(2).BackColor If MM(cleaner) = 3 Then C(cleaner).BackColor = BCOLOR(3).BackColor If MM(cleaner) = 4 Then C(cleaner).BackColor = BCOLOR(4).BackColor If MM(cleaner) = 5 Then C(cleaner).BackColor = BCOLOR(5).BackColor If MM(cleaner) = 6 Then C(cleaner).BackColor = BCOLOR(6).BackColor If MM(cleaner) = 7 Then C(cleaner).BackColor = BCOLOR(7).BackColor Else C(cleaner).BackColor = BLAKc.BackColor Next cleaner FASTdownFLAG = False

58 nextshape Else If FASTdownFLAG Then Call MOVEdown 'If MainI > 140 Then MainI = MainI - 10 'If KeepFLAG = True Then 'GetMEi 'DEFshape ' For j = 0 To 3 MM(MainI + S(j)) = S(6) Next j For cleaner = 1 To 160 If MM(cleaner) <> 0 Then If MM(cleaner) = 1 Then C(cleaner).BackColor = BCOLOR(1).BackColor If MM(cleaner) = 2 Then C(cleaner).BackColor = BCOLOR(2).BackColor If MM(cleaner) = 3 Then C(cleaner).BackColor = BCOLOR(3).BackColor If MM(cleaner) = 4 Then C(cleaner).BackColor = BCOLOR(4).BackColor If MM(cleaner) = 5 Then C(cleaner).BackColor = BCOLOR(5).BackColor If MM(cleaner) = 6 Then C(cleaner).BackColor = BCOLOR(6).BackColor If MM(cleaner) = 7 Then C(cleaner).BackColor = BCOLOR(7).BackColor Else C(cleaner).BackColor = BLAKc.BackColor Next cleaner

59 'If lineflag = True Then ' ' lineflag = False Exit Function ' End Function Private Sub NEW_GAME_Click() HIS.Caption = "Hi Score : " + CStr(RS("hiscoref")) MainI = 4 For lk = 0 To 160 MM(lk) = 0 Next lk SCORE.Text = 0 LEVEL.Text = 1 MAINtimer.Enabled = True KeyDownC.Enabled = True If KeyDownC.Enabled Then KeyDownC.SetFocus If SND.Value = 1 Then j = sndplaysound(app.path + "\startgame.wav", SND_ASYNC Or SND_LOOP) End Sub Private Sub NEW_GAME_KeyPress(KeyAscii As Integer) If KeyAscii = 112 Or KeyAscii = 80 Then Call pousekey

60 End Sub Function pousekey() MAINtimer.Enabled = Not MAINtimer.Enabled KeyDownC.Enabled = Not KeyDownC.Enabled If KeyDownC.Enabled Then KeyDownC.SetFocus End Function Private Sub SCORE_KeyPress(KeyAscii As Integer) If KeyAscii = 112 Or KeyAscii = 80 Then Call pousekey End Sub Function PRIshape() For m = 1 To 4 A(m).BackColor = PINKc.BackColor A(m + 10).BackColor = PINKc.BackColor A(m + 20).BackColor = PINKc.BackColor A(m + 30).BackColor = PINKc.BackColor Next m If S(6) = 0 Then Exit Function Select Case PRi

61 Case 1 GoTo 1 Case 2 GoTo 2 Case 3 GoTo 3 Case 4 GoTo 4 Case 5 GoTo 5 Case 6 GoTo 6 Case 7 GoTo 7 End Select 1 A(2).BackColor = BCOLOR(S(6)).BackColor A(3).BackColor = BCOLOR(S(6)).BackColor A(11).BackColor = BCOLOR(S(6)).BackColor A(12).BackColor = BCOLOR(S(6)).BackColor Exit Function 2 A(1).BackColor = BCOLOR(S(6)).BackColor A(2).BackColor = BCOLOR(S(6)).BackColor A(12).BackColor = BCOLOR(S(6)).BackColor

62 A(13).BackColor = BCOLOR(S(6)).BackColor Exit Function 3 A(1).BackColor = BCOLOR(S(6)).BackColor A(11).BackColor = BCOLOR(S(6)).BackColor A(21).BackColor = BCOLOR(S(6)).BackColor A(22).BackColor = BCOLOR(S(6)).BackColor Exit Function 4 A(2).BackColor = BCOLOR(S(6)).BackColor A(12).BackColor = BCOLOR(S(6)).BackColor A(21).BackColor = BCOLOR(S(6)).BackColor A(22).BackColor = BCOLOR(S(6)).BackColor Exit Function 5 A(2).BackColor = BCOLOR(S(6)).BackColor A(11).BackColor = BCOLOR(S(6)).BackColor A(12).BackColor = BCOLOR(S(6)).BackColor A(13).BackColor = BCOLOR(S(6)).BackColor Exit Function 6

63 A(1).BackColor = BCOLOR(S(6)).BackColor A(2).BackColor = BCOLOR(S(6)).BackColor A(11).BackColor = BCOLOR(S(6)).BackColor A(12).BackColor = BCOLOR(S(6)).BackColor Exit Function 7 A(1).BackColor = BCOLOR(S(6)).BackColor A(2).BackColor = BCOLOR(S(6)).BackColor A(3).BackColor = BCOLOR(S(6)).BackColor A(4).BackColor = BCOLOR(S(6)).BackColor Exit Function End Function Private Sub SND_Click() If KeyDownC.Enabled Then KeyDownC.SetFocus End Sub

64 B. Kode program untuk Modules yg diberi nama ( PhisiM.bas ). Declare Function sndplaysound Lib "winmm.dll" Alias "sndplaysounda" (ByVal lpszsoundname As String, ByVal uflags As Long) As Long Global S(6) As Integer 'global s2(3) As Integer 'Global s3(3) As Integer 'Global s4(3) As Integer 'Global s5(3) As Integer 'Global s6(3) As Integer 'Global s7(3) As Integer Global MM(160) As Integer 'if 0 then null if 1 then blue if 2 red Global SELshape As Integer Global MainI As Integer Global KeepFLAG As Boolean Global rewflag As Boolean Global i As Integer Global row As Integer Global fillflag As Boolean Global FASTdownFLAG As Boolean Global ShColor As Integer Global PRi As Integer Global BEGflag As Boolean Global TEMPi As Integer

65 Global BEGflag1 As Boolean Global COLORt As Integer Function DEFshape() Select Case SELshape Case 1 'KIND a Select Case i Case 1 S(0) = 1 S(1) = 2 S(2) = 10 S(3) = 11 S(4) = 8 S(5) = 140 Case 2 S(1) = 1 S(2) = 11 S(3) = 12 S(4) = 8 S(5) = 140 Case 3

66 S(1) = 10 S(2) = 20 S(3) = 21 S(5) = 130 S(4) = 9 Case 4 S(0) = 1 S(1) = 11 S(2) = 20 S(3) = 21 S(4) = 9 S(5) = 130 Case 5 S(0) = 1 S(1) = 10 S(2) = 11 S(3) = 12 S(4) = 8 S(5) = 140 Case 6 S(1) = 1 S(2) = 10 S(3) = 11 S(4) = 9

67 S(5) = 140 Case 7 S(1) = 1 S(2) = 2 S(3) = 3 S(4) = 7 S(5) = 150 End Select Case 2 'KIND b Select Case i Case 1 S(1) = 10 S(2) = 11 S(3) = 21 S(4) = 9 S(5) = 130 Case 2 S(0) = 1 S(1) = 10 S(2) = 11 S(3) = 20 S(4) = 9

68 S(5) = 130 Case 3 S(1) = 1 S(2) = 2 S(3) = 10 S(4) = 8 S(5) = 140 Case 4 S(1) = 10 S(2) = 11 S(3) = 12 S(4) = 8 S(5) = 140 Case 5 S(1) = 10 S(2) = 11 S(3) = 20 S(4) = 9 S(5) = 130 Case 6 S(1) = 1

69 S(2) = 10 S(3) = 11 S(4) = 9 S(5) = 140 Case 7 S(1) = 10 S(2) = 20 S(3) = 30 S(4) = 10 S(5) = 120 End Select Case 3 'KIND c Select Case i Case 1 S(0) = 1 S(1) = 2 S(2) = 10 S(3) = 11 S(4) = 8 S(5) = 140 Case 2 S(1) = 1

70 S(2) = 11 S(3) = 12 S(4) = 8 S(5) = 140 Case 3 S(1) = 1 S(2) = 11 S(3) = 21 S(4) = 9 S(5) = 130 Case 4 S(1) = 1 S(2) = 10 S(3) = 20 S(4) = 9 S(5) = 130 Case 5 S(1) = 1 S(2) = 2 S(3) = 11 S(4) = 8 S(5) = 140

71 Case 6 S(1) = 1 S(2) = 10 S(3) = 11 S(4) = 9 S(5) = 140 Case 7 S(1) = 1 S(2) = 2 S(3) = 3 S(4) = 7 S(5) = 150 End Select Case 4 'KIND d Select Case i Case 1 S(1) = 10 S(2) = 11 S(3) = 21 S(4) = 9 S(5) = 130

72 Case 2 S(0) = 1 S(1) = 10 S(2) = 11 S(3) = 20 S(4) = 9 S(5) = 130 Case 3 S(0) = 2 S(1) = 10 S(2) = 11 S(3) = 12 S(4) = 8 S(5) = 140 Case 4 S(1) = 1 S(2) = 2 S(3) = 12 S(4) = 8 S(5) = 140 Case 5 S(0) = 1 S(1) = 10 S(2) = 11

73 S(3) = 21 S(4) = 9 S(5) = 130 Case 6 S(1) = 1 S(2) = 10 S(3) = 11 S(4) = 9 S(5) = 140 Case 7 S(1) = 10 S(2) = 20 S(3) = 30 S(4) = 10 S(5) = 120 End Select End Select Select Case i Case 1 S(6) = 1 Case 2 S(6) = 2 Case 3

74 S(6) = 3 Case 4 S(6) = 4 Case 5 S(6) = 5 Case 6 S(6) = 6 Case 7 S(6) = 7 End Select End Function