0% found this document useful (0 votes)
20 views43 pages

Julia - Bit by Bit: Programming For Beginners (Undergraduate Topics in Computer Science) Noel Kalicharan PDF Download

The document is about the book 'Julia - Bit by Bit: Programming for Beginners' by Noel Kalicharan, which aims to teach programming using the Julia language to complete beginners. It emphasizes that prior knowledge of mathematics is not necessary, and focuses on logical thinking and problem-solving skills. The book covers fundamental programming principles and provides numerous examples and exercises to facilitate learning.

Uploaded by

azembanonova5
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views43 pages

Julia - Bit by Bit: Programming For Beginners (Undergraduate Topics in Computer Science) Noel Kalicharan PDF Download

The document is about the book 'Julia - Bit by Bit: Programming for Beginners' by Noel Kalicharan, which aims to teach programming using the Julia language to complete beginners. It emphasizes that prior knowledge of mathematics is not necessary, and focuses on logical thinking and problem-solving skills. The book covers fundamental programming principles and provides numerous examples and exercises to facilitate learning.

Uploaded by

azembanonova5
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 43

Julia - Bit by Bit: Programming for Beginners

(Undergraduate Topics in Computer Science) Noel


Kalicharan pdf download

https://ebookmeta.com/product/julia-bit-by-bit-programming-for-
beginners-undergraduate-topics-in-computer-science-noel-
kalicharan/

Download more ebook from https://ebookmeta.com


We believe these products will be a great fit for you. Click
the link to download now, or visit ebookmeta.com
to discover even more!

Doing Her Bit Erin Hagar

https://ebookmeta.com/product/doing-her-bit-erin-hagar/

Mathematics for Computer Graphics (Undergraduate Topics


in Computer Science), 6th Edition 2022 John Vince

https://ebookmeta.com/product/mathematics-for-computer-graphics-
undergraduate-topics-in-computer-science-6th-edition-2022-john-
vince/

micro bit IoT In C 2nd Edition Harry Fairhead

https://ebookmeta.com/product/micro-bit-iot-in-c-2nd-edition-
harry-fairhead/

Algorithms in Bioinformatics Theory and Implementation


1st Edition Gagniuc Paul A

https://ebookmeta.com/product/algorithms-in-bioinformatics-
theory-and-implementation-1st-edition-gagniuc-paul-a/
Philosophical Foundations of Neuroscience Second
Edition M R Bennett P M S Hacker

https://ebookmeta.com/product/philosophical-foundations-of-
neuroscience-second-edition-m-r-bennett-p-m-s-hacker/

Higher Education and China s Global Rise A Neo


tributary Perspective 1st Edition Su-Yan Pan

https://ebookmeta.com/product/higher-education-and-china-s-
global-rise-a-neo-tributary-perspective-1st-edition-su-yan-pan/

Digital Logic Design Using Verilog: Coding and RTL


Synthesis - 2nd Edition Taraate

https://ebookmeta.com/product/digital-logic-design-using-verilog-
coding-and-rtl-synthesis-2nd-edition-taraate/

ENVY The Love Is Cure Vol 1 Vices Virtues 4 1st Edition


Brookelyn Mosley

https://ebookmeta.com/product/envy-the-love-is-cure-vol-1-vices-
virtues-4-1st-edition-brookelyn-mosley/

Public Higher Education in California Neil J. Smelser


(Editor)

https://ebookmeta.com/product/public-higher-education-in-
california-neil-j-smelser-editor/
Human Microbiome in Health Disease and Therapy 1st
Edition Pallaval Veera Bramhachari

https://ebookmeta.com/product/human-microbiome-in-health-disease-
and-therapy-1st-edition-pallaval-veera-bramhachari/
Undergraduate Topics in Computer Science

Noel Kalicharan

Julia –
Bit by Bit
Programming for Beginners
Undergraduate Topics in Computer
Science

Series Editor
Ian Mackie, University of Sussex, Brighton, UK

Advisory Editors
Samson Abramsky , Department of Computer Science, University of Oxford,
Oxford, UK
Chris Hankin , Department of Computing, Imperial College London, London, UK
Mike Hinchey , Lero – The Irish Software Research Centre, University of
Limerick, Limerick, Ireland
Dexter C. Kozen, Department of Computer Science, Cornell University, Ithaca,
NY, USA
Andrew Pitts , Department of Computer Science and Technology, University of
Cambridge, Cambridge, UK
Hanne Riis Nielson , Department of Applied Mathematics and Computer Science,
Technical University of Denmark, Kongens Lyngby, Denmark
Steven S. Skiena, Department of Computer Science, Stony Brook University, Stony
Brook, NY, USA
Iain Stewart , Department of Computer Science, Durham University, Durham, UK
‘Undergraduate Topics in Computer Science’ (UTiCS) delivers high-quality
instructional content for undergraduates studying in all areas of computing and
information science. From core foundational and theoretical material to final-year
topics and applications, UTiCS books take a fresh, concise, and modern approach
and are ideal for self-study or for a one- or two-semester course. The texts are all
authored by established experts in their fields, reviewed by an international advisory
board, and contain numerous examples and problems, many of which include fully
worked solutions.
The UTiCS concept relies on high-quality, concise books in softback format, and
generally a maximum of 275–300 pages. For undergraduate textbooks that are likely
to be longer, more expository, Springer continues to offer the highly regarded Texts
in Computer Science series, to which we refer potential authors.

More information about this series at http://www.springer.com/series/7592


Noel Kalicharan

Julia - Bit by Bit


Programming for Beginners

