Les membres ayant 30 points peuvent parler sur les canaux annonces, projets et hs du chat.
La shoutbox n'est pas chargée par défaut pour des raisons de performances. Cliquez pour charger.

Forum Casio - Projets de programmation


Index du Forum » Projets de programmation » Duvet, a spreadsheet alternative
Calamari Hors ligne Membre Points: 397 Défis: 0 Message

Duvet, a spreadsheet alternative

Posté le 25/10/2024 19:38

Duvet
Duvet is a spreadsheet add-in for Casio fx-9860G or later (including Slim), both mono and color calculators, as an alternative to Casio's built in spreadsheet/S-SHT app.



Motivation
The initial idea for writing a spreadsheet add-in came because, at the time, the Math+ didn't provide a spreadsheet app. I was also interested to see whether a spreadsheet could be made to be Turing-complete with a SET(column, row, value) formula. Additionally, S-SHT was very slow and I wondered if I could do better. However, Casio announced a spreadsheet for Math+ and other projects were more interesting, so it got shelved. The project was revived when I received my fx-CG50 and my CPC game entry would load, but could not be edited without a math error, despite working (albeit very slowly) on the fx-9750GIII and even working on the fx-9860G Slim. In order to get the game working on the fx-CG50, I had to delete over 500 cells. And, even then, it was still quite slow. I wanted my game to be playable on all calculators, so I challenged myself to write a spreadsheet add-in before CPC 31.

Goals
My goals for Duvet are:

1. Faster calculation than S-SHT. Duvet uses integer math, when possible, and the plan is to examine floating point results and return them back to integers, when possible. For example, 10 / 2 = 5.0, but 5.0 == 5, so it can remain an integer, and cos(0) = 1. Currently, Duvet calculates my CPC entry, a sheet containing around 1000 formula cells, in a fraction of a second, compared to approximately 7 seconds in S-SHT on an fx-9750GIII. Video from an earlier build (fx-9750GIII and S-SHT on the left, fx-9860G Slim and Duvet on the right):

2. Provide a larger sheet area than S-SHT, using sparse cells. Currently, Duvet allows 26 columns (A-Z) and 2048 rows.

3. Be compliant with some subset of ODF types, operators and formulas. In particular, I want to allow formulas involving TEXT fields, which isn't possible in S-SHT.

4. Turing-completeness, by way of a SET(column,row,value) formula.

5. File import/export. Formats to be determined, but at least CSV import/export.

6. Best effort: due to spreadsheets often being used for financial calculations, I'd like to use decimal64 floats (or an equivalent) rather than using double. The decimal library I was planning on using (libdfp)) is not available for SuperH, and I need to investigate the feasibility of porting it.

Notably, it is not a goal to perfectly replicate the UI or feature set of Casio's S-SHT. For example, the UI has already diverged slightly, the menus and key input are going to be different, and I don't currently plan on implementing graphing, regressions, list import/export, etc. Nor is it a goal to be 100% Open Document Format or OpenFormula compliant. However, I'll strive (best effort) for subset compliance as far as being able to export a LibreOffice sheet to CSV and have some subset of OpenFormula formulas, operators, and data types work without changes.

Formulas
All formulas are currently limited to 64-bit integer math:

• ABS(integer) → integer
• BITAND(integer,integer) → integer
• BITLSHIFT(integer,integer) → integer
• BITOR(integer,integer) → integer
• BITRSHIFT(integer,integer) → integer
• BITXOR(integer,integer) → integer
• FALSE() → integer
• IF(integer,integer,integer) → integer
• ISEVEN(integer) → integer
• ISODD(integer) → integer
• MOD(integer,integer) → integer
• NOT(integer) → integer
• SIGN(integer) → integer
• SUM(range) → integer
• TRUE() → integer

Formulas Planned
This is just an initial list of formulas where integer math can be used; there will be more once I implement the NUMBER type and determine which TEXT operations are feasible:

