| scotty (14) | |
| . | |
|
Last edited on
|
|
| JLBorges (1752) | |||
| |||
|
Last edited on
|
|||
| Smac89 (195) | |||
| |||
|
|
|||
| L B (3805) | |
|
What was wrong with JL's? EDIT: The OPer deleted his post, could someone repost it? | |
|
Last edited on
|
|
| Smac89 (195) | |
|
Op deleted thread ^ Nothing wrong with his, just wanted to post mine Here: mport numpy as nu import pylab as py m=nu.zeros(11,int) for i in range(1000): A=nu.random.randint(6)+1 B=nu.random.randint(6)+1 n=A+B-2 m[n]=m[n]+1 print m so that produces an array in the form [ 32 44 81 106 126 172 138 119 93 58 31] where the 1st position corresponds to the number of 2s the second the number of 3s the third the number of 4s and so on.... m starts as [0,0,0...] then m[n] corresponds to the position in the array with m[0] being the 1st position third line could be m=[0,0,0,0,0,0,0,0,0,0,0] Needed it to be converted to c++ | |
|
Last edited on
|
|
| scotty (14) | |
|
When I put JL's into Microsoft Visual studio it says: Error 1 error C2039: 'mt19937' : is not a member of 'std' Error 2 error C2065: 'mt19937' : undeclared identifier any help? and Smac89 - when I put yours in it only shows the vector.. | |
|
|
|
| L B (3805) | |
|
@Scotty you need a compiler that supports C++11 In MSVC I think you can get some things through the tr1:: namespace http://msdn.microsoft.com/en-us/library/bb982198(v=vs.90).aspx | |
|
|
|
| scotty (14) | |
| I've got to write it in Microsoft Visual Studio 2010 in c++ for my assignment unfortunately. | |
|
|
|