diff options
author | Björn Gustavsson <[email protected]> | 2015-12-14 15:44:55 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2015-12-14 15:44:55 +0100 |
commit | b68383dd9cc7515ec0d37b370a2fc8db7f119211 (patch) | |
tree | 475345061572f9c4e73218f2d7f5f80259cbee3b /lib/wx | |
parent | e45ed5449659ac615fcf3c8234a57cf8a10fdc42 (diff) | |
parent | 61fd09aaef2474cd74ddbc465e9d1dfd879a4ab5 (diff) | |
download | otp-b68383dd9cc7515ec0d37b370a2fc8db7f119211.tar.gz otp-b68383dd9cc7515ec0d37b370a2fc8db7f119211.tar.bz2 otp-b68383dd9cc7515ec0d37b370a2fc8db7f119211.zip |
Merge branch 'bjorn/deprecate-random/OTP-12502'
* bjorn/deprecate-random/OTP-12502:
Deprecate the 'random' module
Eliminate mentions of 'random' in documentation
mnesia tests: Replace 'random' with 'rand'
percept tests: Replace 'random' with 'rand'
system tests: Replace 'random' with 'rand'
common_test tests: Replace 'random' with 'rand'
gs: Remove the contribs directory
wx: Replace 'random' with 'rand'
stdlib tests: Replace 'random' with 'rand'
kernel test: Replace 'random' with 'rand'
debugger tests: Replace 'random' with 'rand'
compiler tests: Replace 'random' with 'rand'
Emulator test suite: Replace use of 'random' with 'rand'
Use 'rand' instead of the obsolete 'random' module
compile: Eliminate use of the obsolete 'random' module
Diffstat (limited to 'lib/wx')
-rw-r--r-- | lib/wx/examples/demo/ex_canvas.erl | 2 | ||||
-rw-r--r-- | lib/wx/examples/sudoku/sudoku_game.erl | 7 |
2 files changed, 4 insertions, 5 deletions
diff --git a/lib/wx/examples/demo/ex_canvas.erl b/lib/wx/examples/demo/ex_canvas.erl index cdc783055c..acc94743d6 100644 --- a/lib/wx/examples/demo/ex_canvas.erl +++ b/lib/wx/examples/demo/ex_canvas.erl @@ -219,4 +219,4 @@ redraw(DC, Bitmap) -> wxMemoryDC:destroy(MemoryDC). get_pos(W,H) -> - {random:uniform(W), random:uniform(H)}. + {rand:uniform(W), rand:uniform(H)}. diff --git a/lib/wx/examples/sudoku/sudoku_game.erl b/lib/wx/examples/sudoku/sudoku_game.erl index e3c39b4ec9..8bb5fe4d38 100644 --- a/lib/wx/examples/sudoku/sudoku_game.erl +++ b/lib/wx/examples/sudoku/sudoku_game.erl @@ -151,8 +151,7 @@ test() -> %% Known to solvable {{9,2},4}, {{9,4},5}, {{9,6},8}, {{9,8},7}]. new_game(S) -> - {X,Y,Z} = erlang:now(), - random:seed(Y,X,Z), + rand:seed(exsplus), case new_game(1,1,gb_sets:empty(),empty_table(S#s{}),[], 0) of stop -> new_game(S); Game -> Game @@ -171,7 +170,7 @@ new_game(R,C,BT,St,Acc,Cnt) when R < 10, C < 10 -> [{{BR,BC},BVal,BBT,BST}|BAcc] = Acc, new_game(BR,BC,gb_sets:add(BVal,BBT),BST,BAcc,Cnt+1); Size -> - Ind = random:uniform(Size), + Ind = rand:uniform(Size), V = lists:nth(Ind,gb_sets:to_list(S)), new_game(R,C+1,gb_sets:empty(), add({R,C,M},V,St), @@ -207,7 +206,7 @@ pick_shown(Given,Left,S0,Level,Gfx) -> io:format("Below level ~p ~p~n", [GivenSz,Level]), S0; true -> - Ran = random:uniform(LeftSz), + Ran = rand:uniform(LeftSz), V = lists:nth(Ran,gb_sets:to_list(Left)), S1 = rebuild_all(rcm(V),S0#s{v=setelement(V,S0#s.v,0)}), case solve(S1, true) of |