From 441a0f86923317cb7551cd3be80c8986d025e280 Mon Sep 17 00:00:00 2001 From: shashkevichfrida Date: Fri, 15 Dec 2023 18:00:48 +0300 Subject: [PATCH] slot, roulette done --- Craps/config.json | 2 +- Craps/craps.go | 2 -- Craps/go.mod | 2 -- Craps/go.sum | 4 ---- Roulette/Roulette.go | 5 ++--- Roulette/config.json | 1 + Roulette/go.mod | 5 +++++ Roulette/go.sum | 2 ++ Roulette/roulette.nef | Bin 0 -> 542 bytes Roulette/roulette.yml | 5 +++++ SlotMashine/config.json | 2 +- SlotMashine/config.yml | 6 ------ SlotMashine/go.mod | 2 +- SlotMashine/go.sum | 4 ++-- SlotMashine/slot.nef | Bin 609 -> 590 bytes 15 files changed, 20 insertions(+), 22 deletions(-) create mode 100755 Roulette/config.json create mode 100644 Roulette/go.mod create mode 100644 Roulette/go.sum create mode 100755 Roulette/roulette.nef create mode 100644 Roulette/roulette.yml mode change 100644 => 100755 SlotMashine/config.json mode change 100644 => 100755 SlotMashine/slot.nef diff --git a/Craps/config.json b/Craps/config.json index 6a19ca8..46d97a7 100755 --- a/Craps/config.json +++ b/Craps/config.json @@ -1 +1 @@ -{"name":"Craps","abi":{"methods":[{"name":"_deploy","offset":0,"parameters":[{"name":"data","type":"Any"},{"name":"isUpdate","type":"Boolean"}],"returntype":"Void","safe":false},{"name":"onNEP17Payment","offset":313,"parameters":[{"name":"from","type":"Hash160"},{"name":"amount","type":"Integer"},{"name":"data","type":"Any"}],"returntype":"Void","safe":false},{"name":"playCraps","offset":95,"parameters":[{"name":"bet","type":"Integer"},{"name":"firstSum","type":"Integer"},{"name":"secondSum","type":"Integer"}],"returntype":"Void","safe":false}],"events":[]},"features":{},"groups":[],"permissions":[{"contract":"*","methods":"*"}],"supportedstandards":[],"trusts":[],"extra":null} \ No newline at end of file +{"name":"Craps","abi":{"methods":[{"name":"_deploy","offset":0,"parameters":[{"name":"data","type":"Any"},{"name":"isUpdate","type":"Boolean"}],"returntype":"Void","safe":false},{"name":"onNEP17Payment","offset":313,"parameters":[{"name":"from","type":"Hash160"},{"name":"amount","type":"Integer"},{"name":"data","type":"Any"}],"returntype":"Void","safe":false},{"name":"playCraps","offset":95,"parameters":[{"name":"bet","type":"Integer"},{"name":"firstSum","type":"Integer"},{"name":"secondSum","type":"Integer"}],"returntype":"Void","safe":false}],"events":[]},"features":{},"groups":[{"pubkey":"027171df30177d401c638fb2ddc14f9dbda323291e363ba4f7c3b19a8b44c8ba0a","signature":"BK6YPJGG/GLKsVxdPra+Ti4p7Q2D502dzz8FXV8kYntGrd4IigAyXR4do0pUPLRBnZHUqZXpPo7+jkQko/hCIQ=="}],"permissions":[{"contract":"*","methods":"*"}],"supportedstandards":[],"trusts":[],"extra":null} \ No newline at end of file diff --git a/Craps/craps.go b/Craps/craps.go index b5def96..41a9867 100644 --- a/Craps/craps.go +++ b/Craps/craps.go @@ -9,8 +9,6 @@ import ( ) const ( - gasDecimals = 1_0000_0000 - initialBalance = 3000 zaCoinHashKey = "zaCoinHash" ) diff --git a/Craps/go.mod b/Craps/go.mod index 6531e63..1bc38fa 100644 --- a/Craps/go.mod +++ b/Craps/go.mod @@ -3,5 +3,3 @@ module Craps go 1.21.4 require github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20231121104256-0493ddbd70b2 - -require github.com/nspcc-dev/neo-go v0.104.0 // indirect diff --git a/Craps/go.sum b/Craps/go.sum index aa82492..080fa54 100644 --- a/Craps/go.sum +++ b/Craps/go.sum @@ -1,6 +1,2 @@ -github.com/nspcc-dev/neo-go v0.104.0 h1:FGj3Z46yABcFIAI1SCLd1jQSoh+B00h/2VAgEgY1JKQ= -github.com/nspcc-dev/neo-go v0.104.0/go.mod h1:omsUK5PAtG2/nQ3/evs95QEg3wtkj3LH53e0NKtXVwQ= -github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20231020160724-c3955f87d1b5 h1:09CpI5uwsxb1EeFPIKQRwwWlfCmDD/Dwwh01lPiQScM= -github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20231020160724-c3955f87d1b5/go.mod h1:J/Mk6+nKeKSW4wygkZQFLQ6SkLOSGX5Ga0RuuuktEag= github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20231121104256-0493ddbd70b2 h1:hPVF8iMmsQ15GSemj1ma6C9BkwfAugEXsUAVTEniK5M= github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20231121104256-0493ddbd70b2/go.mod h1:J/Mk6+nKeKSW4wygkZQFLQ6SkLOSGX5Ga0RuuuktEag= diff --git a/Roulette/Roulette.go b/Roulette/Roulette.go index 196936c..09d490e 100644 --- a/Roulette/Roulette.go +++ b/Roulette/Roulette.go @@ -8,8 +8,6 @@ import ( ) const ( - gasDecimals = 1_0000_0000 - initialBalance = 3000 zaCoinHashKey = "zaCoinHash" ) @@ -44,8 +42,9 @@ func PlayRoulette(bet int, selectedNumber int) { } func isWinner(selectedNumber int) bool { + rouletteNumberMes := "Roulette number: " rouletteNumber := (runtime.GetRandom() % 36) + 1 - runtime.Notify("Roulette number:", rouletteNumber) + runtime.Notify(rouletteNumberMes, rouletteNumber) return rouletteNumber == selectedNumber } diff --git a/Roulette/config.json b/Roulette/config.json new file mode 100755 index 0000000..c2764e4 --- /dev/null +++ b/Roulette/config.json @@ -0,0 +1 @@ +{"name":"Roulette","abi":{"methods":[{"name":"_deploy","offset":0,"parameters":[{"name":"data","type":"Any"},{"name":"isUpdate","type":"Boolean"}],"returntype":"Void","safe":false},{"name":"onNEP17Payment","offset":225,"parameters":[{"name":"from","type":"Hash160"},{"name":"amount","type":"Integer"},{"name":"data","type":"Any"}],"returntype":"Void","safe":false},{"name":"playRoulette","offset":95,"parameters":[{"name":"bet","type":"Integer"},{"name":"selectedNumber","type":"Integer"}],"returntype":"Void","safe":false}],"events":[]},"features":{},"groups":[{"pubkey":"027171df30177d401c638fb2ddc14f9dbda323291e363ba4f7c3b19a8b44c8ba0a","signature":"FcCvRQaSYi8vaeDWGYxyHVclTxuuvTX5SagRGaoz018rX579K1GGi13EVJHix9iADDni/QSYOPNxH6Y2RzxXpA=="}],"permissions":[{"contract":"*","methods":"*"}],"supportedstandards":[],"trusts":[],"extra":null} \ No newline at end of file diff --git a/Roulette/go.mod b/Roulette/go.mod new file mode 100644 index 0000000..1acfc2e --- /dev/null +++ b/Roulette/go.mod @@ -0,0 +1,5 @@ +module Roulette + +go 1.21.5 + +require github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20231214154544-3766206f441a diff --git a/Roulette/go.sum b/Roulette/go.sum new file mode 100644 index 0000000..8471af9 --- /dev/null +++ b/Roulette/go.sum @@ -0,0 +1,2 @@ +github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20231214154544-3766206f441a h1:1AVlB7TD9HC+PutOO1rzNhJ/6t1ieGX1ULIj2ReH+g4= +github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20231214154544-3766206f441a/go.mod h1:J/Mk6+nKeKSW4wygkZQFLQ6SkLOSGX5Ga0RuuuktEag= diff --git a/Roulette/roulette.nef b/Roulette/roulette.nef new file mode 100755 index 0000000000000000000000000000000000000000..dd061baef5a84def36a628fafe043d9a438e2a65 GIT binary patch literal 542 zcmeZsbu-RO&DTxO*EP^HG%(gPWFQaxJ;xZ%#8j!q>`>u#(@}-xwqrqtz&WoQDy*lJ zSX>1dL^M=*5OFvhb$-@Pa z@Bk_U8WQaI%wD3!A)JK?EMMTL8^~cGe6Fz4M5!oCO}L^mz{I;aBQrbL^a9ZBN<0~v z6|;j)j{w;Y;mnLYffp)M}WG-+J0J?w~;(`oh7X~;^ihW_|b<+Uo zX@f#X%iuhlqO9WV8)|HsHSWNlAf~zJ6*&Vs1fBs$Oz_uKq?>RwkBT@;>GO>}?D%