Skip to content

Instantly share code, notes, and snippets.

View MorenoMdz's full-sized avatar
🎯
Focusing

MorenoMdz

🎯
Focusing
  • Self
  • Florianópolis
View GitHub Profile
/**
*
This challenge requires you to return the string "true" if the second integer parameter (num2) is larger than the first (num1). This is actually a very simple challenge which doesn't require a lot of code.
*/
function CheckNums(num1, num2) {
if (num2 > num1) {
return true;
}
return false;
@MorenoMdz
MorenoMdz / Alphabet Soup code challenge
Created May 16, 2018 14:33
Alphabet Soup code challenge
/**
* This challenge requires you to alphabetically sort the characters in a string. We'll sort the characters using the built-in array sort function.
*/
function AlphabetSoup(str) {
// Convert the passed str into an array of chars with split then sort the array in alphabetical order
var chars = str.split('');
var sorted = chars.sort();
// Return the rebuilt string
return sorted.join('');
/**
This challenge requires you to convert an integer, which represents the number of minutes, for example 63 means 214 minutes, and convert this integer into hours and minutes. So if the input was 63, then your program should output the string '1:3' because 63 minutes converts to 1 hour and 3 minutes.
We will use the modulo operation to solve this challenge. The modulo operation simply returns the remainder after a division, so for example, the remainder of 5 / 2 is 1, so the modulo of 5 / 2 is 1.
*/
function TimeConvert(num) {
// to get the hours, we divide num by 60 and round it down
// e.g. 61 / 60 = 1 hour
// e.g. 43 / 60 = 0 hours
...
findUserLike(likes) {
const { auth } = this.props;
const hasLiked =
likes.filter(like => like.user === auth.user.id).length > 0;
if (hasLiked) {
return true;
} else {
return false;
@MorenoMdz
MorenoMdz / cadastro_pessoas.alg
Last active December 5, 2025 15:42
VisualG Portugol cadastro de pessoas
Algoritmo "cadastro"
// Disciplina : ENG SOFT - ALGORITMOS E LÓGICA DE PROGRAMAÇÃO I - 2018B1
// Descrição : Mapa, cadastro de pessoas
Tipo
cad_pessoa = registro
nome : caractere
nome : caractere
idade : inteiro
sexo : caractere
@MorenoMdz
MorenoMdz / bolha.cpp
Created June 24, 2018 03:34
Bubble sort C
#include <stdlib.h>
#include <stdio.h>
main(){
// n posição do vetor, contador do laço
int aux, n, m, bolha[10];
for(n =1; n<= 10; n++){
printf("Digite o %d numero do vetor:", n);
scanf("%d", &bolha[n]);
@MorenoMdz
MorenoMdz / IMC.cpp
Created June 24, 2018 21:52
Cadastro de alunos e cáculo de IMC com avaliação
// Programa para o cáculo do IMC com avaliação
#include <stdio.h>
#include <locale.h>
#include <stdlib.h>
#include <string.h>
// maximo de cadastros na agenda 20
#define MAX 20
// strutura chamada Aluno onde será armazenado nome, e-mail, peso e altura.
struct aluno {
@MorenoMdz
MorenoMdz / zombie.js
Created June 28, 2018 22:43
Quick zombie text adventure js game
/**
* 1. Zombie Game
* -------------
* A. Write Scenarios
* B. Store a list of possible scenarios
* C. Alert a random scenario from the list
*
* A. Create a list of weapons
* B. Save a list of weapons
* C. Alert which weapon the player finds
@MorenoMdz
MorenoMdz / bematech.js
Created July 4, 2018 15:44
Bematech termal printer USB driver for NodeJS with serialport module
const serialport = require('serialport');
/* serialport.list(function(err, result) {
console.log('error: ', err);
console.log('result: ', result);
});
*/
const port = new serialport('COM9');