Mostrando las entradas con la etiqueta programming. Mostrar todas las entradas
Mostrando las entradas con la etiqueta programming. Mostrar todas las entradas

jueves, 10 de agosto de 2023

Extraordinarios inventos de los jugadores de Minecraft

Extraordinarios inventos de los jugadores de Minecraft

Lanzado hace 10 años, Minecraft abrió un camino fácil hacia la creatividad para todos. Naturalmente, no pudo sino dar lugar a una gran ola de obras. Pero en la caja de arena encarnan no solo bellas obras maestras, sino también mecanismos complejos. Para que pueda ver los más fascinantes sin usar mods de Minecraft, hemos recopilado los más inusuales.

Hay tres bloques en el juego que han demostrado ser especialmente útiles para los inventores:

  • Pistón: cuando se activa, empuja un bloque frente a sí mismo a 1 bloque de sí mismo;
  • Pistón pegajoso: un bloque que toca el pistón se "pega" a él y puede empujar bloques frente a él;
  • Un bloque de limo es un bloque "pegajoso" que se adhiere a cualquier pistón y se adhiere a los bloques que lo tocan.

Un grupo de estos bloques le permite crear vehículos completamente autónomos: pueden avanzar sin ningún tipo de presión lateral.

Pero incluso esto no fue suficiente. Por lo tanto, los diseñadores especialmente ingeniosos han creado un enorme robot que se mueve con los mismos pistones. ¡También dispara dinamita!


Bloques de Comando

Por separado, vale la pena mencionar los bloques de comandos.

Los bloques de comando son computadoras en miniatura: realizan una función cuando se activan. En este caso, el propio bloque puede ser un activador de otro bloque.

El conjunto de comandos en bloques es grande, por lo que los jugadores con dicho dispositivo tienen muchas oportunidades. Y están dispuestos a usarlo. Por ejemplo, sin usar Minecraft Seeds, puede crear una emulación de inteligencia artificial: un NPC que sigue al jugador.

Computadora de Trabajo

Las características de Minecraft te permiten crear una computadora completa en el juego. Por supuesto, no puede ejecutar DOOM en él, pero admite una calculadora, entrada de caracteres desde un teclado muy grande, muestra y cambia la hora del día.

jueves, 14 de noviembre de 2019

The Best PHP Tricks For Beginners

The Best PHP Tricks For Beginners

PHP is the most widely used programming language on the Web. Introducing thirty-some of the best tricks for beginners who want to learn basic skills - php for beginners.

Make Friends with the PHP Reference

If you're new to PHP, then it's time to take a look at the respectful PHP reference. The PHP reference is incredibly comprehensive and contains really useful comments for each article. Before asking questions or trying to solve the problem yourself, save time and just take a course on the reference. The answers to your questions are already conveniently posted in a useful article on PHP.net.

Enable error reporting

The bug report in PHP is very useful. You will find errors in your code that you have not noticed before, but not all of them interfere with the application. There are different levels of detail of the report that you can use, but E_ALL will equally represent you all errors, critical situations and warnings.

When your application is ready for productive operation, you will have to turn off the error report, otherwise your visitors will see strange messages in which they understand nothing.

Try IDE

IDEs (Integrated Development Environments) are useful tools for any developer. Although they are not suitable for everyone, IDEs definitely have their own meaning. IDEs provide tools such as:
  • Syntax highlighting
  • Code completion (identifier hints in the code editor)
  • Error warnings
  • Code refactoring (code alteration)
As well as a large number of other features. There are many great IDEs that support PHP.

Integrated Development Environments

Try PHP Frameworks

You can learn a lot about PHP just by experimenting with PHP frameworks. Frameworks such as CakePHP or CodeIgniter allow you to quickly create PHP applications, even if you are not an expert in it. In a way, they are additional props that show you what a PHP application should look like and demonstrate useful programming concepts (such as separating logic from design, etc.).

Learn DRY

DRY is an abbreviation of Don’t Repeat Yourself, (Do Not Repeat), and it is a useful programming concept, no matter what language. DRY programming, as the name suggests, ensures that you don't write redundant code. Here is an example from Reinhold Weber:

Don’t Repeat Yourself

Use Output Buffering

Output buffering is an easy way to greatly improve the quality and speed of your PHP script. Without buffering the output, your script will display the HTML on the page as it is processed - in parts. Adding output buffering allows PHP to store HTML as a variable and send it to the browser in a single batch.