How to create an algorithm: Difference between revisions

Jump to navigation Jump to search
Line 70: Line 70:


| bgcolor="#eeeeff" width="50%" align="left" | You type:
| bgcolor="#eeeeff" width="50%" align="left" | You type:
'''<nowiki>{{Family tree/start}}</nowiki><br><nowiki>{{Family tree | | | | A01 | | | |A01= Box 1 in Row 1}}</nowiki><br><nowiki>{{Family tree | | | | |!| | | | | }}</nowiki><br><nowiki>{{Family tree | | | | B01 | | | |B01= Box 2 in Row 2}}</nowiki><br><nowiki>{{Family tree/end}}</nowiki>'''
| bgcolor="#ddddff" width="50%" align="left" | You get:
{{Family tree/start}}
{{Family tree | | | | A01 | | | |A01= Box 1 in Row 1}}
{{Family tree | | | | |!| | | | | }}
{{Family tree | | | | B01 | | | |B01= Box 2 in Row 2}}
{{Family tree/end}}
|-


| bgcolor="#eeeeff" width="50%" align="left" | You type:
'''<nowiki>{{Family tree/start}}</nowiki><br><nowiki>{{Family tree | | | | A01 | | | |A01= Box 1 in Row 1}}</nowiki><br><nowiki>{{Family tree | | | | |!| | | | | }}</nowiki><br><nowiki>{{Family tree | | | | |!| | | | | }}</nowiki><br><nowiki>{{Family tree | | | | |!| | | | | }}</nowiki><br><nowiki>{{Family tree | | | | B01 | | | |B01= Box 2 in Row 2}}</nowiki><br><nowiki>{{Family tree/end}}</nowiki>'''
| bgcolor="#ddddff" width="50%" align="left" | You get:
| bgcolor="#ddddff" width="50%" align="left" | You get:
{{Family tree/start}}
{{Family tree | | | | A01 | | | |A01= Box 1 in Row 1}}
{{Family tree | | | | |!| | | | | }}
{{Family tree | | | | |!| | | | | }}
{{Family tree | | | | |!| | | | | }}
{{Family tree | | | | B01 | | | |B01= Box 2 in Row 2}}
{{Family tree/end}}
|-
|-


| bgcolor="#eeeeff" width="50%" align="left" | You type:
| bgcolor="#eeeeff" width="50%" align="left" | You type:


'''<nowiki>{{Family tree/start}}</nowiki><br><nowiki>{{Family tree | | | | A01 | | | |A01= Box 1 in Row 1}}</nowiki><br><nowiki>{{Family tree | | | | |:| | | | | }}</nowiki><br><nowiki>{{Family tree | | | | B01 | | | |B01= Box 2 in Row 2}}</nowiki><br><nowiki>{{Family tree/end}}</nowiki>'''
| bgcolor="#ddddff" width="50%" align="left" | You get:
| bgcolor="#ddddff" width="50%" align="left" | You get:
{{Family tree/start}}
{{Family tree | | | | A01 | | | |A01= Box 1 in Row 1}}
{{Family tree | | | | |:| | | | | }}
{{Family tree | | | | B01 | | | |B01= Box 2 in Row 2}}
{{Family tree/end}}
|-
|  bgcolor="#ddddff" style="border: solid 1px #aaaaff" colspan="2" align="left" | '''More'''
|-
|-


Line 83: Line 110:
| bgcolor="#ddddff" width="50%" align="left" | You get:
| bgcolor="#ddddff" width="50%" align="left" | You get:
|-
|-
| bgcolor="#eeeeff" width="50%" align="left" | You type:
| bgcolor="#ddddff" width="50%" align="left" | You get:
|-
| bgcolor="#eeeeff" width="50%" align="left" | You type:
| bgcolor="#ddddff" width="50%" align="left" | You get:
|-


|  bgcolor="#ddddff" style="border: solid 1px #aaaaff" colspan="2" align="left" | '''Putting it together: '''
|  bgcolor="#ddddff" style="border: solid 1px #aaaaff" colspan="2" align="left" | '''Putting it together: '''

Revision as of 00:53, 19 August 2013

Overview