123
Noel Kalicharan
Department of Computing and IT
University of the West Indies
St. Augustine, Trinidad and Tobago

ISSN 1863-7310 ISSN 2197-1781 (electronic)


Undergraduate Topics in Computer Science
ISBN 978-3-030-73935-5 ISBN 978-3-030-73936-2 (eBook)
https://doi.org/10.1007/978-3-030-73936-2

© The Editor(s) (if applicable) and The Author(s), under exclusive license to Springer Nature Switzerland AG 2021
This work is subject to copyright. All rights are solely and exclusively licensed by the Publisher, whether the whole or
part of the material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation,
broadcasting, reproduction on microfilms or in any other physical way, and transmission or information storage and
retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now known or hereafter
developed.
The use of general descriptive names, registered names, trademarks, service marks, etc. in this publication does not imply,
even in the absence of a specific statement, that such names are exempt from the relevant protective laws and regulations
and therefore free for general use.
The publisher, the authors, and the editors are safe to assume that the advice and information in this book are believed to
be true and accurate at the date of publication. Neither the publisher nor the authors or the editors give a warranty,
expressed or implied, with respect to the material contained herein or for any errors or omissions that may have been
made. The publisher remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

This Springer imprint is published by the registered company Springer Nature Switzerland AG
The registered company address is: Gewerbestrasse 11, 6330 Cham, Switzerland
Dedication
James & Clara
Claudette & Samuel
Jeff & Jenny
Margaret & Stephen
Kenrick & Debbie
Jennifer & Andrew
Anushka & Michael
Saskia & Vaishnavi

Special Thanks
Hubert Dupont
Shellyann Sooklal

For their meticulous, insightful and


helpful comments on the manuscript.
Their eye for detail was truly
impressive. Each brought their special,
but different, strengths to bear, making
this a better book than it would have
been without their input.
Preface

Julia—Bit by Bit attempts to teach computer programming to the complete beginner using
Julia—a relatively new programming language. Created in 2009 by Jeff Bezanson, Stefan
Karpinski, Viral B. Shah and Alan Edelman, Julia was launched in 2012. Their goal? "To create
a free language that was both high-level and fast." Since its launch, Julia has undergone several
version changes. As of November 9, 2020, it had matured to Version 1.5.3.
The book assumes you have no knowledge whatsoever about programming. And if you are
worried that you are not good at high-school mathematics, don’t be. It is a myth that you must
be good at mathematics to learn programming. In this book, a knowledge of primary school
mathematics is all that is required—basic addition, subtraction, multiplication, division, finding
the percentage of some quantity, finding an average or the larger of two quantities.
Some of our most outstanding students over the last forty years have been people with little
mathematics background from all walks of life—politicians, civil servants, sports people,
housewives, secretaries, clerical assistants, artists, musicians and teachers. On the other hand,
we’ve had professionals like engineers and scientists who didn’t do as well as might be
expected. So it's not about how "qualified" you are.
What will be an asset is the ability to think logically or to follow a logical argument. If you are
good at presenting convincing arguments, you will probably be a good programmer. Even if
you aren’t, programming is the perfect vehicle for learning logical thinking skills. You should
learn it for these skills even if you never intend to become a serious programmer.
The main goal of this book is to teach fundamental programming principles using Julia, one of
the fastest growing programming languages in the world today. Julia can be classified as a
"modern" language, possessing many features not available in more popular languages like C
and Java.
Best of all, Julia is easy to learn. In fact, I would go so far as to say that, of all the many
languages I have learnt and taught over the last forty years, Julia is the easiest to learn. This is
particularly important for someone learning programming for the first time. You can concentrate
on acquiring problem-solving skills without being overwhelmed by the language. I've known
many students who got turned off learning programming because they found the basics of the
language too difficult to grasp.
Julia strips away the "fluff" of most languages, the "overhead" you need to write even the
simplest programs. It's not fussy about things like semi-colons or having to "declare" the type
of every variable you need to use. You just use it the way you want—Julia will figure out the
type for you. But if you really want Julia to enforce "typing", it can do that as well.
Nevertheless, this book is as much about teaching basic problem-solving principles as it is about
teaching Julia. Remember, a language is useless if you can't use it to solve a problem. But once
you learn the principles well, they can be applied to any language.
Chapter 1 gives an overview of the programming process. It shows you how to write your first
Julia program and introduces some of the basic building blocks needed to write programs.
Chapter 2 is all about numbers—integers, floating-point, operators, expressions—how to work
with them and how to print them. It also explains how to write programs that use sequence
logic—statements are executed one after the other, from first to last.
Chapter 3 shows how to write programs which can make decisions. It explains how to use if
and if…else statements.
vii
viii Preface

