Skip to content
Snippets Groups Projects
Commit 74a1c4d5 authored by PEREZ-SIERRA ERIC's avatar PEREZ-SIERRA ERIC
Browse files

Maintenant le code prends un entier écrit par l'utilisateur comme argument pour la borne sup.

parent accb61ae
Branches
Tags
No related merge requests found
.data
prompt: .asciiz "Saissiez la borne supérieure y [x,y[ pour les nombres aleatoires:\n"
.text
li $v0, 4
la $a0, prompt
syscall
# On fait un appel systeme 5 pour lire un entier
li $v0, 5
syscall
move $t0, $v0
move $a1, $t0
# $a1 contient maintenant la borne supérieure
# $a1 doit contenir la borne superieure
li $a1, 16 #Here you set $a1 to the max bound.
li $v0, 42 #generates the random number.
syscall
li $v0, 1 # 1 pour afficher l'entier trouvé de façon aleatoire
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment