//Write your own contracts here. Currently compiles using solc v0.4.15+commit.bbb8e64f. pragma solidity ^0.4.24; contract Sorter { uint public totalUsers = 0; mapping (uint => uint) public userMap; string[][2] public userDetails; uint[][][2] public adjMatrix; constructor(uint initVal) public { // loopVar = initVal*50; totalUsers = 0; } function runLoop() view public{ uint a=0; for (uint i = 0; i < loopVar; i++) { a++; } } function registerUser(uint userID, string userName) view public{ // userDetails[totalUsers][0] = string(userID); // userDetails[totalUsers][0] = userName; userMap[userID] = totalUsers; adjMatrix[totalUsers][] = [-1, -1]; adjMatrix[][totalUsers] = [-1, -1]; totalUsers += 1; } function createAcc(uint userID1, uint userID2) view public{ uint x = exponentialsample adjMatrix[ userMap[userID1], userMap[userID2] ] = [x/2, x/2]; } function sendAmount(uint userID1, uint userID2) view public{ // find the shortest path between userMap[userID1], userMap[userID2] // path = [a, b, c, d]; a->d for i in range(len(path)-1): adjMatrix[ path[i] ][ path[i+1] ][0] -= 1; adjMatrix[ path[i] ][ path[i+1] ][1] += 1; } function closeAcc(uint userID1, uint userID2) view public{ adjMatrix[ userMap[userID1], userMap[userID2] ] = [-1, -1]; } }
0.4.18