calculator -
Portable calculator built using app.nit
Project structure
calculator_logic
definesCalculatorContext
with all the business logic of a calculator. It takes as input operations and numbers, and outputs the text to display.calculator
implements the portable graphical interface using the app.nit frameworkscientific_calculator
refinescalculator
to add scientific operations.android_calculator
refinescalculator
to get a nicer aesthetic on Android.ios_calculator
refinescalculator
to get a nicer aesthetic on iOS.calculator_test
testCalculatorContext
as a black box.
Compilation
Compile and run on the desktop (GNU/Linux and OS X) with:
bin/calculator
Compile for Android and install on a device or emulator with:
make bin/android.apk adb install -r bin/calculator.apk
Compile for iOS and run on the simulator with:
make bin/android.app ios-sim launch bin/calculator.app
Screenshots
Content
- calculator: Portable calculator built using app.nit (examples/calculator)
- android (examples/calculator/android)
- res (examples/calculator/android/res)
- src (examples/calculator/src)
- android14: Aesthetic variation for Android for API 14+ (examples/calculator/src/android14.nit)
- android21 (examples/calculator/src/android21)
- android (examples/calculator/src/android21/android)
- res (examples/calculator/src/android21/android/res)
- android21: Aesthetic variation for Android Lollypop (API 21) (examples/calculator/src/android21/android21.nit)
- android (examples/calculator/src/android21/android)
- calculator: Portable calculator UI (examples/calculator/src/calculator.nit)
- calculator_logic: Business logic of a calculator (examples/calculator/src/calculator_logic.nit)
- calculator_test: Test the business logic (examples/calculator/src/calculator_test.nit)
- ios: Aesthetic variation for iOS (examples/calculator/src/ios.nit)
- scientific (examples/calculator/src/scientific)
- scientific: Extends the portable calculator app with scientific operations (examples/calculator/src/scientific/scientific.nit)
- android (examples/calculator/android)