Links

Search This Blog

March 30, 2022

Name Surname Combo

Here's little word game in Py

Nomen est omen.



or

March 26, 2022

JS Random function

Simple JS Random function takes two argument first is minimal random number second is maximum random number (originally designed for integers).

We could also add default numbers.

 

function rndmm(minnum,maxnum){
  var rndmath = Math.floor(Math.random()*(maxnum+1-minnum))+minnum;
  return rndmath;
}

 

That's it for today, I guess.

Nothing special.

I guess I'll add translated function for Py(2|3).x later.


March 13, 2022

Split on Nth place

For those who stumble on this.

Translated from Python to JavaScript.
 

function nthsplit(line,n){
var i;
var arr = [];
  for(i=0;i<line.length;i+=n){
   arr.push(line.substring(i,i+n));
  }
  return arr;
}

 

Code originally found on StackOverFlow posted by Satomacoto