Galaxy Merchant Trading Guide with python

Overview

GALAXY MERCHANT TRADING GUIDE

Permasalahan

Anda memutuskan untuk pergi dari bumi setelah keruntuhan finansial terbaru meninggalkan
99,99% populasi bumi dengan 0,01% dari kekayaan. Untungnya, dengan sedikit uang yang tersisa
di rekening, Anda mampu menyewa pesawat ruang angkasa, meninggalkan bumi, dan terbang ke
seluruh galaksi untuk menjual logam dan kotoran (yang tampaknya sangat berharga).
Jual beli di seluruh galaksi mengharuskan Anda untuk mengubah angka dan unit, Anda akhirnya
memutuskan untuk menulis program untuk membantu Anda.
Angka yang digunakan untuk transaksi intergalaksi mengikuti konvensi yang mirip dengan angka
romawi dan tanpa program, Anda kesusahan mengumpulkan terjemahan yang sesuai di antara
mereka. Angka romawi adalah berdasarkan tujuh simbol dibawah ini :
Symbol Value
I 1
V 5
X 10
L 50
C 100
D 500
M 1,000
Angka dibentuk dengan menggabungkannya dengan simbol dan menjumlahkan nilainya. Misalnya,
MMVI adalah 1000 + 1000 + 5 + 1 = 2006. Umumnya, simbol ditempatkan dalam urutan nilai,
dimulai dengan nilai terbesar. Saat nilai yang lebih kecil mendahului nilai yang lebih besar, nilai
yang lebih kecil akan dikurangi nilai yang lebih besar, dan hasilnya ditambahkan ke total. Misalnya
MCMXLIV = 1000 + (1000 - 100) + (50 - 10) + (5 - 1) = 1944.
Simbol "I", "X", "C", dan "M" dapat diulang tiga kali berturut-turut, tetapi tidak boleh
lebih. (Mereka dapat muncul empat kali jika yang ketiga dan keempat dipisahkan oleh nilai yang
lebih kecil, seperti XXXIX.)
"D", "L", dan "V" tidak pernah bisa diulang.
"I" hanya dapat dikurangi dari "V" dan "X". "X" hanya dapat dikurangi dari "L" dan "C". "C" bisa
dikurangi dari "D" dan "M" saja. "V", "L", dan "D" tidak pernah bisa dikurangi.
Hanya satu simbol dengan nilai kecil yang dapat dikurangkan dari simbol denga nilai besar mana
pun.
Angka yang ditulis dalam angka arab dapat dipecah menjadi beberapa digit. Misalnya, 1903 terdiri
dari 1, 9, 0, dan 3. Untuk menulis angka romawi, setiap angka bukan nol harus diperlakukan secara
terpisah.
Dalam contoh di atas, 1.000 = M, 900 = CM, dan 3 = III. Oleh karena itu, 1903 = MCMIII.
- Sumber: Wikipedia ( http://en.wikipedia.org/wiki/Roman_numerals )
Test Input:
-------------
glob is I
prok is V
pish is X
tegj is L
glob glob Silver is 34 Credits
glob prok Gold is 57800 Credits
pish pish Iron is 3910 Credits
how much is pish tegj glob glob ?
how many Credits is glob prok Silver ?
how many Credits is glob prok Gold ?
how many Credits is glob prok Iron ?
how much wood could a woodchuck chuck if a woodchuck could chuck wood ?
Expecting Output:
---------------
pish tegj glob glob is 42
glob prok Silver is 68 Credits
glob prok Gold is 57800 Credits
glob prok Iron is 782 Credits
I have no idea what you are talking about

Solusi

Identifikasi pola input

Input dari permasalahan ini dapat dibagi menjadi 5 kategori, yaitu :

  1. Definisi alias
    input :

    glob is I
    prok is V
    pish is X
    tegj is L
    

    Pola : [alias] is [simbol_romawi]
    Pola jenis ini akan memberikan nama lain/alias dari simbol romawi (I-M).

  2. Definisi metal
    input:

    glob glob Silver is 34 Credits
    glob prok Gold is 57800 Credits
    pish pish Iron is 3910 Credits
    

    Pola input ini adalah : [alias] is [angka] Credits

  3. Jawab pertanyaan how many
    input:

    how many Credits is glob prok Silver ?
    how many Credits is glob prok Gold ?
    how many Credits is glob prok Iron ?
    

    Pola : [h/H]ow many Credits is [alias] [nama_metal] ?

  4. Jawab pertanyaan how much
    input:

    how much is pish tegj glob glob ?
    

    Pola : [h/H]ow much is [alias] ?

  5. Input tidak diketahui
    input:

    how much wood could a woodchuck chuck if a woodchuck could chuck wood ?
    

    Pola : Tidak cocok dengan semua pola diatas

Penanganan Input

Ide nya adalah menerapkan algoritma yang berbeda setiap kategori input. Penggolongan input adalah tanggung jawab dari Input Pattern Detector. Setelah input diketahui kategorinya, maka akan diberikan algoritma yang berbeda (see: Currency calculator ).

Rancangan aplikasi

Aplikasi android terdiri dari dua modul, yaitu :app dan :currency_converter. Semua proses logic penanganan permasalahan akan dilakukan di modul :currency_converter, sehingga modul :app hanya perlu memanggil fungsi .convert(text) untuk mendapatkan output dari text didalam editText dan menampilkannya ke textView.

You might also like...
Fuzzy string matching for Kotlin (JVM, native, JS, Web Assembly) - port of Fuzzy Wuzzy Python lib

FuzzyWuzzy-Kotlin Fuzzy string matching for Kotlin (JVM, iOS) - fork of the Java fork of of Fuzzy Wuzzy Python lib. For use in on JVM, Android, or Kot

Android app and Python library for turning mobile phone into a WebSocket-based, remotely controllable Barcode/QR code reader

Remote Barcode Reader suite Android app and Python library for turning mobile phone into a remotely controllable Barcode/QR code reader. It exposes a

Text to Speech Project for Spring Boot and Kotlin, Auth Server, Python with Fast API (gTTS)
Text to Speech Project for Spring Boot and Kotlin, Auth Server, Python with Fast API (gTTS)

TTS-App Text to Speech Project for Spring Boot and Kotlin, Auth Server, Python with Fast API (gTTS) Python의 gTTS lib를 활용하여 텍스트를 음성으로 변환하는 서비스를 구현해봅니다.

A Python native extension written in Kotlin Native

Kotlin Python Ext This is a proof of concept for a Python extension in Kotlin. It is recommended to read the Official Python C API Documentation befor

This is an example for running a Python library (mishkal) in Android using chaquopy
This is an example for running a Python library (mishkal) in Android using chaquopy

chaquopy-mishkal This is an example for running a Python library (mishkal) in Android using chaquopy Code All the code that has been added to run the

The KPy gradle plugin allows you to write Kotlin/Native code and use it from python.

The KPy gradle plugin allows you to write Kotlin/Native code and use it from python.

Ejemplo de cómo trabajar con DataFrames similar a Pandas (python) en Kotlin.
Ejemplo de cómo trabajar con DataFrames similar a Pandas (python) en Kotlin.

Kotlin DataFrames Pandas Ejemplo de cómo trabajar con DataFrames similar a Pandas (python) en Kotlin. Kotlin DataFrames Pandas Acerca de Autor Contact

Bandicoot an open-source python toolbox to analyze mobile phone metadata
Bandicoot an open-source python toolbox to analyze mobile phone metadata

bandicoot is Python toolbox to analyze mobile phone metadata. It provides a complete, easy-to-use environment for data-scientist to analyze mobile phone metadata. With only a few lines of code, load your datasets, visualize the data, perform analyses, and export the results.

A runtime mobile application analysis toolkit with a Web GUI, powered by Frida, written in Python.
A runtime mobile application analysis toolkit with a Web GUI, powered by Frida, written in Python.

___ ___ / | \ ____ __ __ ______ ____ / ~ \/ _ \| | \/ ___// __ \ \ Y ( _ )

Silver is a programming language designed to have the look and feel of python combined with the simplicity and efficiency of C, combined with a rich plugin system for extending the capabilities of the language
Silver is a programming language designed to have the look and feel of python combined with the simplicity and efficiency of C, combined with a rich plugin system for extending the capabilities of the language

Silver Programming Language Silver is a programming language designed to resemble Python with some C features, packed with a rich plugin system. Contr

A PyCharm plugin that implements inlay parameter and type annotation hints for Python.
A PyCharm plugin that implements inlay parameter and type annotation hints for Python.

Python Inlay Params Quick Installation Using IDE built-in plugin system: Settings/Preferences Plugins Marketplace Search for "Python Inlay Param

A spring indicator like Morning Routine guide.
A spring indicator like Morning Routine guide.

SpringIndicator An indicator like Morning Routine guide.It was originally based on BezierDemo. The sample app: click me #Usage Add the dependency to y

Combine ViewPager and Animations to provide a simple way to create applications' guide pages.
Combine ViewPager and Animations to provide a simple way to create applications' guide pages.

WoWoViewPager WoWoViewPager combines ViewPager and Animations to provide a simple way to create applications' guide pages. When users are dragging WoW

****. Use the native and support library variants instead - https://developer.android.com/guide/topics/ui/look-and-feel/fonts-in-xml.html. An android library that makes it easy to add custom fonts to edittexts and textviews

Add to your project Add this line to your dependencies in build.gradle compile 'in.workarounds.typography:typography:0.0.8' Using the views There are

Code Guide: How to create Snapchat-like image stickers and text stickers.
Code Guide: How to create Snapchat-like image stickers and text stickers.

MotionViews-Android Code Guide : How to create Snapchat-like image stickers and text stickers After spending 2000+ hours and releasing 4+ successful a

Combine ViewPager and Animations to provide a simple way to create applications' guide pages.
Combine ViewPager and Animations to provide a simple way to create applications' guide pages.

WoWoViewPager WoWoViewPager combines ViewPager and Animations to provide a simple way to create applications' guide pages. When users are dragging WoW

Guide to setup JetBrains Projector and access Android Studio from any device
Guide to setup JetBrains Projector and access Android Studio from any device

JetBrains Projector with Android Studio Guide to setup JetBrains Projector and access Android Studio from any device. Blog post Android Studio on an i

Ricky and Morty episode guide using KMM and Apollo GraphQL Native

Ricky And Morty Episodes - Kmm Ricky and Morty episode guide using KMM and Apollo GraphQL Native This is a simple guide on how to create an KMM projec

Dagger Hilt Tutorial - Step by Step Guide

Dagger Hilt Tutorial - Step by Step Guide This repository contains a sample app that implements Dagger-Hilt in MVVM architecture using Kotlin. The app

Owner
a beginner software craftsmanship
null
an open source algorithmic trading framework written in Kotlin for anyone serious about algo-trading

Roboquant Roboquant is an algorithmic trading platform that is fast and flexible while at the same time strives to be easy to use. It is fully open so

Neural Layer 132 Jan 2, 2023
One merchant integration point for all of PayPal's services

android-sdk [WIP] One merchant integration point for all of PayPal's services Static Analysis Tools Detekt This project uses Detekt for Kotlin code an

PayPal 23 Dec 20, 2022
Android application allowing to sniff and inject Zigbee, Mosart and Enhanced ShockBurst packets on a Samsung Galaxy S20

This Android application allows to sniff and inject Zigbee, Mosart and Enhanced ShockBurst packets from a Samsung Galaxy S20 smartphone. It interacts with a set of patches installed on the phone Bluetooth controller, allowing to add new capabilities to communicate using the previously mentioned protocols.

Romain Cayre 52 Nov 1, 2022
Jetpack Compose Desktop Galaxy Example

Compose-StarWars Compose-StarWar 3D Space particle System build using Canvas API Jetpack Compose Desktop ?? How to Run From gradle tab from right-hand

Chetan Gupta 14 Sep 21, 2022
Boring trading log to track yearly profits and current portfolio.

Boring trading log to track yearly profits and current portfolio. May be useful for tax reports. It should be able to import Coinbase and Binance repo

Marco Bortolan 1 Nov 21, 2021
Vkontakte API bot for trading VK Coin

Sweet Coin Market Vkontakte API bot for trading VK Coin. Please star this repo if you like ⭐ It's motivates me a lot! Yes, you can use the source code

null 2 Jan 28, 2022
Analytics for Trading with NOA

Analytics for Trading using NOA In this repository we present a few examples for trading analytics that leverage the nonlinear optimisation platform N

Roland Grinis 24 Oct 3, 2022
Simple Trading / Stock market app

Trading App Uses the Investors Exchange api to get a list of stock data in CSV to json format. The list of stocks is displyed in the first screen. Cli

ᒪᗩ᙭ᗰᎥ ᛕᗩᑎ丅 2 Jun 23, 2022
Kotlin HTTP requests library. Similar to Python requests.

khttp khttp is a simple library for HTTP requests in Kotlin. It functions similarly to Python's requests module. import khttp.get fun main(args: Arra

Anna Clemens 466 Dec 20, 2022
enjarify 8.6 0.0 L5 Python Enjarify is a tool for translating Dalvik bytecode to equivalent Java bytecode. This allows Java analysis tools to analyze Android applications.

Note: This repository may be out of date. Future development will occur at https://github.com/Storyyeller/enjarify. Introduction Enjarify is a tool fo

Google 2.7k Jan 8, 2023