Thanks!
And another question:
A=B Or A=C Or A=D Or B=C Or B=D Or C=D
This code is one part of my game project Guess Number for C.Basic version.
Is there a way to simplify this code?
Regards,
CalcLoverHK
Posted 07 August 2019 - 04:16 AM
A=B Or A=C Or A=D Or B=C Or B=D Or C=D
Posted 07 August 2019 - 05:06 AM
I just updated my CG20 and tried my dipole program there. How much better it looks! I am real excited. You can see the area around the two charges / poles, where no streamlines exist.
~
I want to explain my astronomical friends the differences ans similarities of the different types of different field types (fields in closer physical sense). We have the gravity field, the electrostatic field and the magnetic field. The first and the last one play an important role for astrophysics. The electrostatic is of lesser interest.
The next step I make ist to show the streamlines for a gravity field. Becaus it is boring for a single mass I selected the system earth - moon. If the program works I show it here.
Posted 07 August 2019 - 06:02 AM
List 1[ 1]=List 1[ 2] Or List 1[ 1]=List 1[ 3] Or List 1[ 1]=List 1[ 4] Or List 1[ 2]=List 1[ 3] Or List 1[ 2]=List 1[ 4] Or List 1[ 3]=List 1[ 4]
0->M For 1->K To 3 For 1->J To 4 K<J=>List 1[K]=List 1[J]=>1->M Next Next If M Then "true"
Posted 07 August 2019 - 07:44 AM
2.21 beta for 9860G/9860GII series.
-Fixed "Range Error" when assigned directly to ViewWindow variable.-hange specification that Graph 35+E II hidden memory usable size has been changed from 128KB to about 188KB.-Fixed a bug that the SDK emulator could not be started after initialization.
Yes! Thanks for the update. It works perfectly now!
Cheers!
Posted 07 August 2019 - 08:45 AM
Hi sentaro21,
@CalcLoverHKIn this case,You can access by index in List.List 1[ 1]=List 1[ 2] Or List 1[ 1]=List 1[ 3] Or List 1[ 1]=List 1[ 4] Or List 1[ 2]=List 1[ 3] Or List 1[ 2]=List 1[ 4] Or List 1[ 3]=List 1[ 4]When this is made into a program, it becomes as follows.0->M For 1->K To 3 For 1->J To 4 K<J=>List 1[K]=List 1[J]=>1->M Next Next If M Then "true"If there are about 4 variables, it will not be short.
Whoa! I can customize as many integers I can guess as I can in that way! Thanks a lot for giving me the idea of this.
But most importantly, can Casio Basic run this code?
Regards,
CalcLoverHK
Posted 07 August 2019 - 09:18 AM
Posted 08 August 2019 - 12:30 AM
Is the following code work the same way like above?
Fill(RanInt#(0,9),List 1)
RanInt#(0,9,4)->List 1
Seq(RanInt#(0,9),X,1,4,1)->List 1
Posted 08 August 2019 - 07:15 AM
As mentioned I have finished a first version of my program for calculation of the gravity field. The example implemented is the field earth-moon. For the coordinates I supposed 1 unit = 100'000 km, the masses are in relation to the mass of the earth. The program is able to incorporate more bodies, simply add them to Mat k.
The program calculates the streamlines of the gravity field. You get these lines if you follow the path of small particles with negligible mass. For calculating these paths I used the simpler Euler-Cauchy method. To get it more accurate one could use Runge-Kutta but the program gets much less clear then.
From a view far out both bodies (earth and moon) look like a single point. I selected this points at a distance of 10 from the center.
10sin (pi*f/180)->x 10cos (pi*f/180)->y
The field is already slightly bent there. You may set it more far out, but the program runs longer then.
The moon has only 1.8% of the earth's mass:
0.012->Mat k[1,2]
The image looks much more interesting if you give it 12% of the mass.
I run the program at my fx9860G. If you use it at the CG series with the better graphics, you may increase the number of streamlines. I use on eline every 10 degrees starting at a circle with the radius 10:
For 0->f To 360 Step 10
You can set the step to 5 or 2 degrees.
All in all it is a nice program to experiment with.
===
'ProgramMode:RUN 'Field earth and moon Gosub G'InitGraph 2->n'number of bodies {n,3}->Dim Mat k 'set values x y mass (-)1.9->Mat k[0,0] 0->Mat k[0,1] 1->Mat k[0,2] 1.9->Mat k[1,0] 0->Mat k[1,1] 0.012->Mat k[1,2] 'all source points For 0->f To 360 Step 10 10sin (pi*f/180)->x 10cos (pi*f/180)->y Do'until xy reaches one off the source points Gosub A'acceleration x-0.1X/A->x y-0.1Y/A->y Plot x,y 99->d For 0->I To n-1 Gosub D D<d=>D->d Next LpWhile d>0.1 Next Gosub S '=========== Lbl A'accelerations 0->X 0->Y For 0->I To n-1 Gosub D X+(x-Mat k[I,0])Mat k[I,2]/DDD->X Y+(y-Mat k[I,1])Mat k[I,2]/DDD->Y Next Sqrt(XX+YY)->A Return Lbl D'distance to point I Sqrt((x-Mat k[I,0])^<2>+(y-Mat k[I,1])^<2>)->D Return 'Envir.f.Graphic Lbl G'Init ClrGraph:CoordOff:AxesOff:GridOff:LabelOff:S-L-Normal:Rad:'#_SketchThin _ '_AxesOn_ ViewWindow (-)10,10,1,-5,5,1 Return 'Print.XY Lbl P Text 1,9," ": Text 1,9,x: Text 1,72,y'9860-72,CG-180 Return Lbl S'stop Plot :Text 1,1,">"Disps
All in all it is a nice program to experiment with.
Edited by piu58, 08 August 2019 - 07:25 AM.
Posted 08 August 2019 - 12:52 PM
Posted 08 August 2019 - 01:37 PM
Hi sentaro21,
Have you ever tried to program in Scratch?
I think you can take some advantages of this programming language. It is similar with C.Basic.
Timer (Stopwatch/countdown), username value and running multiple programs in sync are my wishes to see them happen in the future. (Maybe they are too harsh for you.)
I really look forward to seeing C.Basic evolved to such big size. Good job anyway!
Regards,
CalcLoverHK
Posted 09 August 2019 - 02:54 AM
Hi sentaro21,
Have you ever tried to program in Scratch?
I think you can take some advantages of this programming language. It is similar with C.Basic.
Timer (Stopwatch/countdown), username value and running multiple programs in sync are my wishes to see them happen in the future. (Maybe they are too harsh for you.)
I really look forward to seeing C.Basic evolved to such big size. Good job anyway!
Regards,
CalcLoverHK
Posted 09 August 2019 - 08:46 AM
Hi sentaro21,
In the FX version, the limit of add-in size is close, so there is not much room to add to C.Basic.However, I would like to incorporate useful things as much as possible.
What is the maximum size limit of the add-ins?
By the way, can you please add two additions to C.Basic?
First one: One button, multiple commands
/Example/
Click the button "If.pack" (If-command package, you can rename it)
Then the screen will show:
If Then Else IfEnd
For ElseIf, because it is an extension of C.Basic, keep it alone in the command menu.
Same condition with For~To~(Step~)Next, While~WhileEnd, Do~LpWhile, Switch~Case~Default... and so on.
It is because for example when you type If, you must have Then and IfEnd.
I think it can save up the time you spend on clicking buttons.
Second: Command shortcut button (can be customize)
Customize any buttons with a key combination that calculator/C.Basic doesn't have and it will input its corresponding command. Combine with the first one suggestion, it would be much faster to input command.
Regards,
CalcLoverHK
Posted 09 August 2019 - 08:52 AM
I don't believe that such packages are a fine idea. We have a calculator here, not a real computer. The usage should be adequate for a PPC and not too complicated. The flipping through the program pages is complicated enough. A more complicated structure would increase such problems.
If you want to have this you may type the commands immediately in series - they are in the same menu. And the fill the gaps.
Posted 09 August 2019 - 08:58 AM
Hi piu58,
I don't believe that such packages are a fine idea. We have a calculator here, not a real computer. The usage should be adequate for a PPC and not too complicated. The flipping through the program pages is complicated enough. A more complicated structure would increase such problems.
If you want to have this you may type the commands immediately in series - they are in the same menu. And the fill the gaps.
OK, but what about the shortcuts?
Regards,
CalcLoverHK
Posted 09 August 2019 - 10:35 AM
Posted 09 August 2019 - 02:24 PM
Hi sentaro21,
About command shortcutsIs it possible to use the command history of thekey?
Umm, that's still need to find the command to input.
I mean you can set the key combinations like [OPTN+1] and set its corresponding command.
But its effect is not obvious without the command package.
Regards,
CalcLoverHK
Posted 09 August 2019 - 02:25 PM
> OK, but what about the shortcuts?
Dear CasioLover,
it is easy to have ideas what can be added to such a program. But whether it is real useful and deserves the effort behind it, we only can find out by using C.Basic.
Using it means (in my eyes) to get into this language deeply, without looking at Casio Basic. As I started using it I was fascinated of
- The usage of small letter variable names. There are far less situations now ehre I have to use some kind of arbitrary variable name for a physical parameter (it ARE physical parameters in my programs)
- The option to use indenting and get readable programs
- The usage of well readable small fonts. This is especially true for the CG series
If I recommended changing something, I always look for thing which can be done easily but have a large effect. The indend mechanism is by way the most complicated one.
I know you are programming this master mind program. But you want to have it compatible with some models of calculators. So you cannot use the potential of C.Baisc to a large extend. I recommend to finish some real C.Basic programs and look then what serves most (which less effort). This forum is a good way to discuss such ideas.
BTW:
If you want to have a real programming language at a PPC, I recommend the CG-50 which comes with Python. Beside this, the french numworks calculator comes with Python too.
Posted 09 August 2019 - 02:53 PM
@piu58,
Thanks so much reading my ideas. Maybe my ideas are too dumb as I don't quite much investigate inside C.Basic.
I know you are programming this master mind program. But you want to have it compatible with some models of calculators. So you cannot use the potential of C.Baisc to a large extend.
Well, actually I know C.Basic can't run in fx-7400/9750.
BTW:
If you want to have a real programming language at a PPC, I recommend the CG-50 which comes with Python. Beside this, the french numworks calculator comes with Python too.
I heard the numworks calculator and tried the emulator. Thanks anyway.
Python is now the popular programming language, but I still love the simplification and easy-to-use advantages of Basic.
@sentaro21,
I have problem about C.Basic in fx-9860G OS 1.02/1.03 emulator (not 9860GII). It seems be installed in calculator as it shows the installation complete message and also presented in its memory manager. But main menu doesn't show the C.Basic icon.
Does C.Basic dropped support on OS 1.02/1.03?
Best Regards,
CalcLoverHK
Edited by CalcLoverHK, 09 August 2019 - 03:15 PM.
Posted 09 August 2019 - 03:53 PM
Dear CalcLover,
I write articles for our German Astronomical Association, which have astrophysical content. Mostly, I give a small programs for giving the readers the chance to experiment with the astrophysics. Two years ago I started with this articles and I had to select a programming language. I selected Python.
> still love the simplification and easy-to-use advantages of Basic.
In my younger days (I am 60 now) well all used Basic. I have to say, Python has similar virtues. It is very close to the algebra. Notably, you don't have to declare variables, you may simply use them. I intended that my readers only install the basic (not BASIC ) Python package. I looked for a graphics, and I found a turtle graphic ready to use. So I can make "illustrations" at least at the C:Basic level.
In around half of the cases I start with C.Basic, because I can take the PPC anywhere, which is very comfortable. In moe complicated cases I start with C++, which is a lot faster too.
Edited by piu58, 09 August 2019 - 03:54 PM.
Posted 10 August 2019 - 03:46 AM
Posted 10 August 2019 - 07:33 AM
I see that there is an editor for Alpha vars and Matrices but I can't find an editor for Lists. Should we enter them programmatically only? {2,3,2,5}->List 1?
Posted 10 August 2019 - 08:20 AM
Hi sentaro21,
Is there any way to check if the calculator has installed subprograms using command?
Like:
'Main program "123" ProgCheck "ABC"'returns 0 or 1 If Ans=0 Then "You have not installed "ABC"!" Else "You have installed "ABC"." Prog "ABC" IfEnd
Regards,
CalcLoverHK
Edited by CalcLoverHK, 10 August 2019 - 08:24 AM.
Posted 10 August 2019 - 10:18 AM
If IsExist("ABC.g1m")=0 Then "You have not installed \"ABC\"!" Else "You have installed \"ABC\"." Prog "ABC" IfEnd
Posted 10 August 2019 - 10:48 AM
> Should we enter them programmatically only? {2,3,2,5}->List 1?
I don't use lists anymore in c.basic. You can use onedimesional matrices which have the advantage to have a letters a name, which may indicate it's use. Lists only have numbers.
Edited by piu58, 10 August 2019 - 04:41 PM.
Posted 10 August 2019 - 03:54 PM
Posted 11 August 2019 - 04:43 PM
I see that in Casio Basic there are Send( and Send38k( commands to communicate with EA200 sampling devices. So they are useless to send files to a connected PC with USB.
Can I use Send commands in C.Basic to send from a C.Basic program a List or a Matrix to the PC through the USB cable? Is there any way to do this? If possible I don't want to use FA -124.
Posted 12 August 2019 - 05:06 AM
Edited by sentaro21, 12 August 2019 - 05:24 AM.
Posted 12 August 2019 - 01:23 PM
Edited by tsiozos, 12 August 2019 - 01:26 PM.
Posted 13 August 2019 - 08:17 AM
Posted 13 August 2019 - 09:00 AM
Posted 13 August 2019 - 12:43 PM
Edited by CalcLoverHK, 13 August 2019 - 12:43 PM.
Posted 14 August 2019 - 12:46 AM
_DispVram
Posted 14 August 2019 - 07:32 AM
Hi sentaro21,
What is the maximum nesting in C.Basic? I don't quite remember.
If it is still 10, then my program may break.
Regards,
CalcLoverHK
Posted 14 August 2019 - 08:20 AM
For~Next While~WhileEnd Do~LpWhile Switch~SwitchEnd
Posted 14 August 2019 - 02:52 PM
#CBINT MOD(-5,3) returns 5. It should return 1 MOD(-6,3) returns 0. Correct. MOD(-7,3) returns 4. It should return 2 MOD(5,3) returns 2. Correct.But when #CBDBL is set, MOD works correctly.
Edited by tsiozos, 14 August 2019 - 05:36 PM.
Posted 15 August 2019 - 05:02 AM
Posted 15 August 2019 - 05:21 AM
Posted 15 August 2019 - 01:20 PM
Posted 16 August 2019 - 12:40 AM
'#CBCPLX 2+4i->c
Edited by sentaro21, 16 August 2019 - 08:06 AM.
General →
Your Projects →
Inside Casio Basic is now to be preparedStarted by Krtyski , 02 Dec 2016 Casio Basic C.Basic |
|
|
0 members, 0 guests, 0 anonymous users