randomrange lazarus / 21-General ---------------------------------------------------------------------- BubikolRamios · 2025-12-06 09:07 Is that really useful for small ranges ? I can tell there are 1000+  just 1 before and 1000+  just 2 after (see image) randomize does no change anything at all. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i   for ...  begin     randomize();    random12 := RandomRange(1,3);     SynEdit1.Lines.Add(IntToStr(random12 ));    end; Any suggestion ? ---------------------------------------------------------------------- Thaddy · 2025-12-06 09:21 I don't see anything wrong. A random in the range 1..3 is returned. 3 is not part of the range... see: https://www.freepascal.org/docs-html/rtl/math/randomrange.html So the function can only return 1 or 2 and it does.Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i //tested with{$ifdef fpc}{$mode objfpc}{$endif}uses math;type range = 0..999;var i:integer;begin  randomize;  for i in range do writeln(i:5,randomrange(1,3):2);end.If 3 needs to be included, make the upper range 4. ---------------------------------------------------------------------- BubikolRamios · 2025-12-06 09:36 Ahh, forget that, works fine. Had SynEdit1.Lines.Add(IntToStr(random12 )) inside wrong loop. Thanks.