KanoOnline.com Forum

General => Science and Technology => Topic started by: _Waziri_ on November 10, 2004, 03:57:27 PM

Title: MAGIC SQUARE
Post by: _Waziri_ on November 10, 2004, 03:57:27 PM
My good ppl, the movers and shakers of IT world, the following program using Pascal Codes, Turbo Pascal 7.5, is an effort to get what we normally call Magic Square.

Magic square is something used by Mallamai aand sometimes Bokaye in Hausa land to derive numbers that when used effectively in Laya or Guru or even rubutun sha can provide cure to some ailments. The root knowledge they use in this derivative is known as Aufaqu in Arabic. Here is a pascal code written to derive the numbers using their methodology. Anubody using the program must enter an ODD number before the right numbers in the square appear.

Now my appeal to all these programming GURUS around here is to come an analyse the program and see how we can transform it into better stuff or atleast get it written in different programming codes like Java, C, C++ , Basic and what have you.

Am I am ready to answer questions about Pascal codes and the logic behind d program. Thanks


Program Magic;
{Ibraheem A. Waziri-Oct, 2004}
{}
{}
uses
   crt;
const
    ArraySize = 99;
type
   ArrayType = Array[1..ArraySize,1..ArraySize] of Integer;
var
   x: ArrayType;
   b,i,j,k : Integer;
Begin
   clrscr;
      write('Enter the number of rows and columns=  ');
      Readln(b);
   For i:=1 to b do
      For j:=1 to b do
         x[i,j]:= 0;
i:=1;
J:= (b + 1) div 2;
k:=0;
repeat
k:=k+1;
 begin
   x[i,j]:=k;
   i:=i-1;
   J:=j-1;
 end;
   Begin
      if (i=0) and (j<>0) then
      i:=b
      else if (j=0) and (i<>0) then
      j:=b
      else if (i=0) and (j=0) then
      begin
         i:=2;
         j:=1;
      end;
          if x[i,j]<>0  then
      begin
         i:=i+2;
         J:=j+1;
      End;
   end;
until k > sqr(b);
For i:=  1 to b do
   begin
   For j:=1 to b do
    begin
      write(x[i,j]:4);
   end;
  writeln;
  end;
  readln;
end.
Title: MAGIC SQUARE
Post by: Ihsan on November 11, 2004, 01:31:36 PM
Insha Allah I'll be back with the code in VB 6 or VB .Net
Title: MAGIC SQUARE
Post by: _Waziri_ on November 11, 2004, 03:46:20 PM
Ihsan dat would really be great!
Title: MAGIC SQUARE
Post by: precious on November 11, 2004, 03:48:25 PM
Wallahi ni dai I have no idea of wat u are talking about but are you or were you a one time boka or malami?how come aka san da wannan abu ?Oh my thick brain tells me its complicated.
Title: MAGIC SQUARE
Post by: Ihsan on November 11, 2004, 04:33:52 PM
lol precious

Waziri, tell me more about this program (the main logic behind it). I do understand that it has rows and columns ( a multidimensional array) and the array size is 100 (0-99). I don't know Pascal but I kind of understand the syntax. Anyways...plz explain more. Thankx
Title: MAGIC SQUARE
Post by: Humrah on November 13, 2004, 05:30:17 PM
There are also ppl in Malaysia who use dis magic square thing. Waziri must explain what he is doing with it. :lol:  :lol:  :lol:  :lol:  :lol:  :lol:
Title: MAGIC SQUARE
Post by: _Waziri_ on November 19, 2004, 01:09:26 PM
lol at precious,

I really am not a BOKA or MALAMI in that sense. I never was. But I happen to have a considerable knowledge of how BOKANCI or MALANTA is. I am a knowledge seeker I leave no stone unturned. The next time you meet any BOKA or MALAMI who promises to conspire with you against KISHIYA call my attention. I will be able to tell you as to whether he is  real or only a complete fraud. :lol:  :lol:  :lol:  

Or even if you do want the service of the real one in order to silence that KISHIYA I can facilitate everything for you when you make my million dollar check ready. :lol:  :lol:  :lol:

OK

on a more serious note, what we are talking about is HATIMI which has rows and columns with some numbers in it. Now, these numbers are not just put there randomly. It follows a scientiic process of placement according to the tradition of the dicipline, AUFAQU. The program we have written above is only aimed at computerising that process to make everything appear ssimple.

Ihsan,

I will explain the code later. I know have to go for Jumu'at prayer. I will surely get back that we may both learn from this interaction.

Humrah,

Wellcome back to the forum. I am happy to see you again.
Title: MAGIC SQUARE
Post by: precious on November 19, 2004, 08:38:59 PM
Does this also have to do with wannan abin da ake a ce wai mutum is born under ruwa,wuta, kasa(akwai kasa?)etc.or is it just duba that ur talking about?By the way i think na daina shigo wa nan wajen.ga alamar na masu kwakwalwa ne.
Erm, Waz,what about that kishiya thing?A coupla million euro yayi ma :lol:
Title: MAGIC SQUARE
Post by: Yoruba Land on November 20, 2004, 06:03:43 PM
I take God beg una not to turn dis Forum in magic place. Hey! am beginning to see dark images. D humrah and all in strange colours.... Hey this is real magic.!!!!!!!!!!!!!!!!!!!!!!!!!!!
Title: MAGIC SQUARE
Post by: Ihsan on November 21, 2004, 09:03:45 PM
Thankx Waz, much appreciated :)
Title: MAGIC SQUARE
Post by: _Waziri_ on November 22, 2004, 10:34:20 AM
Aha Kola you are are here again trying to pretend that you are not a BIG HEADED programming guru ko? You program rain falls and yet you refused calling that Magic. It is only d effort of a programming toddler like me you call magic?????????

