Replies: 3 comments 8 replies
-
|
@peeble111 Does it work in CPython? |
Beta Was this translation helpful? Give feedback.
-
|
I modified the script B='@ class ddTableDeal: class ddTableResults: tableDeal = ddTableDeal() i = 0 CalcDDtable(tableDeal, Ptr(tablep)) strain = ('S', 'H', 'D', 'C', 'N') ''' but I got: |
Beta Was this translation helpful? Give feedback.
-
|
codon run mre.codon |
Beta Was this translation helpful? Give feedback.

Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
work in cpython:
import ctypes
_dll_path = '/dvb/bridge_bin/predeal/REDEAL/libdds.so'
_dll = ctypes.CDLL(_dll_path)
class ddTableResults(ctypes.Structure):
...._fields_ = [("resTable", (ctypes.c_int * 4) * 5)]
class ddTableDeal(ctypes.Structure):
...._fields_ = [("cards", (ctypes.c_uint * 4) * 4)]
tablep = ddTableResults()
tableDeal = ddTableDeal()
B='@
\x00\x00(A\x00\x00\x00$\x00\x00 \x07\x00\x00\x84\x08\x00\x00D8\x00\x00(\t\x00\x00\x00\x08\x00\x00\x00\x07\x00\x00\x90\x02\x00\x00\x10\x10\x00\x00\xc4\x00\x008\x10\x00\x00\x00\x04\x00\x00\xc4B\x00\x00\x18\x10\x00\x00'b = [ord(c) for c in B]
i = 0
for p in range(4):
....for s in range(4):
........tableDeal.cards[p][s] = b[i]+b[i+1]*256+b[i+2]*65536+b[i+3]*16777216
........i += 4
_dll.CalcDDtable(tableDeal, ctypes.byref(tablep))
strain = ('S', 'H', 'D', 'C', 'N')
print(' N E S W')
i = 0
for T in tablep.resTable:
....print(f'{strain[i]}', end=' ')
....for t in T:
........print(f'{t:2d}', end=' ')
....i += 1
....print()
how in codon i have to do ddTableResults and ddTableDeal ?
thanks in advance
Pierpaolo
Beta Was this translation helpful? Give feedback.
All reactions