Chapter 4 explains the notion of ‘looping’ and how to use this powerful programming idea to
solve more interesting problems. Looping is implemented using for and while statements. We
also explain how to read data from a file and write results to a file.
Chapter 5 formally treats with functions. These enable a (large) program to be broken up into
smaller manageable units but which work together to solve a given problem.
Chapter 6 is devoted to Characters and Strings. These present some difficulty in other languages
but, in Julia, we can work with them as seamlessly as we do numbers.
Chapter 7 tackles the nemesis of many would-be programmers—array processing. However,
this is significantly easier in Julia than other languages. Master array processing and you would
add to your repertoire a tool that will significantly increase the range of problems you can solve.
Chapter 8 is mainly about sorting and searching techniques. Sorting puts data in an order that
can be searched more quickly/easily, and makes it more palatable for human consumption.
Chapter 9 introduces structures. These enable us to group data in a form that can be manipulated
more easily an a unit.
Chapter 10 deals with two useful data structures—dictionaries and sets. These enable us to solve
certain kinds of problems more easily and conveniently than we can without them.
The first step in becoming a good programmer is learning the syntax rules of the programming
language. This is the easy part and many people mistakenly believe that this makes them a
programmer. They get carried away by the cosmetics— they learn the features of a language
without learning how to use them to solve problems. Of course, you must learn some features.
But it is far better to learn a few features and be able to use them to solve many problems rather
than learn many features but can’t use them to solve anything. For this reason, this book
emphasizes solving many problems from just a few features.
This book is intended for anyone who is learning programming for the first time, regardless of
age or institution. The presentation is based on our experience that many people (though not all)
have difficulty learning programming. To try and overcome this, we use an approach which
provides clear examples, detailed explanations of very basic concepts and numerous interesting
problems (not just artificial exercises whose only purpose is to illustrate some language feature).
While computer programming is essentially a mental activity and you can learn a fair amount
of programming from just reading the book, it is important that you “get your hands dirty” by
writing and running programs. One of life’s thrills is to write your first program and get it to run
successfully on a computer. Don’t miss out on it.
But do not stop there. The only way to learn programming well is to write programs to solve
new problems. The end-of-chapter exercises are a very rich source of problems, a result of the
author’s more than 40 years in the teaching of programming.
Thank you for taking the time to read this book. I hope your venture into programming is a
successful and enjoyable one.

Noel Kalicharan
Contents

Chapter 1 Elementary Concepts 1


1.1 Programs, Languages and Compilers 1
1.2 How a Computer Solves a Problem 3
1.2.1 Define the Problem 3
1.2.2 Analyze the Problem 3
1.2.3 Develop an Algorithm to Solve the Problem 4
1.2.3.1 Data and Variables 4
1.2.3.2 Example – Develop the Algorithm 5
1.2.4 Write the Program for the Algorithm 5
1.2.5 Test and Debug the Program 7
1.2.6 Document the Program 8
1.2.7 Maintain the Program 8
1.3 How a Computer Executes a Program 8
1.4 Data Types 9
1.5 Characters 10
1.6 Welcome to Julia Programming 11
1.7 A Program With Input 12
1.8 Writing Output with print/println 13
1.81 The Newline Character, \n (backslash n) 14
1.8.2 println() 15
1.8.3 Escape Sequences 15
1.9 Print the Value of a Variable 16
1.10 Comments 17
1.11 Julia Basics 18
1.11.1 The Julia Alphabet 18
1.11.2 Julia Tokens 18
1.11.3 Reserved Words 20
1.11.4 Identifiers 20
1.11.5 Some Naming Conventions 21
Exercises 1 22
Chapter 2 Numbers 23
2.1 Introduction 23
2.2 How to Read Integers 23
2.3 How to Read Floating-Point Numbers 25
2.4 Example - Average 26
2.5 Example - Square a Number 27
2.6 Example - Banking 28
2.7 Example - Football Tickets 31
2.8 Integers - Int 34
2.8.1 Integer Expressions 36
2.8.2 Precedence of Operators 37
2.8.3 Print an Integer Using a Field Width 38
2.9 Floating-point Numbers 40
2.9.1 Print Float64 and Float32 Variables 41
2.9.2 Assignment Between Float64 and Float32 42
2 9 3 Floating-point Expressions 43
ix
x Contents

2.9.4 Mixed Expressions 44


2.10 Assignment Operator 45
2.11 Updating Operators 45
2.12 trunc, ceil, floor, round 46
Exercises 2 51
Chapter 3 Selection Logic 53
3.1 Introduction 53
3.2 Boolean Expressions 53
3.2.1 AND, && 54
3.2.2 OR, || 55
3.2.3 NOT, ! 55
3.3 The type Bool 56
3.4 The if Statement 56
3.4.1 Find the Sum of Two Lengths 59
3.5 The if…else Statement 61
3.5.1 Calculate Pay 63
3.6 On Program Testing 64
3.7 Symbolic Constants 65
3.8 The if…elseif…else Statement 66
3.8.1 Print a Letter Grade 67
3.8.2 Classify a Triangle 68
Exercises 3 69
Chapter 4 The for and while Statements 72
4.1 Introduction 72
4.2 The for Statement 72
4.2.1 Multiplication Tables 75
4.2.2 Temperature Conversion 78
4.3 The Expressive Power of for 80
4.4 break/continue in for 82
4.5 Read Data From File 83
4.5.1 Keep a Count 85
4.5.2 Find Average 85
4.6 Find Largest Number 86
4.6.1 Find 'Largest' Word 88
4.6.2 Find Longest Word 89
4.6.3 Find Smallest Number 89
4.7 Nested for Statement 90
4.8 Read Data From File, Cont'd 92
4.9 The while Statement 95
4.9.1 Sum of Numbers (Prompt) 97
4.9.2 Sum, Count, Average (Prompt) 98
4.9.3 Greatest Common Divisor 99
4.10 Send Output to a File 100
4.11 Payroll 101
4.12 break/continue in while 104
Exercises 4 106

Chapter 5 Functions 109


5.1 Introduction 109
5.2 Function Basics 110
Contents xi

5.2.1 How an Argument Is Passed to a Function 113


