Jump to content



Photo
- - - - -

Changing The Output


  • Please log in to reply
14 replies to this topic

#1 heyhey

heyhey

    Newbie

  • Members
  • Pip
  • 4 posts

  • Calculators:
    CP300

Posted 20 January 2013 - 03:22 PM

Hello forum,
as a gag I would like to make my CP300 to print texts in response to calculations: so if I type for example "5+8"+EXE then the CP should not only give the correct result but also a comment (e.g. "That was easy!"). It would be great if this comment would be chosen by random from a list or so. Does anyone have an idea how this could be achieved? Many thanks in advance!

#2 flyingfisch

flyingfisch

    Casio Maniac

  • Deputy
  • PipPipPipPipPipPipPipPip
  • 1891 posts
  • Gender:Male
  • Location:OH,USA
  • Interests:Aviation, Skiing, Programming, Mountain Biking.

  • Calculators:
    fx-9860GII
    fx-CG10 PRIZM

Posted 20 January 2013 - 04:17 PM

Hello heyhey and welcome to UCF! You should introduce yourself.

What programming language are you planning on using for this?

#3 heyhey

heyhey

    Newbie

  • Members
  • Pip
  • 4 posts

  • Calculators:
    CP300

Posted 20 January 2013 - 05:02 PM

Thank you for the welcome, flyingfish!
I don't have the slightest idea what programming language I ought to use for this problem - in any case I hoped that either everything needed to do this is already inside the CP (using its basic) or that there already exists an addin that would do something like the thing I thought of. Do you think it is actually possible to write such a program without having to delve into too deep depths of the system?

#4 flyingfisch

flyingfisch

    Casio Maniac

  • Deputy
  • PipPipPipPipPipPipPipPip
  • 1891 posts
  • Gender:Male
  • Location:OH,USA
  • Interests:Aviation, Skiing, Programming, Mountain Biking.

  • Calculators:
    fx-9860GII
    fx-CG10 PRIZM

Posted 20 January 2013 - 05:08 PM

I do not own a classpad, so I am not really an authority on this, but you shouldn't have to delve too deeply into the system.

I think you can get CPLua, and then from there it should be pretty straightforward.

Lua would let you store all your answers in a list, and then have one randomly extracted.

You may have to write your own UI, or maybe not, I'm not sure what the CPLua has in default libs as far as that goes. But it shouldn't be too difficult.

#5 heyhey

heyhey

    Newbie

  • Members
  • Pip
  • 4 posts

  • Calculators:
    CP300

Posted 20 January 2013 - 05:37 PM

What?! Please, I do my best but couldn't you explain it in simpler terms: What is a "Lua"? I can write programms when I have to calculate things but I never had very much interest in computer sciences.

#6 flyingfisch

flyingfisch

    Casio Maniac

  • Deputy
  • PipPipPipPipPipPipPipPip
  • 1891 posts
  • Gender:Male
  • Location:OH,USA
  • Interests:Aviation, Skiing, Programming, Mountain Biking.

  • Calculators:
    fx-9860GII
    fx-CG10 PRIZM

Posted 20 January 2013 - 06:48 PM

Lua is a programming language. It's a little like VBasic, and its pretty easy to learn. ;)

#7 Forty-Two

Forty-Two

    Casio Overlord

  • Deputy
  • PipPipPipPipPipPipPip
  • 528 posts
  • Gender:Male
  • Location:Well, The sign says "You are here"...

  • Calculators:
    Casio fx-CG10 Prizm
    Casio fx-9860GII
    TI-84+ SE

Posted 23 January 2013 - 03:13 AM

Lua

Google for some tutorials on lua. It is very easy to learn for a beginning programmer.

#8 heyhey

heyhey

    Newbie

  • Members
  • Pip
  • 4 posts

  • Calculators:
    CP300

Posted 23 January 2013 - 08:55 AM

You are right learning Lua seems to be not too difficult. However: I don't have the slightest idea of how I could achieve what I had in mind. If every result from the CP is to be "commented on", so to speak, then I would have to make changes in the OS of the CP or would have to write a program that runs in the background of the CP that ckecks whether a calculation was made and then makes an additional output. Both seems very hard to me because the source code of the CP should be available (and I have to understand it!).

#9 flyingfisch