Precious it has nothing to do with predicting future but it has everything to do with the nature of the spritual body as in water, fire, sand and wind as you observed. It drives a formula for curing ailments.

Ah! lol, Precious worry ya self not. Tunda ke na gida ne, 1 million dollar kawai will do. Send me a PM I will get you connected to d real BOKA dat will do the work great.

Ihsan once again, this is how the code above works:

Every Pascal Program has two sections: Program header and Block statements.

Program header is the expression that carries the name of the program like we have above: Program Magic;

Any thing enclosed in that kind of bracket {} is only a remark that will be neglected during program execution.

Then comes the block statements: the a part of it carries variables declaration, constants and types.

You know in every structured programming everything used in the program must be properly declared, thus we have:

Quoteuses
crt;
const
ArraySize = 99;
type
ArrayType = Array[1..ArraySize,1..ArraySize] of Integer;
var
x: ArrayType;
b,i,j,k : Integer;

taking care of all the variables we used in the program.

The b section of the block statements takes the logical expression and commands necessary to make the program work, this must start with a BEGIN statement in Pascal then subsquentily every compound stament also must begin with a BEGIN, here is it:

QuoteBegin
clrscr;
write('Enter the number of rows and columns= ');
Readln(b);
For i:=1 to b do
For j:=1 to b do
x[i,j]:= 0;
i:=1;
J:= (b + 1) div 2;
k:=0;
repeat
k:=k+1;
begin
x[i,j]:=k;
i:=i-1;
J:=j-1;
end;
Begin
if (i=0) and (j<>0) then
i:=b
else if (j=0) and (i<>0) then
j:=b
else if (i=0) and (j=0) then
begin
i:=2;
j:=1;
end;
if x[i,j]<>0 then
begin
i:=i+2;
J:=j+1;
End;
end;
until k > sqr(b);

In the above you will see that After the first BEGIN came the initialization of the contents of my rows and columns to take null values each.

Then we made row i to be 1 and column j to be b(number of rows and columns) + 1 divide by 2.

Then we entered a loop that will carry the operation of placing the numbers in the right rows and columns by using REPEAT.... UNTIL statement.

After which we printed the result using this statement lines with the final END to the first BEGIN:

QuoteFor i:= 1 to b do
begin
For j:=1 to b do
begin
write(x[i,j]:4);
end;
writeln;
end;
readln;
end.

I hope I explained to your understanding. I am ready to be more detailed please if you don't get me very well. It is my pleasure.

I remain most grateful.
Title: MAGIC SQUARE
Post by: zezezee on December 07, 2004, 02:24:07 PM
hmmm, i can see wazz man, u have started drifting into the path of bokanci....my question here is, does it really work? if it does, present a demonstration please....

try it on ihsan or humrah  :D
Title: MAGIC SQUARE
Post by: elgaazus on December 13, 2004, 08:32:27 PM
Waziri,

Your posts on this site (kanoonline) potray you as a person knowledgeable and versatile in Islam and the western education. But have you given a thought to the implication of this your programme on 'MAGIC SQUARE'. Are you giving way to a little heedlessness, cos the stands of Islam on Bokaye and Magic is really a serious one.

Just doing  the work of a brother, reminding you. Pls Think twice

Ma'assalam
Title: MAGIC SQUARE
Post by: _Waziri_ on January 05, 2005, 01:46:03 PM
As you rightly observed Elgazus, we are only writing Programs about MAGIC SQUARE not practicing the charms associated with it. So do not worry. We can discuss or even learn about evil in  as much as we will not practice it. It is permissible in Islam. Knowledge is great. Mu'awiyya Ibn AbuSufyan knew astrology very well but, mind you, that did not say he practiced it.

Zezezee it really works. Bokanci really works. I will give you some tips when you are ready to test it on Humrah or Ihsan yourself. You know it is better you experience everything yourself. How d u like dat? :lol:  :lol:  :lol:
Title: MAGIC SQUARE
Post by: precious on January 05, 2005, 10:02:20 PM
Waziri,give me some tips .i am ready to learn and practice.em  dont worry i'm a goooood girl :lol:
Title: MAGIC SQUARE
Post by: _Waziri_ on January 07, 2005, 08:16:45 PM
Remember precious, you did not pay the Euros for introducing you to that good BOKA and now you are asking for tips to become BOKA  yourself without paying anything. NO. Ban yarda ba saikin biya debt tukuna.
Title: MAGIC SQUARE
Post by: precious on January 08, 2005, 01:26:18 PM
hah! mr waziri,
you stood me up and never showed up.Anyway if i had gone to that good boka i wouldnt be wanting some lessons,ko?
Title: MAGIC SQUARE
Post by: Humrah on January 10, 2005, 01:56:39 PM
Mr. Waziri and Precious......? :lol:  :lol:  :lol:  :lol:  :lol:  :lol:  :lol:  :lol:
Title: MAGIC SQUARE
Post by: _Waziri_ on January 12, 2005, 04:23:55 PM
Ah to shikenan precious we can strike a new deal. This time around just half million Euro will do. I will teach you everything, including the things I do not know about BOKANCI  :D  :D

Humrah,

Where do you hide, you don't come online frequently?
Title: MAGIC SQUARE
Post by: Anonymous on April 26, 2005, 09:16:41 PM
_Waziri_ I completely gotta agree with you.