Jump to content



Most Liked Content


#56005 We Have Been Hacked

Posted by flyingfisch on 19 November 2012 - 10:49 AM

Posted Image
  • MicroPro, Casimo, naib864 and 1 other like this


#55057 آموزش Cplua

Posted by MicroPro on 22 June 2012 - 09:36 AM

سلام دوباره به همه و بریم سراغ قسمت else.

در کد قبلی فرض کنید میخوایم اگر x منفی باشه برامون Nagative چاپ کنه. این کار رو با یک قسمت else انجام میدیم:

x = tonumber( input() )
 if x > 0 then
   print("Positive")
else
   print("Negative")
end
print("Program finished")
با اجرای برنامه بالا، اگر عددی که میدیم مثبت باشه، شرط x > 0 رو بررسی میکنه و چون درست هست Positive چاپ می‌کنه، بعد از روی قسمت else میپره تا به end مربوط به بلوک if برسه و بعد Program Finished رو چاپ میکنه. اما اگه عدد منفی باشه: شرط x > 0 رو بررسی می‌کنه، چون این دفعه این عبارت منطقی صدق نمی‌کنه، چیزای بعد از if رو اجرا نمی‌کنه بلکه نگاه می‌کنه اگر قسمت else توی برنامه داشته باشیم (که اینجا داریم)، اون بخش رو اجرا می‌کنه. پس برامون Negative رو چاپ می‌کنه و از if خارج میشه و Program Finished هم همیشه چاپ میشه.

خوب حالا اگر یه نفر عدد صفر رو وارد کنه برنامه‌ی بالا چیکار میکنه؟ خودتون امتحان کنید. میبینم که Negative چاپ میشه. چرا؟ خوب معلومه اول شرط x > 0 بررسی میشه، ولی چون 0 بزرگتر از 0 نیست، این شرط غلطه بنابراین قسمت else رو اجرا میکنه.

توی بسیاری از موارد برنامه نویسی جاهایی هست که بیشتر از دو تا انتخاب داریم. مثل این جا اگه بخوایم در صورت وارد کردن عدد 0 عبارت Zero چاپ بشه، در حقیقت توی یه تصمیم سه حالته هستیم. در این مواقع هست که پای elseif هم وسط میاد:

x = tonumber( input() )
if x > 0 then
   print("Positive")
elseif x == 0 then
   print("Zero")
else
   print("Negative")
end
print("Program finished")
برنامه‌ی بالا نشون میده که هر تعداد بخوایم میتونیم حالت‌های مختلف برای تصمیم‌گیری داشته‌باشیم. توی کد بالا عبارت elseif x == 0 then هم به عنوان یکی از بخش‌های if نوشته شده. اگر کاربر عدد صفر رو وارد کنه، اول شرط x > 0 بررسی میشه که غلط هست پس برنامه میره جلو ببینه elseif یا else نوشتیم یا نه. چون elseif رو میبینه، شرط x == 0 (بخوانید:‌اگر ایکس برابر صفر باشد) رو بررسی میکنه و میبینه صدق می‌کنه، پس عبارات بعدشو اجرا می‌کنه یعنی Zero رو نشون میده و بعد به خارج از بلوک if میره و Program Finished رو چاپ میکنه. توجه کنید که اگر 0 وارد کنیم دیگه Negative رو چاپ نمیکنه چون که در یک بلوک if فقط محتوای یک بخش if یا elseif یا else اجرا میشه، به عبارت بهتر فقط یک تصمیم میتونه گرفته بشه و بعد از اجرای اون تصمیم (که اینجا مثبت بودن یا صفر بودن یا «در غیر اینصورت» بودن هست) اجرای برنامه از بعد از end مربوط به اون بلوک if از سرگرفته میشه.

نکته‌ای که اینجا هست اینه که در چک کردن شرط «اگر ایکس برابر صفر باشد» چرا بجای یک علامت مساوی دو تا گذاشته‌ایم؟ جواب: زیرا این دو علامت با هم فرق می‌کنند. = علامت انتساب هست مثلا فلان مقدار را بریز توی x ولی == علامت منطقی تساوی هست و توی شرطها همیشه باید از == استفاده کرد و استفاده از = موجب خطا میشه.


