Add `random()` and `random_seed()`

Abierto
#141 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
68/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Tranquilo
Stack tecnológico
rust
Área
api

Línea de trabajo

Comienza por las páginas de referencia de random() y randomSeed() enlazadas en el issue y, después, localiza los puntos de entrada correspondientes de la Processing API en libprocessing. Implementa ambas funciones con el comportamiento documentado para uno y dos parámetros, y con una salida determinista al usar una semilla; verifica que la API resultante coincida con esos ejemplos.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

api c-pyo3 needs-discussion

From the random() reference page:

Generates random numbers. Each time the random() function is called, it returns an unexpected value within the specified range. If only one parameter is passed to the function, it will return a float between zero and the value of the high parameter. For example, random(5) returns values between 0 and 5 (starting at zero, and up to, but not including, 5).

If two parameters are specified, the function will return a float with a value between the two values. For example, random(-5, 10.2) returns values starting at -5 and up to (but not including) 10.2. To convert a floating-point random number to an integer, use the int() function.

From the randomSeed() reference page:

Sets the seed value for random(). By default, random() produces different results each time the program is run. Set the seed parameter to a constant to return the same pseudo-random numbers each time the software is run.

Lenguaje dominante
Rust
Estrellas
69
Forks
14
Merge medio
15 d 22 h
PR fusionados (30 d)
3

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de processing/libprocessing

Todos los issues de processing/libprocessing

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.