An algorithm is a schematic drawing that helps organizing step by step approaches in a visually simplified way. An algorithm is formed by a set of boxes and lines that join them.

Create an Algorithm

Introduction

  • To begin an algorithm, you should start with the following code {{family tree/start}} and end it with {{family tree/end}}.
  • You can name an algorithm by starting with following: {{family tree/summary= Name of the algorithm}}
  • The algorithm consists of boxes that occupy virtual rows:
 
 
 
Box 1 in Row 1
 
 
 
 
 
 
 
 
 
Box 2 in Row 2
 
 
 
Box 3 in Row 3
 
 
 
 
 
 
Box 4 in Row 3



  • Each row is represented by the following where each | | represents a space.:

{{Family tree | | | | | | | | | }}


  • Each box is represented by the content that fills the space in | |, for example | A01 | will give:
 
A01
  • In order to link the boxes you need to use symbols. The basic symbols that you will most commonly use are the following:
    • ! will link two boxes placed vertically on top of each other
    • - will link two boxes placed horizontally next to each other
    • ^ will link bifurcate a line arising from a box into two branches.

Step By Step

Linking cells horizontally:
You type:
{{Family tree/start}}
{{Family tree | | | | A01 |-| A02 | |A01= Box 1 in Row 1| A02= Box in Row 1}}
{{Family tree/end}}
You get:
 
 
 
Box 1 in Row 1
 
Box in Row 1
 
 
You type:
{{Family tree/start}}
{{Family tree | | | | A01 |-|-|-| A02 | |A01= Box 1 in Row 1| A02= Box in Row 1}}
{{Family tree/end}}
You get:
 
 
 
Box 1 in Row 1
 
 
 
Box in Row 1
 
 
 
 
You type:
{{Family tree/start}}
{{Family tree | | | | A01 |~| A02 | |A01= Box 1 in Row 1| A02= Box in Row 1}}
{{Family tree/end}}
You get:
 
 
 
Box 1 in Row 1
 
Box in Row 1
 
 
You type:
{{Family tree/start}}
{{Family tree | | | | A01 |~|~|~| A02 | |A01= Box 1 in Row 1| A02= Box in Row 1}}
{{Family tree/end}}
You get:
 
 
 
Box 1 in Row 1
 
 
 
Box in Row 1
 
 
 
 
Linking cells vertically:
You type:
{{Family tree/start}}
{{Family tree | | | | A01 | | | |A01= Box 1 in Row 1}}
{{Family tree | | | | |!| | | | | }}
{{Family tree | | | | B01 | | | |B01= Box 2 in Row 2}}
{{Family tree/end}}
You get:
 
 
 
Box 1 in Row 1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Box 2 in Row 2
 
 
 
You type:
{{Family tree/start}}
{{Family tree | | | | A01 | | | |A01= Box 1 in Row 1}}
{{Family tree | | | | |!| | | | | }}
{{Family tree | | | | |!| | | | | }}
{{Family tree | | | | |!| | | | | }}
{{Family tree | | | | B01 | | | |B01= Box 2 in Row 2}}
{{Family tree/end}}
You get:
 
 
 
Box 1 in Row 1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Box 2 in Row 2
 
 
 
You type:
{{Family tree/start}}
{{Family tree | | | | A01 | | | |A01= Box 1 in Row 1}}
{{Family tree | | | | |:| | | | | }}
{{Family tree | | | | B01 | | | |B01= Box 2 in Row 2}}
{{Family tree/end}}
You get:
 
 
 
Box 1 in Row 1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Box 2 in Row 2
 
 
 
More
You type: You get:
You type: You get:
You type: You get:
Putting it together:
You type:
{{Family tree/start}}
{{Family tree | | | | A01 | | | |A01= Box 1 in Row 1}}
{{Family tree | | | | |!| | | | | }}
{{Family tree | | | | B01 | | | |B01= Box 2 in Row 2}}
{{Family tree | |,|-|-|^|-|-|.| | }}
{{Family tree | C01 | | | | C02 |C01= Box 3 in Row 3| C02= Box 4 in Row 4}}
{{Family tree/end}}
You get:
 
 
 
Box 1 in Row 1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Box 2 in Row 2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Box 3 in Row 3
 
 
 
Box 4 in Row 4