مثال دیگه: برنامه‌ای بنویسید که نمره‌های درخشان یک دانشجو رو بگیره، اگر بین 0 تا 10 باشه عبارت Fail رو نشون بده، بین 10 تا 15 عبارت Bad و بین 15 تا 20 عبارت Good. اگر نمره بین این عددها نباشه پیغام Error رو چاپ کنه.

x = tonumber(input())
 if 0 < x and x <= 10 then
   print "Fail"
 elseif 10 < x and x <= 15 then
   print "Bad"
 elseif 15 < x and x <= 20 then
   print "Good"
 else
   print "Error"
 end
با نگاه کردن به کد بالا طرز کارشو کشف کنید. در ضمن در x <= 10 اون علامت کوچکترمساوی هست. فقط یه نکته که باید توجه کنید اینه که برای چک کردن این که x بین دو تا عدد هست مثلا اینجوری if 0 < x <= 10 then نمیتونیم بنویسیم. بلکه باید مثل بالا if 0 < x and x <= 10 بنویسیم (که then درستش هم توی ریاضیات همین هست).


مثال دیگه: برنامه بنویسید که اسم یه آدم رو بگیره که اسامی شامل ali, jack, sara, mary هست. سپس جنسیت شخص مورد نظر رو چاپ کنه.

name = input()
 if name=="ali" or name=="jack" then
   print "Male"
 else if name=="sara" or name=="mary"
   print "Female"
 else
   print "I don't know"
 end
خوب در مثال قبل‌تری and رو دیده بودید، در این مثال or رو می‌بینیم که همون معنایی رو میده که شما به ذهنتون خطور میکنه. میگه «اگر نام برابر ali باشد یا نام برابر jack باشد آنگاه...». یک اشتباه که معمولاً برنامه‌نویسهای مبتدی می‌کنند ولی ما به عنوان مدعی‌های برنامه‌نویسی نمی‌کنیم، این هست که به جای شرط بالا می‌نویسند:

if name == "ali" or "jack" then ...
عبارت بالا کاملاً اشتباه هست! اگر کسی میخواد بدونه بگه ولی در حالت عادی توضیح نمیدم که چرا اشتباهه چون اگه بخوام بگم احتمالا مثل قبل پنج تا پاراگراف توضیح مینویسم ولی همهش مبهم بنابراین...


تا حالا از عملگرهای > و < و == توی شرطها استفاده کرده بودیم ولی کل عملگرها اینها هستند:

==  مساوی
 >   بزرگتر
 <   کوچکتر
 >=  بزرگتر یا مساوی
 <=  کوچکتر یا مساوی
 ~=  نا مساوی

در ضمن if و هر بلوک دیگه رو میشه توی زبان‌های برنامه نویسی تودرتو کرد. مثال پیچیده: فرض کنید یه استاد دانشگاه میخواد نمره‌های پایان ترم دانشجوهاشو رد کنه. اگر دانشجویی قبول شده باشه استاد 2 نمره اضافی بهش میده، اما اگر دانشجویی رد شده باشه در صورتی که اون دانشجو از دانشجوهای مورد علاقه استاد یعنی ali و sara باشه بهش 5 نمره ارفاق بکنه ولی از بقیه 2 نمره کم کنه! این برنامه باید اسم دانشجو و نمره شو بگیره و نمره نهایی رو پرینت کنه

name = input("Student name:")
 grade = tonumber(input("Student grade:"))
 if grade > 10 then
   grade = grade + 2
 else
   if name=="ali" or name=="sara" then
	 grade = grade + 5
   else
	 grade = grade - 2
   end
 end
 print("Final grade is ", grade)
تو کد بالا نام و نمره رو در دو خط اول میگیریم، اگر نمره بزرگتر از 10 باشه یعنی دانشجو قبول شده باشه دو نمره به نمره اش اضافه میکنیم. اما اگر نمره اش زیر 10 باشه، در صورتی که نامش جزو نامهای مورد علاقه استاده هست 5 نمره میده و در غیر اینصورت 2 نمره هم کم میکنه و به التماس های اون‌ها توجهی نمیکنه و در آخر هم نمره‌ی نهایی رو چاپ میکنه.