flyingfisch

    Casio Maniac

  • Deputy
  • PipPipPipPipPipPipPipPip
  • 1891 posts
  • Gender:Male
  • Location:OH,USA
  • Interests:Aviation, Skiing, Programming, Mountain Biking.

  • Calculators:
    fx-9860GII
    fx-CG10 PRIZM

Posted 23 January 2013 - 05:43 PM

You are right learning Lua seems to be not too difficult. However: I don't have the slightest idea of how I could achieve what I had in mind. If every result from the CP is to be "commented on", so to speak, then I would have to make changes in the OS of the CP or would have to write a program that runs in the background of the CP that ckecks whether a calculation was made and then makes an additional output. Both seems very hard to me because the source code of the CP should be available (and I have to understand it!).


Ohhh, ok.

So you want to intercept the run-mat (is that what its called on classpad?) mode prompt. I thought you juust wanted to make a program that took user input and gave a result.

As far as I know, what you want to do is difficult without extensive os modding.

#10 Casimo

Casimo

    Casio Overlord

  • Members
  • PipPipPipPipPipPipPip
  • 641 posts
  • Gender:Not Telling

Posted 23 January 2013 - 06:04 PM

Where are Simon and cfxm or kucalc? :cry:

#11 flyingfisch

flyingfisch

    Casio Maniac

  • Deputy
  • PipPipPipPipPipPipPipPip
  • 1891 posts
  • Gender:Male
  • Location:OH,USA
  • Interests:Aviation, Skiing, Programming, Mountain Biking.

  • Calculators:
    fx-9860GII
    fx-CG10 PRIZM

Posted 23 January 2013 - 06:07 PM

Yeah, but it would take even they a long time to figure out how to intercept the OS prompt. SimonLothar was only just recently able to figure out how to do a complete syscall based input line. ;)

#12 MicroPro

MicroPro

    Casio Overlord

  • Deputy
  • PipPipPipPipPipPipPip
  • 640 posts
  • Gender:Male
  • Location:Iran

  • Calculators:
    Casio ClassPad 300

Posted 24 January 2013 - 08:19 PM

Hi!

To acomplish this task, if you want this to be done in Main (aka RunMat on fx), you really should make your alternative Main program from scratch; as the source code is not available and there isn't any mechanism to hook into its internals.

CPLua (http://community.cas...forum/61-cplua/) is the language you should use on ClassPad if you want to write any serious program for CP (because of fast execution, graphics, all good functions and classes, etc). With the current functionality level of CPLua, it is possible to write a Main-like add-in fully imitating its UI and functionality.

CPLua already exposes most UI, CAS and other functions of claspad to the user and can compete wiht the sdk. Actually CP sdk already has classes for programming most aspects of the ClassPad. So no need to syscalls and other difficulties as in the fx series.

Altough you mentioned your idea as a "gag", this has been discussed before, for "serious" :) reasons such as making a better Main application.

#13 naib864

naib864

    Casio Technician

  • Members
  • PipPipPipPipPipPip
  • 316 posts
  • Gender:Male
  • Location:Behind the Moon :D
  • Interests:Programming, Minecraft

  • Calculators:
    fx-9860GII

Posted 24 January 2013 - 08:32 PM

Yeah, but it would take even they a long time to figure out how to intercept the OS prompt. SimonLothar was only just recently able to figure out how to do a complete syscall based input line. ;)

Why did you know SimonLothar? He's at the German forum, and not here.

#14 flyingfisch

flyingfisch

    Casio Maniac

  • Deputy
  • PipPipPipPipPipPipPipPip
  • 1891 posts
  • Gender:Male
  • Location:OH,USA
  • Interests:Aviation, Skiing, Programming, Mountain Biking.

  • Calculators:
    fx-9860GII
    fx-CG10 PRIZM

Posted 24 January 2013 - 08:38 PM

Why did you know SimonLothar? He's at the German forum, and not here.


Actually, he's all over the place, but he doesn't seem to be very active anywhere except the german forums. He is on cassiopeia occasionally though. ;)

#15 naib864

naib864

    Casio Technician

  • Members
  • PipPipPipPipPipPip
  • 316 posts
  • Gender:Male
  • Location:Behind the Moon :D
  • Interests:Programming, Minecraft

  • Calculators:
    fx-9860GII

Posted 25 January 2013 - 06:47 AM

Aha. Idon't know this, because I'm only at DCF and UCF. :)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users