Selasa, 31 Maret 2020

SMALL Basic: Learn to read array and multi array

Hello Small Basic programmer, welcome.

In this tutorial we will learned about reading single row multi colomn array and multi row and multi colomn array small basic.

We will read this not line per line, but as a whole array.

This is useful to know when you need to do more deep about your work. Especially when you work with folder and array.

So, in this tutorial we will learned about:
1. Reading single row multi colomn (SRMC) array
2. Reading multi row and multi colomn (MRMC) array

You know both of them is different. So, lets go.

1. Reading single row and multi colomn (SRMC) array
This is the code:
i[0] = "s"
i[1] = "a"
i[2] = "y"
i[3] = "b"
TextWindow.WriteLine(i)

The output will be:
Figure 1


2. Reading multi row and multi colomn (MRMC) array
This is the code:
i[0][0] = "s"
i[0][1] = "a"
i[1][0] = "y"
i[1][1] = "b"
TextWindow.WriteLine(i)

The output will be:
Figure 2

So, you can see, both of the output are different.

The ';' sign is for seperating colomn (like figure 1 explained) and also seperating row (like figure 2 explained).

So, the ';' sign is used both as in single row multi colomn (SRMC) array and multi row multi colomn (MRMC) array.

And, 'index\=<value>\' is used only for multi row multi colomn (MRMC) array and used only for seperating index colomn and value.

Ok, thats it. Thanks for reading.

DOTA 2: Guide

There are 4 ways of earn money:
1. Killing line creeps
2. Killing jungle creeps
3. Killing enemy heroes
4. Killing Roshan

You need to learn survability technique here:


1. Killing line creeps

2. Killing jungle creeps
2.1 Killing jungle creeps low level ally's jungle
2.2 Killing jungle creeps low level enemy's jungle
2.3 Killing jungle creeps medium level ally's jungle
2.4 Killing jungle creeps medium level enemy's jungle

SMALL Basic: Nested-loop and non-nested loop

Hi, SMALL Basic programmer, welcome.

In this tutorial, we will learned something, that is nested loop and non-nested loop.

You know there are 3 components to build loop:
1. For..
2. While..
3. If.. Goto..

And there are 2 types of loops based on mechanics:
1. Nested-loop
2. Non-nested loop

So, in this tutorial we will discussed nested-loop and non-nested loop.

Nested loop we will be with 2 level loops (a.k.a 1 inner loop and 1 outer loop).

Non-nested loop we will be using 1 level loop.

1. Nested-loop
1.1 Nested-loop with For.. Loop
Making or creating nested loop with For.. Loop is very easy.

You only need to define number of loops for the inner loops, and for the outer loops.

For example:
For i = 0 To 1
  For j = 0 To 10
    TextWindow.WriteLine(i + " ," + j)
  EndFor
EndFor


1.2 Nested-loop with While.. Loop
Making or creating nested loop is at first looks medium difficulty. But not, when you are an expert.

While i < 100
  While j < 100
    TextWindow.WriteLine(i +", " + j)
    j = j + 1
  EndWhile
  i = i + 1
  j = 0
EndWhile

1.3 Nested-loop with If.. Goto.. Loop
Creating nested-loop with If.. Goto.. and creating non-nested loop with If.. Goto.. is different.

Creating nested-loop with If.. Goto.. loop is a little harder., because we need to iterator variable that need to be incremented.

For example below:

i = 0
j = 0
Goto start
up_i:
i = i + 1

up_j:
start:
If j < 10 Then
  TextWindow.WriteLine(i + ", " + j)
  j = j + 1
  If j < 10 Then
    Goto up_j
  Else
    Goto up_i
  EndIf
  Program.Delay(1000)
EndIf
 

2. Non-nested loop
2.1 Non-nested loop with For.. Loop


2.2 Non-nested loop with While.. Loop

2.3 Non-nested loop If.. Goto.. Loop

Senin, 30 Maret 2020

SMALL BASIC: Forever and not-forever Loop

Hello, SMALL Basic programmer, welcome.

Beside, nested loop and not-nested loop, loop can also be defined into forever loop and not-forever loop.

So, based on the mechanic, loops can also divided into:
1. Nested loop
2. Not-nested loop

And,  types of loop based on lifetime:
1. Forever
2. Not-forever or limited

So, in this tutorial we will learned with not-nested loop, forever loop and not-nested loop, not-forever loop.

You know, there are 2 types of loop based on lifetime. Forever loop and not-forever loop. And, there are 3 types of loop maker: For, while and if.. goto..

3 Loop maker:
1. For
2. While
3. If.. Goto..

2 Types of loop based on lifetime:
1. Forever
2. Not-forever or limited

Both can be made with loop maker.

For example:
1. Forever
1.1 Forever loop with For loop
You can make forever loop using for by using a very,very big number. So it looks like forever because of length of the number, but it is not.

for i = 0 To 9999999999999999999999999
  TextWindow.WriteLine(i)
EndFor

1.2. Forever loop with While loop
You can also make forever loop by using while loop by using a very, very big number, so it also looks like forever because of length of the number, but it is not.

While i < 999999999999999999999999999
  TextWindow.WriteLine(i)
  i = i + 1
EndWhile

1.3. Forever loop with If.. Goto.. Loop
This the last type and actually it is the best kind of making forever loop.

up:
TextWindow.WriteLine(i)
i = i + 1
Goto up

2. Not-forever
2.1 Not-forever loop with For loop
Creating not-forever loop with for loop is easy, you just need to define the number not big enough as the limit.
Example:

For i = 0 To 100
  TextWindow.WriteLine(i)
EndFor

2.2 Not-forever loop with While loop
Creating not-forever loop with While loop is easy, the same as For loop, you just need to define the number that is not big enough as the limit.

For example like below:
while i < 100
  TextWindow.WriteLine(i)
  i = i + 1
EndWhile

2.3 Not-forever with If.. Goto.. Loop
Okay, to make not-forever loop or limited loop with If.. Goto.. Loop is quite difficult. But it is okay, you will got it.

In this, if.. goto.. loop type you will need the help of iterator variable (in this case i variable), same as with While loop example and off course, you need the help of a label to jump to.

So, iterator variable, the increments expression for iterator, goto expression and a label.

For example

up:
TextWindow.WriteLine(i)
If i < 100 Then
  i = i + 1
  Goto up
EndIf

SMALL BASIC: Shifting partly array's element

Hi, welcome, Small Basic Programmer, welcome.

In this tutorial we will learn about shifting partly array's element and remove the trail. This often needed in some cases of programming.

For instance, we have array:
ourarray[10]

For i = 0 To 10
  ourarray[i] = i
EndFor

TextWindow.WriteLine("Enter the start of shifted components of the main array: ")
start = textwindow.Read()
For i = start  To 10
  ourarray[i-1] = ourarray[i]
EndFor


oa_l = Array.GetItemCount(ourarray)
For i = 0 To oa_l - 1
  TextWindow.Write(ourarray[i])
  TextWindow.Write(",")
  Program.Delay(1000)
EndFor


  

Computer Security

1. Non-socket program
2. Socket program

1. Days before firewall
Everyone can easily create socket user program then the user program contacted someone else on the internet to say:
1. status of the program; alive or not alive.
2. Give or send the contain of a file.


SMALL Basic: Type of code's execution speed

Hello, SMALL Basic programmer, welcome.

In this tutorial, I will show you how two types of code's execution speed based on my experience.
1. Fast execution time, hard to write code, compact code, short code.
2. Slower execution time, easier to write code, divided or non-compact code, long code.

You can combine compact code and non-compact code on your programs.

Thanks for reading.