همون طور که میبیند درون قسمت else اولین if،‌ یه if دیگه با else و end مربوط به خودش گذاشتیم که کاملا درست هست. (گرچه در این مثال میتونستیم اون رو به صورت elseif ادامه‌ی همون if اول بنویسیم ولی همه جا نمیشه این کار رو کرد).

تورفتگیهایی که در کد میگذاریم (مثلا محتوای اولین if را با دو space میبریم جلو و محتوای دومین if را با تعداد بیشتری فاصله میبریم جلو) در کد اختیاری هستند. ولی شدیداً توصیه میشود که آنها را بگذارید چون اگه نگذارید شش ماه بعد برگردید به کد خودتون نگاه کنید هیچی ازش نمیفهمید در صورتی که اگر تورفتگیها را رعایت کنید کد بسیار خواناتر میشه.


و اما تمرین توی خونه! برنامه ای بنویسید که مقدار a و b و c یک معادله درجه دوم به فرم ax2+bx+c=0 رو بگیره، ریشه‌های اون رو محاسبه و چاپ کنه!

راهنمایی: صورت سوال بالا برای نوشتن این برنامه کافیه، ولی خوب الگوریتم اون رو اینجا توضیح میدیم: اول a و b و c رو می‌گیریم و دلتا رو محاسبه می‌کنیم. حالا یهه if میخوایم که اگر دلتا بزرگتر از صفر باشه دو تا ریشه رو حساب کنه و نشون بده، اگر صفر باشه خوب یه ریشه داریم و اگر منفی باشه هم مثلا بگه «ریشه حقیقی ندارد». توی محاسبات هم که باید جذر دلتا رو حساب کنید از تابع math.sqrt استفاده کنید.


اگر داریم روی if اینقدر مانور میدیم علتش اینه که از پایه‌ای ترین چیزها هست و if رو بلد باشیم بلوک‌های for و while هم راحت میشن. خدا بخواد از این پایه ای ها رد بشیم سرعت جلو رفتن آموزش خیلی بالاتر میره.


جلسه بعد: for و while

  • saeed511, Ata.H.D, farahmand and 1 other like this


#60412 FX-82/-83GT/-115/-991ES PLUS Hacking

Posted by SopaXorzTaker on 21 August 2016 - 05:27 PM

The following list was written by user202729 and serves as the guide to this forum thread.

 

 

 

Tutorial about ROP.

Javascript code to help with writing hackstring.

Character map image. Alternative version. Also available in the Javascript code above.

Scrolling text demonstration with video.

Calculator font.

How to enter a hackstring (991ES+) (less detailed version)

Hackstring used to dump the ROM. No longer needed now as we already have the ROM.

Datasheet contains some information about the hardware.

Hardware description: Part 1, part 2.

  * KI/KO ports (keyboard).
  * Timer: Part 1, part 2.
  * LCD screen.

Variable byte representation (no English translation this time).


High-level functions:

  * getkey

There are some outdated information about "real address" and "emulator address". Now we had the real ROM of the calculator that is not necessary.


  • flyingfisch, Viliami and user202729 like this


#60381 Casio Fx-9860G Sdk Tutorials (2016 Avaiable)

Posted by Viliami on 09 August 2016 - 06:55 AM

The Fx-9860gii SDK uses C by default (it also supports C++, SH4A and SH3 ASM), the SDK just uses the standard C with some extra functions for I/O and drawing. 

 

 

In the "fxlib.h" header file, there are a bunch of Bdisp functions, these functions deal with drawing pixels to the screen and clearing them.

e.g Bdisp_PutDisp_DD() is the function used to draw a pixel to the screen and Bdisp_AllClr_DD() is the function used to clear all the pixels from the screen.

 

There is a good tutorial created by Fez and reformatted by Helder7 about the Bdisp functions and basic I/O over here: http://www.casiopeia...php?f=20&t=1420

 

You can also download the official Casio docs on the fxlib library over here: http://edu.casio.com...greement.html#2

 

 

Here is a hello world program, most of this is auto-generated by the SDK when you create a new project:

