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
int ledPin = 13; | |
int buttonPin = 9; | |
bool ledState = false; //false - wyłączona, true - włączona | |
void setup() { | |
pinMode(ledPin, OUTPUT); | |
pinMode(buttonPin, INPUT); | |
} | |
void loop() { |
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
#include <iostream> | |
//przykład funkcji z i bez referencji | |
//dwie poniższe funkcje robią dokładnie to samo, tylko jedna używa referencji a druga nie | |
void referencja(int &a) { | |
a *= a; | |
} | |
int nieReferencja(int a) { | |
return a*a; |
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
#include <iostream> | |
#include <array> | |
int main() { | |
std::array<int, 10> a{1, 2, 4, 8, 16, 32, 64, 128, 256, 512}; | |
auto iter = a.begin(); | |
for(int i = 0; i < 10; ++i) | |
std::cout << *iter++ << std::endl; | |
return 0; | |
} |
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
#ifndef __SFML_DRAWABLES_HPP__ | |
#define __SFML_DRAWABLES_HPP__ | |
#include <iostream> | |
#include <SFML/Graphics.hpp> | |
class Something : public sf::Drawable { //direct inheritance from sf::Drawable (Something -> sf::Drawable) | |
private: | |
sf::RectangleShape somethingShape; | |
virtual void draw(sf::RenderTarget& target, sf::RenderStates states) const { |
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
// Credits to Vesim987 | |
// - no structures | |
// - no headers | |
// - maximum 2 called functions | |
// - one declared function | |
// - no defined functions | |
// - mindfuck | |
//monster: | |
#define DWORD unsigned long |
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
#include <iostream> | |
int main() { | |
std::cout << "Hello, world!" << std::endl; | |
return 0; | |
} |
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
#include <iostream> | |
int main() { | |
int variable; | |
std::cout << variable << std::endl; | |
variable = 12; | |
std::cout << variable << std::endl; | |
return 0; |
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
#include <iostream> | |
int main() { | |
//operacja dodawania | |
int sum {2 + 2}; | |
//operacja mnożenia | |
int multiplication {3 * 4}; | |
//dzielenie z użyciem operatora przypisania |
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
#include <cmath> | |
#include <iostream> | |
int main() { | |
double power {std::pow(2., 3.)}; | |
std::cout << "2 to the power of 3: " << power << std::endl; | |
return 0; | |
} |
OlderNewer