5.3 Function - Examples 114
5.3.1 How to Swap Two Variables 114
5.3.2 Yesterday, Today and Tomorrow 115
5.3.3 GCD, Greatest Common Divisor 116
5.3.4 Using GCD to Find LCM 118
5.3.5 Factorial and Big Integers 118
5.3.6 Combinations 121
5.3.7 Calculate Pay 123
5.3.8 Sum of Exact Divisors 123
5.3.9 Perfect, Abundant or Deficient 124
5.3.10 Letter Position in Alphabet 125
5.4 Introduction to Recursion 126
5.4.1 GCD, Greatest Common Divisor 128
5.4.2 Fibonacci Numbers 128
5.4.3 Decimal to Binary 129
5.4.4 Towers of Hanoi 130
5.4.5 The Power Function 132
5.4.6 Find Path Through Maze 133
Exercises 5 137
Chapter 6 Characters & Strings 140
6.1 Character Sets 140
6.2 Character Constants and Values 141
6.3 The Type Char 142
6.4 Some Char Functions 143
6.4.1 Uppercase To/From Lowercase 144
6.5 Read and Print Characters 146
6.6 Count Space Characters 148
6.7 Compare Characters 149
6.8 Echo Input, Number Lines 150
6.9 Convert Digit Characters to Integer 151
6.10 String Basics 154
6.11 Compare Strings 156
6.12 Index Into a String 157
6.13 Example - Sum of Distances 159
6.14 Concatenation 161
6.15 Example - Get Words From Random Data 162
6.16 Example - Palindrome 164
6.17 A Flexible getString Function 166
6.18 Example - Geography Quiz Program 167
6.19 Other String Functions 169
6.19.1 findfirst 170
6.19.2 findlast 171
6.19.3 findnext 171
6.19.4 findprev 173
6.19.5 occursin 174
6.20 Array of Characters 174
6.21 For the Curious Reader 176
Exercises 6 180
xii Contents

Chapter 7 Arrays 181


7.1 Introduction 181
7.2 Simple vs Array Variable 182
7.3 Array Declaration 182
7.4 Store Values in an Array 186
7.5 Average and Differences from Average 190
7.6 Letter Frequency 191
7.7 Array as Argument to a Function 194
7.8 Name of Day Revisited 194
7.9 Find Largest, Smallest in Array 195
7.9.1 min, max, minimum, maximum 197
7.10 A Voting Problem 198
7.10.1 How to Handle Any Number of Candidates 202
7.10.2 How to Sort the Results 202
Exercises 7 205
Chapter 8 Searching, Sorting and Merging 207
8.1 Sequential Search 207
8.2 Selection Sort 209
8.2.1 Analysis of Selection Sort 211
8.3 Insertion Sort 212
8.3.1 Analysis of Insertion Sort 216
8.3.2 Sort Unlimited Data 216
8.4 Sort Parallel Arrays 217
8.5 Binary Search 219
8.6 Word Frequency Count 221
8.7 Merge Sorted Lists 224
Exercises 8 228
Chapter 9 Structures 230
9.1 The Need for Structures 230
9.2 How to Write a struct Declaration 231
9.2.1 Pass struct as Argument to a Function 232
9.3 Array of Structures 234
9.3.1 Sort struct Array 236
9.4 Nested Structures 238
9.5 Fractions 239
9.5.1 Manipulate Fractions 240
9.5.2 Rational Numbers 241
9.6 Voting Problem Revisited 243
9.6.1 On using isless in sort 247
Exercises 9 250
Contents xiii

Chapter 10 Dictionaries & Sets 252


10.1 Dictionaries 252
10.1.1 Letter-Frequency 254
10.1.2 Dict Functions - haskey, in, delete! 256
10.2 Sets 257
10.2.1 Set Operations 258
10.2.2 Find All Unique Words 263
10.3 Thesaurus 264
10.4 Scrabble 267
Exercises 10 277

Appendix A Install Julia/Atom/Juno 279

Index 286
CHAPTER 1

Elementary Concepts

In this chapter, we will explain the following:


 How a computer solves a problem
 The various stages in the development of a computer program: from problem
definition to finished program
 How a computer executes a program
 What is a data type and its fundamental role in writing a program
 The role of characters—the basic building blocks of all programs
 The concepts of constants and variables
 The distinction between syntax and logic errors
 How to produce output in Julia using print/println statements
 What is an escape sequence
 How descriptive or explanatory comments can be included in your program
 What is an assignment statement and how to write one in Julia

1.1 Programs, Languages and Compilers


We are all familiar with the computer’s ability to perform a wide variety of tasks. For instance,
we can use it to play games, write a letter or a book, perform accounting functions for a
company, learn a foreign language, listen to music on a CD, send a fax or search for information
on the Internet. How is this possible, all on the same machine? The answer lies with
programming—the creation of a sequence of instructions which the computer can perform (we
say “execute”) to accomplish each task. This sequence of instructions is called a program. Each
task requires a different program:
 To play a game, we need a game-playing program.
 To write a letter or a book, we need a word processing program.
 To do accounts, we need an accounting program.
 To learn Spanish, we need a program that teaches Spanish.
 To communicate with others around the world, we need a program like WhatsApp.
 To create/play karaoke music, we need an appropriate karaoke program.
 To use the Internet, we need a program called a Web browser.
For every task we want to perform, we need an appropriate program. And in order for the
computer to run a program, the program must be stored (we sometimes say loaded) in the
computer’s memory.

© The Author(s), under exclusive license to Springer Nature Switzerland AG 2021 1


N. Kalicharan, Julia - Bit by Bit, Undergraduate Topics in Computer Science,
https://doi.org/10.1007/978-3-030-73936-2_1
2 1 Elementary Concepts