/*****************************************************************/
/*                                                               */
/*   CASIO fx-9860G SDK Library                                  */
/*                                                               */
/*   File name : [ProjectName].c                                 */
/*                                                               */
/*   Copyright (c) 2006 CASIO COMPUTER CO., LTD.                 */
/*                                                               */
/*****************************************************************/

#include "fxlib.h"

//****************************************************************************
//  AddIn_main (Sample program main function)
//
//  param   :   isAppli   : 1 = This application is launched by MAIN MENU.
//                        : 0 = This application is launched by a strip in eACT application.
//
//              OptionNum : Strip number (0~3)
//                         (This parameter is only used when isAppli parameter is 0.)
//
//  retval  :   1 = No error / 0 = Error
//
//****************************************************************************

int AddIn_main(int isAppli, unsigned short OptionNum)
{
    Bdisp_AllClr_DDVRAM();          // clear screen
    PrintXY(1,1,"Hello World!",0);  // print "Hello World!" to the VRAM
    Bdisp_PutDisp_DD();             // copy pixels from the VRAM to the actual display
    return 1;
}




//****************************************************************************
//**************                                              ****************
//**************                 Notice!                      ****************
//**************                                              ****************
//**************  Please do not change the following source.  ****************
//**************                                              ****************
//****************************************************************************


#pragma section _BR_Size
unsigned long BR_Size;
#pragma section


#pragma section _TOP

//****************************************************************************
//  InitializeSystem
//
//  param   :   isAppli   : 1 = Application / 0 = eActivity
//              OptionNum : Option Number (only eActivity)
//
//  retval  :   1 = No error / 0 = Error
//
//****************************************************************************
int InitializeSystem(int isAppli, unsigned short OptionNum)
{
    return INIT_ADDIN_APPLICATION(isAppli, OptionNum);
}

#pragma section


As you can see from above, there is no main() function, unlike standard C our entry point to the program isn't the main() function, it is the AddIn_Main() function.


  • flyingfisch, frankmar98 and saeedgolabli like this


#59479 Casio Prizm Mandelbrot Explorer

Posted by ProgrammerNerd on 11 September 2014 - 11:41 PM

The Mandelbrot fractal is quite a sight.
Such wonder and amazement that can be found while viewing the Mandelbrot fractal can now be had on the Casio Prizm graphing calculator.
In addition this program can also be compiled for the PC assuming SDL is installed.
Just run make and it will be up and running.
There is very little difference in function between the PC version and the casio prizm version, the resolution is higher but that is it.

The controls are
Left, right, up, down moves the window in that direction
Menu key or ESC on the PC, exits to the menu or exits the program (PC)
F1 sets maximum iterations to 65535
F2 sets the maximum iterations to 224 (this is the default upon starting the program)
F3 toggles deep mode which is on by default. This means you can zoom in deeper with a slight performance hit.
I do not notice the difference
1 subtracts one from the maximum iterations
2 adds one to the maximum iterations
3 subtracts ten from the maximum iterations
4 adds ten to the maximum iterations
5 subtracts 100 from the maximum iterations
6 adds 100 to the maximum iterations
Shift zooms in
Alpha (ALT on PC) zooms out
Source code https://github.com/C...-Prizm-Explorer
Binary https://github.com/C.../mandelbrot.g3a
Screen shots (from the PC version which gets very similar output differing only in resolution).
CWM8Ekp.png
0pNWIZX.png
Anyways if you have any bug report(s), feature request(s), pull request(s), patch(es) or whatever relates to this I would be happy to hear about them.


  • MicroPro, flyingfisch and Viliami like this


#57683 Using The Sdk

Posted by preb on 10 February 2013 - 06:26 PM

There are tutorials to write programs in Casio-Basic on here. Just use the search bar to find them :)
  • MicroPro, flyingfisch and abdelrahmanmostafa like this


#57532 Introduce Yourself

Posted by flyingfisch on 04 February 2013 - 10:32 PM

Name: Daniel, just call me Hyuji.

Birthday: 15 Feb

Age: 17(For now...)

Hobbies: Biking, Video Games (RPGs), Anime & Manga, Mathematics, Computers, Music(Rap)

