Shuffle the Cards Sub Shuffle() Dim Iupper As Integer Dim Ilower As Integer Dim Ifrom As Integer Dim Ito As Integer Dim i As Integer Iupper = InputBox("What.

Slides:



Advertisements
Similar presentations
Sep-05 Slide:1 VBA in Excel Walter Milner. Sep-05 Slide:2 VBA in Excel Introduction VBA = Visual Basic for Applications Enables end-user programming In.
Advertisements

Shuffle an Array Shuffle a deck of cards. n In i th iteration, choose a random element from remainder of deck and put at index i. – choose random integer.
Standard Algorithms Find the highest number. ! Your name and today’s date ! Find the maximum Dim numbers(20) As Integer.
GCSE Computing Working with numbers. Challenge ‘Crimson Mystical Mages’ is a fantasy role playing board game. You need to create an electronic program.
Slide 1 VB Program Flow Control. Slide 2 Making Decisions v Decision Statement: control the execution of parts of the program based on conditions. v The.
PowerPoint Presentation Part III Adding Transitions and Builds to the Slide Show.
Input and Message Boxes. InputBox() Function An input box is a dialog box that opens and waits for the user to enter information. Syntax: InputBox(prompt[,title][,default])
DATA Control. Data Control caption Get first Get previous Get next Get last.
 There are 3 things that you can do right after you get home today:  Read a book  Homework  Take a nap  Next to each one, assign a value from 0-10.
Arrays. What is the output of: Private Sub cmdButton_Click() Dim i As Integer, a(1 To 4) As integer Open "DATA.TXT" For Input As #1 For i = 1 To 4 Input.
Private Sub Close_Click() On Error GoTo Err_Close_Click DoCmd.Close Exit_Close_Click: Exit Sub Err_Close_Click: MsgBox Err.Description Resume Exit_Close_Click.
Ch 10: More on Variables and Subroutines CP212 Winter 2012.
COM148X1 Interactive Programming Lecture 6. Topics Today Generate Random Numbers Graphics Animation.
Chapter 7 Code Tables. VB Code Box 7-1 Event Procedure for Compute Button Private Sub hsbExemptions_Change() txtExemptions.Text =Str(hsbExemptions.Value)
VB for Application (VBA). Sub find_noun() Dim range1 As Range Dim cell1 As Range Dim strign1 As String string1 = InputBox(" 請輸入範圍 ") Set range1 = Range(string1)
Data files and databases. Need a control to browse to a file Standard controls for drive folder and list not much use The CommonDialogs control offers.
ME 142 Engineering Computation I Loops. Key Concepts Looping Basics For… Next Statement Do… Loop Statement For Each… Next Statement.
MS Visual Basic Applications Walter Milner. Event-driven programming Standard approach for GUIs Contrast with old character interfaces – program determines.
CSC 162 Visual Basic I Programming. Array Parameters and Sorting Array Parameters –Entire Arrays –Individual Elements Sorting –Bubble Sort.
Visual Basic Games: Week 4 Recap Parallel structures Initialization Prepare for Memory Scoring Shuffling Homework: when ready, move on to next game/chapter.
Number of Payments Interest Rate Amount Borrowed Monthly Payment Total Cost of Interest Creditor A7214%$7,500.00$154.54$3, Creditor B6014%$7,500.00$174.51$2,
Box and Whisker Plots.
1 CS105 Discussion 5 – Variables and If Announcements MP 1 due on Monday Midterm 1 on Tuesday If you need a conflict, request it NOW!!
Repetition Structures
AGENDA KID PRESIDENT VIDEO OBJECTIVES WARM-UP LESSON 1 EXIT CARD.
Macro’s Within excel. Most functionality can be driven from VBA VBA is the programming language that runs inside of excel. It uses visual basic as the.
Random Numbers Random numbers are extremely useful: especially for games, and also for calculating experimental probabilities. Formula for generating random.
Bubble Sort Notes David Beard CIS220. Bubble Sort for Strings Double pass algorithm to sort a single dimensional array. Inner loop “bubbles” largest element.
For…Next and Do...While Loops! Happy St. Patrick’s Day!
CSC 162 Visual Basic I Programming. Repetition Structures Pretest Loop –Exit condition is tested before the body of code is executed Posttest Loop –Exit.
1 Microsoft® Visual Basic®.NET Language # 2. 2 Flow-Control Statements If … End If Select Case … End Select For… Next Do … Loop Exit.
The number which appears most often in a set of numbers. Example: in {6, 3, 9, 6, 6, 5, 9, 3} the Mode is 6 (it occurs most often). Mode : The middle number.
Visual Basic. The Close Method The Close method is used to close a form. To close a form use the keyword Me to refer to the form. Me.Close()
情報基礎 A Lecture 9 Takeshi Tokuyama ・ Jinhee Chun Tohoku University Graduate School of Information Sciences System Information Sciences Design and Analysis.
How to make a quiz By CJ. These are basic template quizzes that can be made with some skill. Get rid of the numbers, the good luck slide and this slide.
Selection Part 2 Using Logical Operators, how strings are compared and random numbers.
TUTORIAL 4 Visual Basic 6.0 Mr. Crone. Pseudocode Pseudocode is written language that is part-code part- English and helps a programmer to plan the layout.
Processing multiple files
Chapter 3 Section5 Subtracting Integers.
By: Isaiah, Kayla, and Julissa
Active X EXE (Out of Process Components)
, Mean Median , Range Mode &.
continued on next slide
Dot Cards Face-Off Game
                                                                                                                                                                                                                                                
continued on next slide
continued on next slide
حلقات التكرار.
Getting a unique random number (without duplicated one)
1.الدوال Function 2.الاجراءاتSub Procedure 3.وحده نمطيه Add Module
מבוא למדעי המחשב לתעשייה וניהול
Getting a unique random number (without duplicated one)
Evolution from VBA V1 to V2 (Numerics)
LCM (lowest common multiples)
PowerPoint Slide Shuffler
1 To go to the next slide, click this button instead. A random slide will come up.
1.2 Compare and ordering Positive and Negative Integers
What Causes The Tides To Occur?
Active-X Calendar Control
Put the title here Here is the sub-title.
Put the title here Here is the sub-title.
Reading from File & Picture Boxes
Randomized Algorithms
video Warm-Up Lesson 14 Exit card
continued on next slide
I have… I have… Who has 3:40? Who has 12:20? I have… I have…
Randomized Algorithms
Sub 範例 Sub F ( X ) MsgBox(X ^ 2 ) End Function
continued on next slide
Presentation transcript:

Shuffle the Cards Sub Shuffle() Dim Iupper As Integer Dim Ilower As Integer Dim Ifrom As Integer Dim Ito As Integer Dim i As Integer Iupper = InputBox("What is the highest slide number to shuffle") Ilower = InputBox("What is the lowest slide number to shuffle") If Iupper > ActivePresentation.Slides.Count Or Ilower < 1 Then GoTo err For i = 1 To 2 * Iupper Randomize Ifrom = Int((Iupper - Ilower + 1) * Rnd + Ilower) Ito = Int((Iupper - Ilower + 1) * Rnd + Ilower) ActivePresentation.Slides(Ifrom).MoveTo (Ito) Next i Exit Sub err: MsgBox "Your choices are out of range", vbCritical End Sub Shuffle Video

1

2

3

4