mirror of
https://github.com/opus-tango/B12NumbersV3.git
synced 2026-03-20 03:55:20 +00:00
Compare commits
13 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5135e3ad90 | ||
|
|
60de46a657 | ||
|
|
a586ace0ad | ||
|
|
659c6fba50 | ||
|
|
2e54b39771 | ||
|
|
7311164c47 | ||
|
|
ff5ac1f410 | ||
|
|
439d5c4161 | ||
|
|
a621b36d5c | ||
|
|
19d7c18233 | ||
|
|
84aa477af9 | ||
|
|
0a7a63c3ba | ||
|
|
1a90ebec25 |
@@ -1,3 +1,17 @@
|
|||||||
|
/**
|
||||||
|
* Base 12 Toolkit
|
||||||
|
* Nayan Sawyer
|
||||||
|
* May 21 2022
|
||||||
|
*
|
||||||
|
* Comments/Reflections: The calculator uses B12Expression, MathPad, B12Button, and MathDisplay.
|
||||||
|
* The clock app uses Clock, Stopwatch, Timer, and TimeDisplay
|
||||||
|
*
|
||||||
|
* This project uses method relay code by Quark that has been modified
|
||||||
|
* - see https://forum.processing.org/two/discussion/13093/how-to-call-function-by-string-content.html for the source code
|
||||||
|
* This project uses the exp4j library unmodified, which is available under the Apache 2.0 license
|
||||||
|
* - see https://www.objecthunter.net/exp4j/index.html
|
||||||
|
*/
|
||||||
|
|
||||||
import net.objecthunter.exp4j.*; // Math expression evaluation library
|
import net.objecthunter.exp4j.*; // Math expression evaluation library
|
||||||
|
|
||||||
// B12NumbersV3 //
|
// B12NumbersV3 //
|
||||||
|
|||||||
@@ -1,70 +0,0 @@
|
|||||||
/*
|
|
||||||
B12NumbersV3
|
|
||||||
Beta version of a clock in base 12.
|
|
||||||
by Nayan Sawyer
|
|
||||||
started Mar 2022
|
|
||||||
version 0.1.4.3 April 30 2022
|
|
||||||
|
|
||||||
Characters are a variation of Kaktovik Inupiaq numerals
|
|
||||||
reversed and in base 12 instead of 20. I take no credit
|
|
||||||
for the design.
|
|
||||||
Includes method relay code be Quark - see https://forum.processing.org/two/discussion/13093/how-to-call-function-by-string-content.html
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
changelog 0.1.4.0
|
|
||||||
- Added MethodRelay code from Quark. Some fixes and
|
|
||||||
changes as well. Condesed some things into fewer files
|
|
||||||
for so the ide is easier to use, but they will be moved
|
|
||||||
back into their own files as version 1.0 approaches.
|
|
||||||
Everything is prep for adding gui elements (MethodRelay
|
|
||||||
included)
|
|
||||||
|
|
||||||
changelog 0.1.3
|
|
||||||
- Deprecated B12Char by rolling it's code into B12Digit.
|
|
||||||
Makes for easier to handle arrays, and will hopefully
|
|
||||||
make implementing the math functionality much easier.
|
|
||||||
It appears that only Clock may need true refactoring to
|
|
||||||
make the most of this change. B12Int and B12Float seem
|
|
||||||
to be fine with simply swithing out the reference.
|
|
||||||
*/
|
|
||||||
|
|
||||||
float scale = 2;
|
|
||||||
PVector offset;
|
|
||||||
float sMouseX;
|
|
||||||
float sMouseY;
|
|
||||||
public static final int DECIMAL = 65;
|
|
||||||
ClickHandler ch; // Mouse event handler
|
|
||||||
|
|
||||||
Calculator calc; ///blblblblb //<>//
|
|
||||||
|
|
||||||
void setup(){
|
|
||||||
size(400,400);
|
|
||||||
offset = new PVector(width/2, height/2);
|
|
||||||
ch = new ClickHandler();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void draw(){
|
|
||||||
background(196);
|
|
||||||
sMouseX = (mouseX - offset.x)/scale;
|
|
||||||
sMouseY = (mouseY - offset.y)/scale;
|
|
||||||
translate(offset.x,offset.y);
|
|
||||||
scale(scale);
|
|
||||||
point(0,0);
|
|
||||||
m.display();
|
|
||||||
clock.display();
|
|
||||||
//p.display();
|
|
||||||
t.display();
|
|
||||||
//println( + " " + ;
|
|
||||||
}
|
|
||||||
|
|
||||||
void mouseClicked(){
|
|
||||||
//clock.setTime(new Time48(16,0,0));
|
|
||||||
|
|
||||||
// Every clickable element needs check whether the mouse is over it every frame, and if both clicked and mouseover then do action.
|
|
||||||
ch.cascade(sMouseX, sMouseY);
|
|
||||||
}
|
|
||||||
|
|
||||||
void call(String _call){
|
|
||||||
method(_call);
|
|
||||||
}
|
|
||||||
@@ -24,7 +24,7 @@ class MathPad{
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void initialize(){
|
private void initialize(){
|
||||||
buttons = new Button[0];
|
buttons = new Button[0];
|
||||||
// Create numpad buttons
|
// Create numpad buttons
|
||||||
for(int i = 0; i < 12; i++){
|
for(int i = 0; i < 12; i++){
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ class Timer{
|
|||||||
Timer setPos(PVector _pos){pos = _pos.copy(); initialize(); return this;}
|
Timer setPos(PVector _pos){pos = _pos.copy(); initialize(); return this;}
|
||||||
Timer setPos(float x, float y){pos = new PVector(x,y); initialize(); return this;}
|
Timer setPos(float x, float y){pos = new PVector(x,y); initialize(); return this;}
|
||||||
|
|
||||||
void initialize(){
|
private void initialize(){
|
||||||
buttons = new Button[0];
|
buttons = new Button[0];
|
||||||
td.setPos(pos.x + 13*4 + 2,pos.y-2);
|
td.setPos(pos.x + 13*4 + 2,pos.y-2);
|
||||||
// Create numpad buttons
|
// Create numpad buttons
|
||||||
@@ -119,11 +119,11 @@ class Timer{
|
|||||||
colorMode(RGB,255);
|
colorMode(RGB,255);
|
||||||
fill(255,0,0);
|
fill(255,0,0);
|
||||||
rectMode(CORNERS);
|
rectMode(CORNERS);
|
||||||
rect(-13*5,-20,13*5,0);
|
rect(pos.x - 13*5,pos.y - 20,pos.x + 13*5,pos.y);
|
||||||
fill(0);
|
fill(0);
|
||||||
textSize(16);
|
textSize(16);
|
||||||
textAlign(CENTER,BOTTOM);
|
textAlign(CENTER,BOTTOM);
|
||||||
text("Timer Done!",0,0);
|
text("Timer Done!",pos.x,pos.y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
/*
|
/*
|
||||||
B12NumbersV3
|
B12NumbersV3
|
||||||
Beta version of a clock in base 12.
|
Beta version of a clock and calculator in base 12.
|
||||||
by Nayan Sawyer
|
by Nayan Sawyer
|
||||||
started Mar 2022
|
started Mar 2022
|
||||||
version 1.0.0.0 May 20 2022
|
version 1.0.0.2 Oct 28 2022
|
||||||
|
|
||||||
Characters are a variation of Kaktovik Inupiaq numerals
|
Characters are a variation of Kaktovik Inupiaq numerals,
|
||||||
reversed and in base 12 instead of 20. I take no credit
|
the orientation of which has been flipped and in base 12
|
||||||
for the design.
|
instead of 20. I take no credit for the design.
|
||||||
Includes method relay code by Quark - see https://forum.processing.org/two/discussion/13093/how-to-call-function-by-string-content.html
|
Includes method relay code by Quark - see https://forum.processing.org/two/discussion/13093/how-to-call-function-by-string-content.html
|
||||||
for more details, and the library exp4j for evaluating mathematical expressions.
|
for more details. Also includes the library exp4j for evaluating mathematical expressions.
|
||||||
|
|
||||||
// DONE put everything back into seperate tabs
|
// DONE put everything back into seperate tabs
|
||||||
// DONE fully document everything
|
// DONE fully document everything
|
||||||
@@ -28,6 +28,15 @@
|
|||||||
- Time48 does not check its inputs in some constructors
|
- Time48 does not check its inputs in some constructors
|
||||||
- renderPriority in Button is only half implemented
|
- renderPriority in Button is only half implemented
|
||||||
- negative signs when timer ends (not urgent)
|
- negative signs when timer ends (not urgent)
|
||||||
|
- B12Digit.setValue() does not check input and only accepts ints
|
||||||
|
- B12Digit.getValue() returns int not byte
|
||||||
|
|
||||||
|
changelog 1.0.0.2
|
||||||
|
- Added license and updated main B12NumbersV3 text header
|
||||||
|
|
||||||
|
changelog 1.0.0.1
|
||||||
|
- Some bug fixes, made more things private, and fixed
|
||||||
|
timer
|
||||||
|
|
||||||
changelog 1.0.0.0
|
changelog 1.0.0.0
|
||||||
- Finished project to fully working state. Still lots of
|
- Finished project to fully working state. Still lots of
|
||||||
|
|||||||
29
LICENSE
Normal file
29
LICENSE
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
BSD 3-Clause License
|
||||||
|
|
||||||
|
Copyright (c) 2022, Nayan Sawyer
|
||||||
|
All rights reserved.
|
||||||
|
|
||||||
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
modification, are permitted provided that the following conditions are met:
|
||||||
|
|
||||||
|
1. Redistributions of source code must retain the above copyright notice, this
|
||||||
|
list of conditions and the following disclaimer.
|
||||||
|
|
||||||
|
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||||
|
this list of conditions and the following disclaimer in the documentation
|
||||||
|
and/or other materials provided with the distribution.
|
||||||
|
|
||||||
|
3. Neither the name of the copyright holder nor the names of its
|
||||||
|
contributors may be used to endorse or promote products derived from
|
||||||
|
this software without specific prior written permission.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||||
|
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||||
|
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||||
|
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||||
|
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
|
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
23
README.md
23
README.md
@@ -1,16 +1,19 @@
|
|||||||
# B12NumbersBeta1
|
# B12NumbersV3
|
||||||
The characters are designed after the ingenious Kaktovik Iñupiaq numerals, which were created by a group of middle schoolers in Kaktovik Alaska, to represent the base 20 counting system in Iñupiaq, their Inuit language.
|
Release version 1.0.0.1 now available! see [releases](https://github.com/GShadow5/B12NumbersBeta1/releases) for a download
|
||||||
|
|
||||||
I take no credit for the design of the characters. I have merely co-opted the design for the development of this project because it is elegant and convenient to use for compound base number systems, and looks nothing like the Arabic numeral system.
|
Read the full write up on my blog [here](http://localhost:4321/blog/portfolio/b12numbersv3?referrer=github)!
|
||||||
|
|
||||||
The project is currently in the stage where I am building all of the component parts, so the code does not yet do much when run.
|
Note - changes after 1.0.0.1 are source code text only, and do not impact the release version
|
||||||
|
|
||||||
The time system is now complete with robust syncing and offset features. The base 12 time system works slightly differently from our regular base 60 time.
|
This is a basic clock and calculator app that represents all numbers using base 12. The characters are designed after the ingenious Kaktovik Iñupiaq numerals, which were created by a group of middle schoolers in Kaktovik Alaska, to represent the base 20 counting system in Iñupiaq, their Inuit language. I take no credit for the design of the characters. I have merely co-opted the design for the development of this project because it is elegant and convenient to use for compound base number systems, and looks nothing like the Arabic numeral system.
|
||||||
|
|
||||||
Hours are still 24, but because it's in base 12, 10 is noon.
|
The current functionality includes a clock, stopwatch, and timer, all of which run slower than normal time, as days are broken into 24 hours/day, 48 minutes/hour, and 48 seconds/minute. Also included is a calculator for doing math operations in base 12.
|
||||||
Minutes: there are now 48 minutes in an hour
|
|
||||||
Seconds: there are now 48 seconds in a minute
|
|
||||||
|
|
||||||
The number system is such that horizontal ticks on top represent multiples of four, and vertical ticks represent multiples of one. Decimal 11 is 2 horizontal ticks, and 3 vertical ticks. However, since the project is in an alpha state, I will not go into great detail at this point.
|
The number system is such that horizontal ticks on top represent multiples of four, and vertical ticks represent multiples of one. Decimal 11 is 2 horizontal ticks, and 3 vertical ticks. (8 + 3)
|
||||||
|
|
||||||
The calculator input system is now working. For an early beta demo see [releases](https://github.com/GShadow5/B12NumbersBeta1/releases)
|
I had grander plans for this program, but once I got into the details of how to construct event handlers for the mouse, and discovered that singletons are not allowed in Processing, I decided to postpone this project indefinitely. I am currently learning Vulkan and C++, and I hope to do more UI stuff using that at some point in the future, so I will probably remake this project someday, but until then this is all there is.
|
||||||
|
|
||||||
|
## How to run
|
||||||
|
If you have Processing installed all you need to do is download the source code and open B12NumbersV3.pde in the Processing IDE
|
||||||
|
|
||||||
|
Alternatively, if you are on windows you can download the release version from the [releases](https://github.com/GShadow5/B12NumbersBeta1/releases) page, unzip it, and run the .exe file.
|
||||||
|
|||||||
Reference in New Issue
Block a user