Where you got your username: I'm lazy so I just took some grouped letters on the keyboard, that made sense, into a username. If you look on a QWERTY keyboard, you will see the letter H-Y-U-J-I all grouped together for easy typing. My password follows a similar principal.


O.o You sure you want to say that much about your password?

Anyway, welcome to UCF!

Hope you enjoy your stay. In the meantime, Ice Cream!

Posted Image
  • MicroPro, Casimo and naib864 like this


#60648 FX-82/-83GT/-115/-991ES PLUS Hacking

Posted by user202729 on 06 November 2016 - 07:05 AM

@SopaXorzTaker Sorry I forgot to mention that the ROM is of fx-570/991SP X emulator, its language is not English. Perhaps I will send you an English version (not on this site)

On this site there are two images of calculators with checksum.

EDIT too bad that those do not have emulator.

 

@kaikun97 Can you delete the video in your quote? It has a lot of Casio calculator emulator which may be copyrighted.


  • flyingfisch and kasio like this


#59640 Entering A Number In N, Then Enter Numbers N Times

Posted by Sheepolution on 30 October 2014 - 12:33 AM

"How many rows"?->N

For 1->I to N

"X"?->Matrix A[I,1]

"Y"?->Matrix A[I,2]

Next

 

Something like this?

 

I think you need to define the length of the matrix before hand, but I forgot how to do that at the moment.

Something like N->Dim Mat A

 

I think.


  • jasonphan and Ata.H.D like this


#59473 Lost The Sdk D:

Posted by shinolife63 on 11 September 2014 - 09:05 PM

Ok, so this is a pretty simple thread, bassically the computer I had the 9860 sdk on died, along with the hdd, and now I cant find where I got it from casio's website.
If anyone could link me to a download (from casio or otherwise), that'd be supurb.

Thanks.


  • flyingfisch and shinolife63 like this


#59409 Help! Touchscreen On Classpad 330 Not Working!

Posted by soulsurvivor on 03 August 2014 - 06:43 PM

Hi guys,

i found a solution for the touchpad problem. By simply heating up the display with a hair dryer!

hope it works also for you
  • Valdis and squonk like this


#58739 Calc Function In Fx-Cg10

Posted by Anandks on 11 September 2013 - 04:25 AM

Dear 3298,
Thanks for the reply and sorry for adressing casio fan, As the site says, "Newbie"
Yours is good solution and thanks for that.

Also a Gentleman from CASIO managed to answer this question and i would like to post his reply to me for those who interested.

Hello Anand,
If I understand your needs correctly, I believe the best option for you is to use the 'Equation' application on the fx-CG10. Once in 'Equation', select <F3> (Solver) and enter an equation something like Y = X + 2B + 6A - 20C. After you finish and press <EXE> you should see the entered variables appear beneath the equation, Y, X, B, A, C. Enter each value you know (A, B, C, X) and then highlight the value you would like to calculate (in this case, that's probably Y) and press <F6> (Solve).
I do hope that resolves your issue, but if you need further assistance or screenshots, please let me know.

Kind Regards,
Nathan
 
 
Nathan T. Austin
Curriculum & Online Training Manager
Education Division

CASIO AMERICA, INC.

  • abdelrahmanmostafa and Anandks like this


#58737 Calc Function In Fx-Cg10

Posted by 3298 on 10 September 2013 - 09:59 AM

So you want a "while true do" loop asking for variables and printing the result? Simply write that into a program, everything you can write in RUN-MAT is also valid in a program. For example:
While 1
"x"?->X
"B"?->B
"A"?->A
"C"?->C
2x+2B+6A-20C\Disp
WhileEnd
...where \Disp is the small triangle you find in Shift VARS. This program keeps asking for variables and displays the value of the function at the end of each iteration. AC/on quits the program.

Alternative solution if you already have all your variables in a table on a piece of paper: Go to the STAT menu, type all the values for your first variable into List 1, the values for the second variable into List 2, and so on. The lists should now look just like your table on the paper. Then move the cursor onto the top position of an unused list ("List xy" must be high-lit, not the name field or the cell for the first value), and type your formula while replacing each variable with the list that holds its values. Your example function would look like this:
2List 1+2List 2+6List 3-20List 4
The result is that this list will now hold all the results. Parallel processing with lists FTW :)


