
# Cardano Example Dapp

## **Array Manipulation Functions**

This demo will test and explore basic array convertion and manipulation functions


## Try it online: 

-  Visit [HTML+JS Dapp](https://gamechangerfinance.github.io/gamechanger.wallet/examples/Array%20Manipulation%20Functions.html)
-  Visit [HTML+React Dapp](https://gamechangerfinance.github.io/gamechanger.wallet/examples/Array%20Manipulation%20Functions_react.html)
-  Visit [Native HTML dapp](https://gamechangerfinance.github.io/gamechanger.wallet/examples/Array%20Manipulation%20Functions_nolib.html)
-  Run [Standalone URL dapp connection](https://wallet.gamechanger.finance/api/2/run/1-H4sIAAAAAAAAA7VUwYrbMBD9FeGLNjBgtWm3Jbely55aKKU9hRwUW9moKJaQ5LZLyL93ZLuOJNsLS1tjgea9NzNPwuNz4aVXotgUd9byJ_KJN9K0inupG_LQNlXYuAKKWrjKShNCFH89SkdqcdLkp1SKeOE84U1NxC-jtBVkz52sCO9KVrr5IWxXMEhOcYdD1ME_meCjb4Mx1tLW37k_3tw99kPcCt_a5tuXj5-598IGO0fvzaYsla64OmrnN2vGWBn8ldzIsubGhMQWteeideIDd8KF_dDzxCurr4pH4buON2yF5DkKLygaQ8ppygcgUbC8wKTCtEReAwAYLkh1I5prKZ0VD3CiTkUd54yS_oYCBUJ7ZymSa2AqghnVnGzQfdey6aGrk048SyT-42tNz5Iw8zndRS9k9dxCrxWM-1fwOorW8AbeRvEtvIP3i8ZeWmbpFDSS0j3eV5UgNSIC1yFBHxE54pLPXMFfF37m3v-T5X_j-fqVUg57qKAGkX-_MZPl4JiNJEy__CmfTMHVFoXh5bj6s8B4guHNJuWlyaHzQYW_aNP_DMYgZlhCsYTLZnYGnlWzBTlL9VucjB1s17DFkdjt4HY-K5-fcRsGaYVZl-KCz28AFppZ6wYAAA)

## Source code:

- dapp connection code: [GCScript DSL](Array%20Manipulation%20Functions.gcscript)
- frontend (using @gamechanger-finance/gc): [HTML+JS dapp](Array%20Manipulation%20Functions.html)
- frontend (using @gamechanger-finance/gc): [HTML+React dapp](Array%20Manipulation%20Functions_react.html)
- frontend (without official library): [Native HTML dapp](Array%20Manipulation%20Functions_nolib.html)

Dapp code was autogenerated by [Playground IDE in GameChanger Wallet ](https://wallet.gamechanger.finance/playground)

## GCScript code (dapp connection):
```json
{
  "title": "Array Manipulation Functions",
  "description": "This demo will test and explore basic array convertion and manipulation functions",
  "type": "script",
  "exportAs": "ArraysDemo",
  "returnURLPattern": "http://localhost:3000/demo/api/dapp",
  "run": {
    "useCases": {
      "type": "macro",
      "run": {
        "getArray(0)": "{getArray(0)}",
        "getArray('a')": "{getArray('a')}",
        "getArray(00)": "{getArray(00)}",
        "getArray('aa')": "{getArray('aa')}",
        "getArray(,,,0,,,,)": "{getArray(,,,0,,,,)}",
        "getArray(,,,'',,,,)": "{getArray(,,,'',,,,)}",
        "getArray()": "{getArray()}",
        "split(',', '')": "{split(',', '')}",
        "split(',', ',')": "{split(',', ',')}",
        "split(',', ',,')": "{split(',', ',,')}",
        "join(',', getArray())": "{join(',', getArray())}",
        "getArray(getArray(00))": "{getArray(getArray(00))}",
        "getArray(getArray('aa'))": "{getArray(getArray('aa'))}",
        "getArray(getArray(0),getArray(1,2),getArray(3,4,5),getArray(6,7,8))": "{getArray(getArray(0),getArray(1,2),getArray(3,4,5),getArray(6,7,8))}",
        "getArray(getArray('a'),getArray('b','c'),getArray('d','e','f'),getArray('g','h','i'))": "{getArray(getArray('a'),getArray('b','c'),getArray('d','e','f'),getArray('g','h','i'))}",
        "getArray(getArray('aa'),getArray('b','c'),getArray('d','e','f'),getArray('g','h','i'))": "{getArray(getArray('aa'),getArray('b','c'),getArray('d','e','f'),getArray('g','h','i'))}",
        "split(',','a,b,c,d,e')": "{split(',','a,b,c,d,e')}",
        "split(',',',,,a,b,c,d,e,,,')": "{split(',',',,,a,b,c,d,e,,,')}",
        "join(',',getArray('','','','a','b','c','d','e','','',''))": "{join(',',getArray('','','','a','b','c','d','e','','',''))}",
        "flatten()": "{flatten()}",
        "flatten(0)": "{flatten(0)}",
        "flatten(getArray())": "{flatten(getArray())}",
        "flatten(getArray(0))": "{flatten(getArray(0))}",
        "flatten([1,2],[3,[4,5]],6)": "{flatten(getArray(1,2),getArray(3,getArray(4,5)),6)}"
      }
    }
  }
}
```

## Run standalone QR dapp connection: 

You can use [Playground IDE in GameChanger Wallet ](https://wallet.gamechanger.finance/playground) in `QR URL Transport` mode to capture results

[![This GCScript/URL is too large! make it shorter uploading parts to GCFS. Unable to generate QR code](Array%20Manipulation%20Functions.png)](https://gamechangerfinance.github.io/gamechanger.wallet/examples/Array%20Manipulation%20Functions.png)

## Resources
- [How to connect?](https://www.npmjs.com/package/@gamechanger-finance/gc)
- [Docs and examples on Github](https://github.com/GameChangerFinance/gamechanger.wallet/)
- [GCScript documentation](https://wallet.gamechanger.finance/doc/api/v2)
- [Playground IDE in GameChanger Wallet ](https://wallet.gamechanger.finance/playground)
- [Tutorials on Youtube](https://www.youtube.com/@gamechanger.finance)
- [Support on Discord](https://discord.gg/vpbfyRaDKG)
- [News on Twitter](https://twitter.com/GameChangerOk)
- [Website](https://gamechanger.finance)

## License
MIT 
    