But what is the nature of a program? First, we need to know that computers are built to execute
instructions written in what is called machine language. In machine language, everything is
expressed in terms of the binary number system—1s and 0s. Each computer has its own machine
language and the computer can execute instructions written in that language only.
The instructions themselves are very simple, for example, add or subtract two numbers, compare
one number with another or copy a number from one place to another. How, then, can the
computer perform such a wide variety of tasks, solving such a wide variety of problems, with
such simple instructions?
The answer is that no matter how complex an activity may seem, it can usually be broken down
into a series of simple steps. It is the ability to analyze a complex problem and express its
solution in terms of simple computer instructions that is one of the hallmarks of a good
programmer.
Machine language is considered a low-level programming language. In the early days of
computing (1940s and 50s) programmers had to write programs in machine language, that is,
express all their instructions using 1s and 0s.
To make life a little easier for them, assembly language was developed. This was closely related
to machine language but it allowed the programmer to use mnemonic instruction codes (such as
ADD and names for storage locations (such as sum) rather than strings of binary digits (bits). For
instance, a programmer could refer to a number by sum rather than have to remember that the
number was stored in memory location 1000011101101011.
A program called an assembler is used to convert an assembly language program into machine
language. Still, programming this way had several drawbacks:
 It was very tedious and error prone.
 It forced the programmer to think in terms of the machine rather than in terms of his
problem.
 A program written in the machine language of one computer could not be run on a
computer with a different machine language. Changing your computer could mean
having to rewrite all your programs.
To overcome these problems, high-level or problem-oriented languages were developed in the
late 1950s and 60s. The most popular of these were FORTRAN (FORmula TRANslation) and
COBOL (COmmon Business-Oriented Language). FORTRAN was designed for solving
scientific and engineering problems which involved a great deal of numerical computation.
COBOL was designed to solve the data-processing problems of the business community.
The idea was to allow the programmer to think about a problem in terms familiar to him and
relevant to the problem rather than have to worry about the machine. So, for instance, if he
wanted to know the larger of two quantities, A and B, he could write
IF A IS GREATER THAN B THEN BIGGER = A ELSE BIGGER = B
rather than have to fiddle with several machine or assembly language instructions to get the
same result. Thus high-level languages enabled the programmer to concentrate on solving the
problem at hand, without the added burden of worrying about the idiosyncrasies of a particular
machine.
However, the computer still could execute instructions written in machine language only . A
program called a compiler is used to translate a program written in a high-level language to
machine language. (And, just so you know, there are different kinds of compilers.)
We speak of a FORTRAN compiler or a C compiler for translating FORTRAN and C programs,
respectively. But that’s not the whole story. Since each computer has its own machine language,
Another Random Scribd Document
with Unrelated Content
The Project Gutenberg eBook of Mastro da
Ballo
This ebook is for the use of anyone anywhere in the United States
and most other parts of the world at no cost and with almost no
restrictions whatsoever. You may copy it, give it away or re-use it
under the terms of the Project Gutenberg License included with this
ebook or online at www.gutenberg.org. If you are not located in the
United States, you will have to check the laws of the country where
you are located before using this eBook.

Title: Mastro da Ballo

Author: Ercole Santucci Perugino

Release date: January 10, 2018 [eBook #56352]

Language: Italian

Credits: Produced by Greg Lindahl, Barbara Magni and the Online


Distributed Proofreading Team at http://www.pgdp.net

*** START OF THE PROJECT GUTENBERG EBOOK MASTRO DA


BALLO ***
Nota del Trascrittore

Nel testo si fa riferimento a figure che dovevano


illustrare i vari passi di danza: le illustrazioni non sono
però presenti nel manoscritto di cui si presenta qui la
trascrizione, sostituite da semplici riquadri vuoti, che si è
scelto di omettere. Tutte le abbreviazioni sono state
sciolte e poste tra [parentesi].
MASTRO DA BALLO
Mastro da Ballo di Ercole Santucci
Perugino; diuiso in Tre Trattati;
c[on] il quale ogni scolaro,
potrà facilissimamente
imparare ogni sorte di Ballo,
senza altra scola
Con due Tauole; una in Principio del libro,
di tutte le Regole, passeggi
Mut[an]ze, e Balletti; et una in
fine del Libro, delle figure
necessarie, [per] ueder
il modo c[he] li Cau.ri
e Dame deuono tenere,
in muouere la
uita in ciascheduna
Regola, Mutanza,
Passeggi, e
Balletti

In Perugia A.D. M.D.C.XIV.


Tauola del Primo Trattato.

Alzata de piedi. 23
Balzetti inanzi. 52
Balzetti indietro. 53
Balzetti à Piedi pari [per] fi[an]co. 47
Balzetti à Piedi pari inanzi. 49
Balzetti à Piedi pari indietro. 50
Balzetti in Volta. 51
Battuta de Piedi. 24
Cadenza Battuta. 76
Cadenza finta. 76
Cadenza ordinaria. 70
Cadenza à Piedi pari in Prospettiua. 77
Cadenza Ritornata. 74
Cadenza ritornata Strisciata. 75
Cad[en]za Spaccata. 72
Cadenza Strisciata. 73
Cadenza di Zoppetto. 71
Calcagnio di Piede ordinario. 83
Calcagnio di Piede Strisciato Caminato. 83
Cambiata de Piedi. 26
Cambiata de Piedi Strisciata. 27
Caminare, e Portar la Vita. 144
Caminata Strisciata in dietro. 65
Caminata Strisciata [per] fianco. 60
Caminata Strisciata inanzi. 64
Campanella ordinaria. 120
Campanella in Volta. 120
Campanella Strisciata in Volta. 120
Capriola Terza. 90
Capriola Quarta. 91
Capriola Quinta. 92
Capriola Sesta. 92
Capriola Terza c[on] un Piede in Aria. 92
Capriola Quarta c[on] un Piede in Aria. 93
Capriola Quinta c[on] un Piede in Aria. 94
Capriola Quarta sul Collo del Piede. 95
Capriola sul Collo del Piede, et Intrecciata. 96
Capriola Intrecciata, ò uero Incrociata. 97
Capriola Intrecciata in Volta. 98
Capriola Intrecciata Doppia. 98
Capriola Intrecciata di Cadenza. 98
Cauar del Cappello. 148
Continenza Graue. 142
Continenza Semigraue. 143
Continenza Breue. 143
Continenza Semibreue. 143
Corintho. 125
Dama, modo che deue tenere à Inuitare il Cau.ro
à Ballare;
Come deuono far la Reuer[en]za, e come si
deuono lic[en]ziare doppo il Ballo. 155
Dattilo. 123
Destice. 126
Doppio Breue. 138
Doppio Graue. 138
Doppio Semigraue. 139
Doppio Pontato. 139
Doppio Fr[an]zese. 139
Finta Inanzi. 63
Finta Strisciata Inanzi. 63
Finta Indietro. 63
Finta Strisciata Indietro. 64
Fioretto Ordinario. 126
Fioretto di Cadenza Ritornata. 126
Fioretto Battuto. 129
Fioretto Battuto Doppio. 130
Fioretto Fianchegiato. 128
Fioretto [per] Fianco. 128
Fioretto Graue. 127
Fioretto Strisciato. 130
Fioretto Tagliato. 129
Fioretto in Volta. 129
Ganzo in Prospettiua. 66
Ganzo Rouerso. 67
Ganzo in Volta. 66
Girata Battuta. 145
Girata de Ginocchio. 114
Girata Incrociata. 115
Groppo. 123
Incrociata di Gamba inanzi. 67
Incrociata di Punta Strisciata. 79
Incrociata di Gamba indietro. 57
Inuito della Dama. 153
Meza Capriola di Cadenza Ordinaria. 99
Meza Capriola di Cadenza Ritornata. 100
Meza Capriola sul Collo del Piede. 102
Meza Capriola [per] fianco. 100
Meza Capriola di fioretto. 100
Meza Capriola in dietro. 101
Meza Capriola di Passo in Aria. 99
Meza Capriola Recacciata in Prospettiua & in
Volta. 102
Meze Capriole Tagliate in Quinto. 103
Meza Reuerenza. 151
Passi in Aere. 41
Passo in Aere Cromatico. 42
Passi in Aere Strisciati. 43
Passo Costatetto. 40
Passi Cromatici. 31
Passi [per] fianco. 34
Passi finti Indietro. 35
Passi Finti Strisciati Indietro. 36
Passo Finto in[an]zi e dello Strisciato. 40
Passi Incrociati. 37
Passi Incrociati Strisciati. 38
Passi Indietro. 31
Passi in Volta. 32
Passi Longhi. 30
Passi Minimi. 30
Passi Naturali. 28
Passi à Piedi Pari. 60
Passo Puntato Breue. 140
Passo Puntato Graue. 140
Passo Puntato Minimo. 141
Passo Puntato Semibreue. 141
Passo Puntato Semigraue. 140
Passi Semigraui. 29
Passi Semiminimi. 30
Passi Strisciati Indietro. 33
Passi Strisciati Inuolta. 34
Passi Strisciati Inanzi. 38
Passo Trango. 39
Portar Cappa, e Spada in Balletti Graui. 145
Portar Cappa, e Spada, nella Gagliarda, et altri
Balletti Alterati. 146
Punta e Calcagnio Ordinario. 121
Punta, e Calcagnio di Zoppetto. 122
Punta, e Calcagnio Strisciata, e Battuta. 122
Punta, e Calcagnio Strisciata Caminata. 122
Punta dè Piedi Ordinaria in[an]zi, et indietro. 82
Punta dè Piedi Strisciata Caminata. 82
Recacciata [per] fianco. 117
Recacciata in Prospettiua. 116
Recacciata in Volta. 117
Represa [per] fianco. 118
Represa Inanzi. 117
Represa Indietro. 119
Represa Strisciata Inanzi [per] fi[an]co, e
Indietro. 119
Reuer[en]za Breue. 150
Reuerenza Caminata. 151
Reuerenza Graue alla Spagniuola. 149
Reuerenza Semibreue. 151
Reuerenza Semigraue. 150
Reuerenza Spezzata. 152
Salto tondo ordinario in Aria. 104
Salto Tondo due ò trè uolte in Aria. 105
Salto Tondo Incrociato. 105
Salto Tondo Rouerso. 107
Salto Tondo Spacchato. 106
Salto Tondo Spacchato Incrociato Recacciato. 107
Salto del fiocco. 108
Salto del fiocco Incrociato Scorso. 111
Salto del fiocco Tondo Incrociato. 110
Salto del fiocco Mezo Rouerso. 111
Salto del fiocco Rouerso. 112
Salto del fiocco Scorso. 109
Scrociata di Calcagnio Strisciata Ordinaria. 81
Scrociata di Punta Strisciata. 80
Schicciata di Calcagnio. 62
Schicciata di Punta. 60
Seguito Battuto. 133
Seguito Battuto Doppio. 133
Seguito Battuto Spezzato Strisciato. 137
Seguito Doppio. 132
Seguito finto. 131
Seguito franzese Alterato. 135
Seguito franzese Ordinario. 135
Seguito Ordinario. 131
Seguito Scorso. 134
Seguito Semidoppio. 131
Seguito Soffice. 138
Seguito Spezzato finto. 136
Seguito Spezzato Indietro. 137
Seguito Spezzato Ordinario. 136
Seguito Spezzato Puntato. 136
Seguito Spezzato Strisciato. 137
Seguito Trangato. 134
Seguito Trangato Doppio. 134
Sincopa. 124
Soprapiede Ordinario. 77
Soprapiede Strisciato. 78
Sottopiede. 43
Sottopiede [per] fianco. 44
Sottopiede à Piedi Pari [per] le Dame. 45
Sottopiede Strisciato. 44
Spacchata Doppia. 85
Spaccata [per] fianco. 85
Spaccata Inanzi. 83
Spaccata Incrociata Inanzi. 85
Spaccata Incrociata [per] fianco. 86
Spaccata Indietro. 84
Spaccata Indietro in Volta. 87
Spaccata Incrociata in Volta. 88
Spaccata in Prospettiua. 87
Spaccata in Prospettiua indietro. 90
Spaccata Ricacciata. 89
Spondeo. 124
Strisci [per] fianco. 53
Strisci in Volta. 54
Trabocchetto Breue. 45
Trabocchetto Minimo anco [per] le Dame. 46
Trabocchetto Semibreue. 46
Trabocchetto Strisciato. 47
Trillo Doppio. 70
Trillo Inanzi et Indietro. 69
Trillo de Piedi [per] fianco. 68
Trito Minuto. 124
Zoppetto di Calcagnio. 59
Zoppetto [per] fianco. 54
Zoppetto finto inanzi. 55
Zoppetto finto indietro, Tornato inanzi. 56
Zoppetto indietro. 56
Zoppetto Incrociato indietro. 57
Zoppetto Ordinario. 54
Zoppetto di Punta de Piedi. 58
Zoppetto Strisciato. 55
Zurlo Pirlato, ò Girata. 113

Tauola del Secondo Trattato.


Cinque Passi. 157
Passeggi cominciati con Balzetti. 163
Passeggi cominciati con Cad[en]za ritornata. 177
Passeggi cominciati con C[am]biata di Piede. 220
Passeggi cominciati con C[am]panella Ord.ria. 203
Passeggi cominciati con C[am]panella in Volta. 207
Passeggi cominciati con Capriola Terza di Piede
in Aria. 282
Passeggi cominciati con Capriola Terza. 288
Passeggi cominciati con Capriola Quarta di Piede
in Aria. 292
Passeggi cominciati, con Capriola Quarta. 297
Passeggi cominciati con Capriola Intrecciata. 302
Passeggi cominciati con Fioretti tagliati. 272
Passeggi cominciati con Intrecciata di G[am]ba. 252
Passeggi cominciati con il Ganzo Ord.rio in
Prospettiua. 257
Passeggi cominciati con Meza Capriola di
Cadenza Ritornata. 277
Passeggi cominciati con Passo Finto in[an]zi. 198
Passeggi cominciati con Passo Incrociato. 246
Passeggi cominciati con P[un]ta e Calcag.o
ord.rio. 211
Passeggi cominciati con P[un]ta e Calc.o di
Zoppetto. 256
Passeggi cominciati con Riprese. 230
Passeggi cominciati con un Sotto Piede. 172
Passeggi cominciati con Sottopiede e Soprapiede
Cromatici. 187
Passeggi cominciati con Sotto Piede e Meza
Capriola di Passo in Aria. 267
Passeggi cominciati con Spacchata Inanzi. 262
Passeggi cominciati con Recacciata. 225
Passeggi cominciati con Striscio. 241
Passeggi cominciati con Trabocchetto. 235
Passeggi cominciati con Zoppetto. 182
Passeggi cominciati con Zoppetti Incrociati
Indietro. 193
Passeggi Cromatici con un Fioretto. 167

Tauola del Terzo Trattato

Allegrezza d'Amore di Oratio Martir Romano,


moderata dall'Autore. 466
Mut[an]ze fatte in Dui Tempi di Gagliarda. 306
Mut[an]ze fatte in Trè Tempi di Gagliarda. 315
Mut[an]ze fatte in Quattro Tempi di Gagliarda. 329
Mut[an]ze fatte in Cinque Tempi di Gagliarda. 360
Mut[an]ze fatte in Sei Tempi di Gagliarda. 369
Mut[an]ze fatte in Sette Tempi di Gagliarda. 376
Mut[an]ze fatte in Otto Tempi di Gagliarda. 380
Mut[an]ze [per] le Dame fatte in dui Tempi di
Gagliarda. 389
Mut[an]ze [per] le Dame fatte in Trè Tempi di
Gagliarda. 390
Mut[an]ze fatte [per] le Dame in Quattro Tempi
di Gagliarda. 393
Mut[an]ze di Canario [per] le Dame. 419
Balletto fatto c[on]forme alla Regola di Paulo
Arnates Romano c[on] le Mut[an]ze
dell'Autore, [per] Dame e Cau.ri. 398
Spagnioletta di Aless.ro Barbetta da Bolognia. 423
Barriera di Oratio Martir Romano c[on] la
Mutanza di Gagliarda, dell'Autore. 428
Canario. 398
Cinque Passi [per] le Dame. 385
Contrapasso in Sesto di Lucio C[om]passo
Romano. 451
Gagliarda di Spagnia, di Fabritio Caroso da
Sermoneta. 455
Galleria d'Amore, di Stefano del M[an]cino da
Bolognia, c[on] la Gagliarda, e Canario
dell'Autore. 462
Pauaniglia dell'Autore. 440
Pauaniglia di Lodouico Padoello da Padoua;
Moderata dall'Autore alla Romana. 433
Alta Regina di Fabritio Caroso da Sermoneta
Moderata dall'Autore. 426

Il Fine della Tauola.


Mastro da Ballo di Ercole Santucci Perugino, diuiso in
Tre Trattati.

Nel Primo Trattato, si mostrano duecento quatordeci Regole [per]


Principianti, che uorr[an]no imparare à Ballare.
Nel Secondo Trattato, si mostrano Trenta Regole; di Dodeci Passeggi
[per] ciascheduna Regola.
Nel Terzo Trattato, si mostrano Settantuna Mutanze, fatte in più
Tempi di Gagliarda.
Dodeci Regole di Cinque Passi [per] le Dame.
Dodeci Mut[an]ze fatte in più tempi di Gagliarda [per] le Dame.
Sedeci Mutanze di Canario [per] Cau.ri e Dame.
Sei Mutanze di Canario [per] le Dame.
Varie Sorti di altri Balletti [per] Cau.ri e Dame.
Trattato P.o

Regola Prima; del'Alzata de Piedi

Perche il primo moto del Ballare; è l'alzar de piedi; hò però giudicato


bene notarlo in questa prima Regola, benche n[on] necessario; Per
far dunque detta alzata de piedi; Trouandosi il sinistro in dietro, lungi
dal destro mezo palmo in circa: come si uede nella figura: bisogna
alzar da terra d.o sinistro, et inalborarlo inanzi al destro mezo palmo
in circa, e potrà anco inalborarsi d.o sinistro [per] fianco distante dal
destro un palmo, e poco più e potrà anco farsi col destro, quel c[he]
si è detto del sinistro trouandosi in dietro, et hà preso il nome dal
alzar de piedi da terra.

Regola 2.a de Battuta de Piedi

Hauendo il pie Sinistro in dietro in passo naturale come si uede nella


figura; bisogna alzarlo da terra, e spingerlo inanzi al paro del destro,
distante un piè dal altro quattro dita in circa, e batterlo poi in terra;
e cosi potrà farsi, trouandosi con d.o sinistro in[an]zi, et al paro, et
anco [per] contrario: auertendo, che quando dico cosi, (potrà farsi
[per] contrario) intendo, che quel, che s'è fatto, ritrouandosi col
sinistro in dietro, si può anco fare trouandosi in dietro col destro; e si
chiama cosi, perche si battano i piedi in terra.
Regola 3.a de Cambiata de Piedi

Stando il piè sinistro in dietro in passo naturale: come si uede nella


figura: bisogna saltar in sù [per] spatio di quattro dita, e nel istesso
tempo spinger inanzi il sinistro, e tirar in dietro il destro, e cader poi
leggiermente in terra sù la punta de piedi, e cosi potrà farsi [per]
contrario; et hà questo nome, [per]che un piede cambia il suo luoco
con quello dell'altro piede.

Regola 4.a di Cambiata de Piedi strisciata

Per far la Cambiata de piedi strisciata: Trouandosi col piè sinistro in


dietro in passo naturale: Come si uede nella figura; farà quanto s'è
detto nella terza Regola, auertendo, che nel saltar in sù, non bisogna
altrim[enti] leuarsi da terra ma alzar un poco la uita e nel spinger
inanzi il sinistro, e tirar in dietro il destro, strisciarà per terra le punte
de Piedi, e fermarassi, poi col piè sinistro inanzi, in passo naturale, e
cosi potrà farsi [per] contrario; e si chiama cosi [per]che nel cambiar
de piedi si strisciano le punte de piedi [per] terra.

Regola v.a de Passi Naturali

A far questo Passo Naturale, trouandoti col piè sinistro in dietro,


lontano un piede dall'altro mezo palmo in circa, con la punta del
sinistro un deto distante dal calcagnio del destro, lo spingerài inanzi
al destro mezo palmo in circa, e lo posarài in terra; e cosi potrài fare
[per] contrario, e auertir, che con il moto del piede, si deue anco
accompagnar la uita; e si chiama cosi perche ce lo insegna la
Natura.
Regola vi de Passi Semigraui

Volendo fare il Passo Semigraue: Trouandosi col piè sinistro in dietro


in passo naturale, come si uede nella figura, nel tempo d'una battuta
ternaria perfetta di musica, leuarà da terra d.o sinistro, e senza
posarlo; in tempo d'un altra battuta simile lo portarà al par del
destro in un altra battuta, lo inalborarà inanzi à d.o destro, et in
tempo d'un altra battuta lo portarà in terra in passo naturale, e cosi
potrà farsi [per] contrario; e si chiama cosi, [per]che si fà nel tempo
di quattro battute.

Regola 7.ma de Passi longhi

À far il Passo longo; trouandosi il sinistro in dietro in passo naturale;


come si uede nella figura, nel tempo d'una battuta, lo spingerà
inanzi, et in tempo d'un altra battuta ternaria perfetta, lo inalborarà
inanzi al destro, e nel istesso tempo lo posarà in terra, in passo
naturale; e si chiama cosi, perche si fà in tempo di due battute, e lo
potrà anco fare [per] contrario.

Regola 8.ua de Passi Minimi

Per far il Passo Minimo farà quanto s'è detto nella prossima Regola
sud.a partendolo [per] metà, cioè nel tempo d'una battuta binaria, ò
ternaria perfetta, e spartirla in due meze battute, e si chiama cosi,
perche si fà nell tempo d'una Minima e lo potrà anco fare [per]
contrario.

Regola 9.na de Passi Semiminimi

You might also like