OFFTOPIC:
That number is really my nickname, "Casio Fan" is just a title that will change when I have more posts, just like it currently says "Newbie" for you.

  • abdelrahmanmostafa and Anandks like this


#58590 Program In A Visual Basic Ide For Classpad

Posted by MicroPro on 29 May 2013 - 08:34 AM

Seems this is getting some attention; so let me answer this before more misconceptions arise.

First off, the screenshots are almost made up by me, for example the toolbar is simply an screenshot of VB6's toolbar (someone remembered VB here ;) ) and the property editor is fake...

But wait, the project is real! Most of the UI and some of the designer part are already made. Actually I hope I can complete the compiler part as the thesis for my B.Eng degree this year.

Considering the above, this program may become ready and be released this summer (hopefully!). Releasing the screenshots soon was a way to push me forward; because I am so lazy!

btw thanks for crossposting back then, flyingfisch!
  • jinzihao and Casimo like this


#58486 Introduce Yourself

Posted by flyingfisch on 06 May 2013 - 01:03 AM

Hi Thief_Of_Heart :)

Do you know any programming languages already?

Here is a good tutorial to start you out with programming on casio calcs: http://community.cas...1798#entry31798

And for news and help, feel free browse the forums or check out my blog, which has some helpful resources and a budding tutorials section. ;)
  • Casimo and Thief_Of_Heart like this


#58094 Windows 8?

Posted by MicroPro on 07 March 2013 - 05:50 PM

Actually Windows 8 is a transitional operating system. So we'd better wait and see what will Microsoft do with itself in the next version.
Without the start menu, it looks weird. There are already 3rd party start menu's out, though.

Generally, as someone who can confuse others by working with the computer very fast (look at my humility :blah: ), I find mouse much faster and convenient than touch screen. In my case, with touch screen, I have to jam my index finger while gazing at the screen to make it work. With mouse, you just move your wrist (and at the worst case your forearm) and everything gets done.
  • flyingfisch and Casimo like this


#56649 Making Addins For Power Graphic 2 Fx's

Posted by louloux on 06 January 2013 - 12:19 PM

To install SDK on 64-bits we just have to copy the folder in a path without parentheses. ;)
  • MicroPro and Casimo like this


#53518 New G2 Models Arriving

Posted by noname11 on 23 December 2011 - 06:03 PM

The announcement also mentions a new supported function "Bkey_GetKeyWait", but I see the version is still 1.00. How can that be?

Because it's already in the SDK (used by GetKeyWait()), but no interface has been provided so far.

Here's a batch script that lets you extract Bkey_GetKeyWait() from the fx-9860G library:
@echo off

set "shc_lib=%programfiles%\casio\fx-9860g sdk\os"
set "sh_lnk=%shc_lib%\sh\bin\optlnk.exe"
set "fxlib=%shc_lib%\fx\lib\fx9860G_library.lib"

"%sh_lnk%" -library="%fxlib%" -list=modules.txt -form=library -output=temp.lib
"%sh_lnk%" -library="%fxlib%" -extract=_Bkey_GetKeyWait -form=object -output=Bkey_GetKeyWait.obj
del temp.lib

pause > nul
If you analyze this file with a disassembler then:
.section P, CODE
				.export _Bkey_GetKeyWait

_Bkey_GetKeyWait:
				mov.l   #h'80010070, r2
				mov.l   #h'247, r0
				jmp	 @r2
				nop

dword_8:		.data.l h'80010070
dword_C:		.data.l h'247
You'll see that Bkey_GetKeyWait() just makes a syscall (0x247) and that it has global scope (.export keyword).

So it should be sufficient to just add the function prototype to an include file:
int Bkey_GetKeyWait(int *code1, int *code2, int wait_type, int time, int menu, short *unused);

  • MicroPro and Casimo like this


#31796 Casio Basic Tutorial

Posted by huhn_m on 28 November 2005 - 05:03 PM

Part 13: Advanced Variables

Those of you who know other programming languages have probably seen a big problem in what you have read so far, what if you need more than 28 variables in your game? A long time ago (in a calc far, far away), when I was first learning to program I was making little games like Example 1 of this tutorial. But then I started trying to make some more complex games and I ran into a problem, I needed more variables and there were none to be found! Eventually I found the answer: Lists and Matrices.

Lists – A list is exactly that, a list of variables, they can be up to 255 cells long.
Here is a visual of a list with 5 cells:
[ ]
[ ]
[ ]
[ ]
[ ]
to access a cell in a list you just use List #[#] (List 11), the first # represents the number of the list and the second represents the index of the cell. You can use Lists just like you use normal variables, anything you can do with a letter variable you can do to a list, you just have to specify what list and what cell.

Some special list functions:
X->Dim List # : creates a list with X cells in it, all cells are set to 0.
Fill(X,List #) : fills a list with X.
There are others, but you probably wont use them.

Matrices – A matrix is a two dimensional list
Here is a visual of a 5x4 matrix.
[ ][ ][ ][ ]
[ ][ ][ ][ ]
[ ][ ][ ][ ]
[ ][ ][ ][ ]
[ ][ ][ ][ ]
Matrices are just like lists except that they are two dimensional, I like to use them for maps, especially tiled maps. To use a matrix use Mat (letter A~Z)[Y,X] (Mat A[1,1]), the X and Y are reversed, make sure not to confuse them.

Special Matrix functions:
{Y,X}->Dim Mat (letter) : creates a YxX matrix
Fill(#,Mat (letter)) : fills a matrix with a #
Again, there are more, but you wont need them right now.

Tip: List and Matrices are very useful for loops, since they are indexed you can loop through them or use List 1[A] so you can change what list cell you are using dynamically. Also note that you cannot do this with the number of the list.

Return to Tutorial Index
  • PsySc0rpi0n and frankmar98 like this


#27523 Cfx Games Slow, New Drawing Method

Posted by liquid on 12 March 2005 - 01:16 AM

Hey ive been programming my fx-9750G plus for a year now and the games ive made that use graph mode never use the F-Line function as its so slow(i made these games b4 link cable so they were deleted :( srry). Im just wondering why all the other cfx games on the web out there use F-Line. Using the stats mode to plot xy line graphs from points in a list is much faster, i just cant believe no one else has thought of this in their games and programs???
for example:
This program will make a star move around screen using direction buttons(could be replaced with a man to make a rpg like game?):

ViewWindow 1,127,0,63,1,0
FuncOff
S-WindMan
S-Gph1 DrawOn,xyline,list1,list2,1,Dot
{2,10,18,1,19,1}->List 1
{19,1,19,7,7,19}->List 2
-60->A:-28->B
Lbl 0
Getkey
Ans=0=>Goto 0
Ans=38=>A+10->A
Ans=27=>A-10->A
Ans=37=>B-10->B
Ans=28=>B-10->B
ViewWindow 1+A,127+A,0,63+B,1+B,0
DrawStat
Goto 0

If u try this out you will definatly see the advantage over F-line commands.
Its fast enougth that you wont even see the lines being drawn, they just appear :)
Using the method above, u dont even have to manipilate the list data as you just change the view-window parameters to move the object across the screen. This could be put to use in moving backgrounds made up of lines, or just simple sprites like a star or man.

If u want u can also do this by manipuilating the list data and not the view-window, but this will slow down as you get images/sprites made up of lots of points, so changing the view-window parameters is best for speed :).

An example of the advantage of this method would be to draw a background/map using this, then store it as background pict, then have a man/car/whatever move around the screen using the view-window method like above. You could even rotate the man/car/whatever by manipulating the lists with polar and rec commands.

So it would be cool if authors of cfx games now use this method, or update their games so the drawing is faster.

Another note, if you want to zoom backgrounds or sprites bigger and smaller or squash or stretch them, u can edit the viewwindow parameters, then drawstat which is very fast.

Another note, dont open the programs up in casiocomm as it doesnt recognise all the commands like S-Gph1 DrawOn,xyline,list1,list2,1,Dot, so it stuffs them up when u try to send them too ur calc. Ull have to transmit it with, but not open it for text editing in casio comm.
  • Viliami and frankmar98 like this