A Pen by Brad Traversy on CodePen.
This file contains hidden or 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
| /** | |
| * | |
| 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; |
This file contains hidden or 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
| /** | |
| * 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 file contains hidden or 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
| /** | |
| 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 |
This file contains hidden or 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
| 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 |
This file contains hidden or 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
| #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]); |
This file contains hidden or 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
| // 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 { |
This file contains hidden or 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
| /** | |
| * 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 |
This file contains hidden or 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
| const serialport = require('serialport'); | |
| /* serialport.list(function(err, result) { | |
| console.log('error: ', err); | |
| console.log('result: ', result); | |
| }); | |
| */ | |
| const port = new serialport('COM9'); |