AND(range), AVERAGE(range), DELTA(a,b), FACT(integer), GCD(range), LCM(range), MAX(range), MIN(range), OR(range), POWER(integer,integer), PRODUCT(range), QUOTIENT(integer,integer), RANDBETWEEN(integer,integer), SET(column,row,value), XOR(range)

Operators
Listed in order of precedence, highest first:

• (integer) → integer
• -integer → integer, +integer → integer
• integer^integer → integer
• integer*integer → integer, integer/integer → integer
• integer+integer → integer, integer-integer → integer
• integer=integer → integer, integer<>integer → integer, integer<integer → integer, integer<=integer → integer, integer>integer → integer, integer>=integer → integer

Limitations
Currently Duvet is extremely limited. It can play my CPC #31 entry, but that's about it:

• Cannot create new sheets.
• Sheets cannot be edited, except for cells containing integers (and also 64-bit integers cannot currently be edited).
• Cells cannot be created, deleted, edited to become empty, copied, moved, etc.
• Only loads and saves spreadsheets in a proprietary format.
• Floating point math is not available (needed for Video Poker)
• A Ran# substitute is not available (also needed for Video Poker)

Name
The name is meant to be silly. In British English, a duvet (or "duvet cover" here in USA) is a comforter, often used instead of a bedsheet ("sheet"). So, the name represents the idea of Duvet replacing S-SHT. And the name also appeals to me because it's a word common to both French and English.

Source Code
https://git.planet-casio.com/calamari/Duvet


Mb88 Hors ligne Rédacteur Points: 1211 Défis: 3 Message

Citer : Posté le 25/10/2024 19:49 | #


Seems really impressive. The name is really cool! I hope that you'll be able to make it Turing complete (I'm obsessed with that ).
Bibizen Hors ligne Membre Points: 9 Défis: 0 Message

Citer : Posté le 27/10/2024 12:59 | #


Great news, Duvet is a funny name (so soft), thanks for thinking of a French name
about S-SHT I am stuck on the missing search function (CTRL + F in Excel)
I'm confident Duvet will be a great alternative
Cls:Lbl 0:Plot ◢ X→A:Y→B:Plot ◢ Plot A,B:Line:Goto 0

LienAjouter une imageAjouter une vidéoAjouter un lien vers un profilAjouter du codeCiterAjouter un spoiler(texte affichable/masquable par un clic)Ajouter une barre de progressionItaliqueGrasSoulignéAfficher du texte barréCentréJustifiéPlus petitPlus grandPlus de smileys !
Cliquez pour épingler Cliquez pour détacher Cliquez pour fermer
Alignement de l'image: Redimensionnement de l'image (en pixel):
Afficher la liste des membres
:bow: :cool: :good: :love: ^^
:omg: :fusil: :aie: :argh: :mdr:
:boulet2: :thx: :champ: :whistle: :bounce:
valider
 :)  ;)  :D  :p
 :lol:  8)  :(  :@
 0_0  :oops:  :grr:  :E
 :O  :sry:  :mmm:  :waza:
 :'(  :here:  ^^  >:)

Σ π θ ± α β γ δ Δ σ λ
Veuillez donner la réponse en chiffre
Vous devez activer le Javascript dans votre navigateur pour pouvoir valider ce formulaire.

Si vous n'avez pas volontairement désactivé cette fonctionnalité de votre navigateur, il s'agit probablement d'un bug : contactez l'équipe de Planète Casio.

Planète Casio v4.3 © créé par Neuronix et Muelsaco 2004 - 2024 | Il y a 90 connectés | Nous contacter | Qui sommes-nous ? | Licences et remerciements

Planète Casio est un site communautaire non affilié à Casio. Toute reproduction de Planète Casio, même partielle, est interdite.
Les programmes et autres publications présentes sur Planète Casio restent la propriété de leurs auteurs et peuvent être soumis à des licences ou copyrights.
CASIO est une marque déposée par CASIO Computer Co., Ltd