This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void rotina (int n, int* v) { | |
int i, temp; | |
int troca = 0; | |
for (i=0; i < n-1; i++) | |
if (v[i] > v[i+1]) { | |
temp = v[i]; | |
v[i] = v[i+1]; | |
v[i+1] = temp; | |
troca = 1; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
main: | |
# n = 6 | |
addi $s0, $zero, 6 | |
# por padrao registradores $aX guardam os params | |
add $a0, $s0, $zero | |
# chama rotina | |
jal ROT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
fontc=`tput setab 0` # black | |
back=`tput setaf 2` # green | |
delim=" %%% " | |
ColEcho() { | |
echo "$(tput setab 3)$(tput setaf 4)${delim}${fontc}$1${back}$(tput setab 3)$(tput setaf 4)${delim}" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Load the TCP Library | |
net = require('net'); | |
// Keep track of the chat clients | |
var clients = []; | |
// Start a TCP Server | |
net.createServer(function (socket) { | |
// Identify this client |